# mise à jour
adg
sudo apt update && sudo apt upgrade
# reboot
reboot
# shutdown
poweroff
Astuces
# cp is by default an alias to cp -i# to use cp only:
\cp# get OS version, kernel version, architecture, hostname
hostnamectl
# create a daemon user
sudo useradd -r -s /usr/sbin/nologin -N -g nogroup <user>
# install apt-transport-https and curl if not yet installed
sudo apt-get install apt-transport-https curl
# add mariadb release signing key
sudo curl -o /etc/apt/trusted.gpg.d/mariadb_release_signing_key.asc 'https://mariadb.org/mariadb_release_signing_key.asc'
Add the repo
/etc/apt/sources.list.d/mariadb.list
# MariaDB 10.10 repository list
deb https://mirrors.ircam.fr/pub/mariadb/repo/10.10/ubuntu bionic main
# deb-src https://mirrors.ircam.fr/pub/mariadb/repo/10.10/ubuntu bionic main# deb https://mirrors.ircam.fr/pub/mariadb/repo/10.10/ubuntu bionic main/debug
wget https://releases.wikimedia.org/mediawiki/1.35/mediawiki-1.35.6.tar.gz
tar xf mediawiki-*.tar.gz
sudo mv -T mediawiki-* /var/www/mediawiki
# peut-être pas nécessaire car fait lors de la configurationCREATEUSER'my_user'@'localhost' IDENTIFIED BY'password';
CREATE DATABASE my_wiki;
USE my_wiki;
GRANTALLON my_wiki.*TO'my_user'@'localhost';
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 derniersource /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# 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>
# tester la syntaxe (possibilité de revert)
sudo netplan try
sudo netplan generate
sudo netplan apply
# --debug if you run into some issues# créé le fichier /run/systemd/network/10-netplan-eth0.network# vérifier la configuration en cour
netplan ip leases [interface]
# fd !!! unable to install, memory overflow !!!
cargo install fd-find
# dust
cargo install du-dust
# rg
cargo install ripgrep
# bat
cargo install bat
# also installable with the deb package https://github.com/sharkdp/bat/releases# list packages installed with cargo
cargo install --list
# binaries are installed in ~/.cargo/bin
# The init.d script will only run if this variable non-empty.
AMULED_USER="amule"# You can set this variable to make the daemon use an alternative HOME.# The daemon will use $AMULED_HOME/.aMule as the directory, so if you# want to have $AMULED_HOME the real root (with an Incoming and Temp# directories), you can do `ln -s . $AMULED_HOME/.aMule`.
AMULED_HOME="/var/lib/amule-daemon"
# create the project
dotnet new console -o dotnet-console
# build the projectcd dotnet-console
dotnet build
# run the binary
bin/Debug/netcoreapp3.1/dotnet-console
ASP.NET Core with React.js and Redux
# create the project
dotnet new reactredux -o dotnet-reactredux
# install node.js and npm
sudo apt install nodejs npm
# build the projectcd dotnet-reactredux
dotnet build
# start the server
dotnet run
# only user gitolite3 can access to /var/lib/gitolite3/repositories# and gitweb runs under the www-data user# here is a way to give access at user www-data to /var/lib/gitolite3/repositories
sudo setfacl -RPm u:www-data:rX /var/lib/gitolite3/repositories
# before install copy your local ssh public key to the server (~/.ssh/id_rsa.pub → /tmp/<user>.pub)
sudo apt install gitolite3
# during installation a ssh public key is asked to allow the administrator to login, select the ssh public key you copied to the server# installation creates the user gitolite3 and its home directory /var/lib/gitolite3# test if it worked
ssh gitolite3@<server> info
# hello admin, this is gitolite3@<server> running gitolite3 3.6.7-2 (Debian) on git 2.17.1# clone the admin repository
git clone gitolite3@<server>:gitolite-admin
# create a new repo# clone gitolite-admin repo, edit gitolite.conf to add the repo, commit the change# add the newly created remote repository to your already existing local git repo
git remote add origin gitolite3@<server>:<project>
# push and set the remote as upstream
git push --set-upstream origin master
# 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