Ubuntu arm 18.04

De Banane Atomic
Aller à la navigationAller à la recherche

Liens

Commandes

Bash.svg
# mise à jour
adg
sudo apt update && sudo apt upgrade

# reboot
reboot

# shutdown
poweroff

Apache

  • Dossier de déploiement des web sites /var/www/html
  • Dossier des configurations des web sites /etc/apache2/sites-available
Bash.svg
# service apache
systemctl restart apache2
Utiliseur Apache: www-data

MySql / MariaDb

L'utilisateur root utilise par défaut l'authentification unix_socket.
Il faut donc utiliser sudo pour se connecter avec root et non pas le mdp.
Bash.svg
sudo apt install mariadb-server
# connexion avec root après l'installation
sudo mysql

# status
systemctl status mysql

phpmyadmin

Bash.svg
sudo apt install phpmyadmin
# coller dans ncurse: Shift + Insert
# login: phpmyadmin
# url: http://myserver/phpmyadmin
Mysql.svg
# accorder tous les privilèges au compte phpmyadmin
GRANT ALL ON *.* TO 'phpmyadmin'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;

Mediawiki

Bash.svg
wget https://releases.wikimedia.org/mediawiki/1.33/mediawiki-1.33.0.tar.gz
tar -xzf /mediawiki-*.tar.gz
sudo mv -T mediawiki-* /var/www/mediawiki
Mysql.svg
# peut-être pas nécessaire car fait lors de la configuration
CREATE USER 'my_user'@'localhost' IDENTIFIED BY 'password';
CREATE DATABASE my_wiki;
USE my_wiki;

GRANT ALL ON my_wiki.* TO 'my_user'@'localhost';

SSH

openssh est déjà installé et démarré.

Bash.svg
# sshfs
sudo apt install sshfs

zsh - oh my zsh

Bash.svg
apt install zsh zsh-syntax-highlighting
# zsh install zsh-common

# install oh-my-zsh et change de shell
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
~/.zshrc
# plugins
plugins=(common-aliases debian extract git sudo systemd wd)

# don't store in history commands prefixed with a space (test with: history | tail)
setopt HIST_IGNORE_SPACE

# zsh-syntax-highlighting, doit être sourcé en dernier
source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

Network Manager

Bash.svg
# vérifier que le packet est installé
dpkg -l "network-manager"

# vérifier que le service fonctionne
sc-status NetworkManager

# lister les connections
nmcli c show
# afficher les détails d'une connection
nmcli c show <NAME>

Glances

Service web équivalent à top. Service accessible via host:61208

Bash.svg
apt install glances

# démarrer le service web
glances -w

Reverse proxy to the Glances Web UI

/etc/apache2/sites-available/000-default.conf
# redirect host:80/glances to host:61208
RewriteEngine on
RewriteCond %{HTTP_REFERER} ^https?://[^/]+/glances
RewriteCond %{REQUEST_URI} !^/glances
RewriteCond %{THE_REQUEST} ^GET
RewriteRule ^/(.*) /glances/$1 [QSA,R]
ProxyPass /glances/ http://localhost:61208/
ProxyPassReverse /glances/ http://localhost:61208/
Redirect permanent /glances http://n2/glances/

Start Glances through Systemd

/etc/systemd/system/glances-web-ui.service
[Unit]
Description=Glances Web UI
After=network.target

[Service]
ExecStart=/usr/bin/glances -w
Restart=on-abort

[Install]
WantedBy=multi-user.target

Torrent

Bash.svg
sudo apt install transmission-daemon
# transmission-cli transmission-common

sc-status transmission-daemon
/etc/transmission-daemon/settings.json
{
    "rpc-port": 9091,
    "rpc-whitelist": "127.0.0.1,192.168.x.x",
    "peer-port": 51413,
}

Amule

Bash.svg
sudo apt install amule-daemon

Installation

Bash.svg
# ajouter un compte (-m: create the user's home directory)
sudo useradd -m -G users,sudo <username>

# changer le mot de passe d'un autre compte
sudo passwd <username>

# afficher la configuration courante (se reloguer pour voir les changements)
locale
# liste les locales disponibles
locale -a
# ajouter une locale (modifie le fichier /etc/locale.gen)
sudo locale-gen fr_CH.UTF-8
# définir une LANG (modifie la fichier /etc/default/locale)
update-locale LANG=fr_CH.UTF-8

# get current time zone
timedatectl status
# list all available time zone
timedatectl list-timezones
# set a timezone
sudo timedatectl set-timezone Europe/Paris