Liens
Commandes
|
adg
sudo apt-get update && sudo apt-get upgrade
reboot
poweroff
|
|
wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-2.1
|
|
sudo apt install nginx
systemctl status nginx
sudo systemctl reload nginx
|
 |
nginx user: www-data |
|
sudo ln -s /etc/nginx/sites-available/mydotnetcoresite.conf /etc/nginx/sites-enabled/mydotnetcoresite.conf
|
|
apt install php-fpm
systemctl status php7.0-fpm
|
/etc/php/7.0/fpm/php.ini
|
cgi.fix_pathinfo=0
|
/etc/nginx/sites-available/my-site.conf
|
server {
listen 80;
server_name my-site;
root /srv/my-site;
index index.php;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
}
|
 |
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. |
|
sudo apt install mariadb-server
sudo mysql_secure_installation
sudo mysql
create user 'mon_compte'@'localhost' identified with 'unix_socket';
grant all on *.* to 'mon_compte'@'localhost';
flush privileges;
create user 'dotnet'@'localhost' identified by 'my_password';
grant all on *.* to 'dotnet'@'localhost';
flush privileges;
mysql -u <my_user> -p
systemctl status mysql
|
|
alter user 'root'@'localhost' identified with 'mysql_native_password';
flush privileges;
|
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
Se connecter à mysql avec sudo
Utilisation
|
sqlcmd -S localhost -U sa -P '<YourPassword>'
|
|
create login <login_name> with password = '<enterStrongPasswordHere>';
go
use MyDatabase;
go
create user <login_name>;
go
|
Installation du serveur
|
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
apt-key list
sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2017.list)"
sudo apt install software-properties-common
grep -h ^deb /etc/apt/sources.list /etc/apt/sources.list.d/*
sudo apt update
sudo apt install -y mssql-server
sudo /opt/mssql/bin/mssql-conf setup
systemctl status mssql-server
|
Installation de SQL Server command-line tools: sqlcmd and bcp
|
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
sudo apt-get update
sudo apt-get install mssql-tools unixodbc-dev
|
GUI
|
sudo dpkg -i azuredatastudio-linux-<version string>.deb
azuredatastudio
|
- Thème dark: File → Preferences → Color Theme → Dark Azure Data Studio (default dark)
- Restaurer un backup: clique-droit sur une connection → Manage → remonter au serveur → Restore
- Extensions: View → Extensions
- Installer un fichier *.vsix: Ctrl + Shift + P → Extensions: Install from VSIX
|
"poorSql.trailingCommas": true,
"poorSql.expandCommaLists": false
|
|
sqlcmd -S localhost -U MyUser -Q "BACKUP DATABASE [MyDb] TO DISK = N'/var/opt/mssql/data/MyDb.bak' WITH NOFORMAT, NOINIT, NAME = 'MyDb-full', SKIP, NOREWIND, NOUNLOAD, STATS = 10"
sqlcmd -S localhost -U MyUser -Q "RESTORE DATABASE [MyDb] FROM DISK = N'/var/opt/mssql/data/MyDb.bak' WITH FILE = 1, NOUNLOAD, REPLACE, NORECOVERY, STATS = 5"
|
SSH
openssh est déjà installé et démarré.
Pour se logguer avec root:
/etc/ssh/sshd_config
|
PermitRootLogin yes
|
|
sudo –i passwd root
sudo systemctl restart sshd
|
/etc/netplan/50-cloud-init.yaml
|
network:
version: 2
ethernets:
eno1:
addresses: []
dhcp4: yes
addresses: [192.168.0.1/24]
gateway4: 192.168.0.254
nameservers:
search: [local, home]
addresses: [8.8.8.8, 8.8.7.7]
match:
macaddress: xx:xx:xx:xx:xx:xx
wakeonlan: true
optional: true
|
|
netplan try
netplan generate
netplan apply
netplan ip leases [interface]
|
can't get wake-on-lan to work with netplan config file
|
sudo ethtool [interface]
|
Utiliser netplan pour activer wol au démarrage.
|
sudo apt install samba
whereis samba
sudo systemctl restart smbd
|
Configurer Samba
Chemin d'accès \\host\myshare
|
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn
sudo apt remove cmdtest
|
|
apt install zsh zsh-syntax-highlighting
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
|
~/.zshrc
|
source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
|
sudo dpkg -i ripgrep_0.8.1_amd64.deb
|
Mediawiki
|
wget https://releases.wikimedia.org/mediawiki/1.32/mediawiki-1.32.0.tar.gz
tar xf mediawiki-1.32.0.tar.gz
sudo mv mediawiki-1.32.0 /srv/www/mediawiki
|
Il est désactivé et vérouillé par défaut: pas de connexion possible avec root.
|
sudo grep root /etc/passwd
sudo grep root /etc/shadow
sudo -i
sudo -i passwd root
sudo passwd -dl root
|
|
apt install iptables-persistent
sudo netfilter-persistent save
sudo netfilter-persistent reload
|
iptables
|
journalctl -b -1
|
/etc/systemd/journald.conf
|
[Journal]
Storage=persistent
SystemMaxUse=100M
RuntimeMaxUse=100M
|
|
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt update
sudo apt install docker-ce
sudo gpasswd -a $USER docker
|
|
docker create --name=kodi-headless \
-v $HOME/.config/kodi:/config/.kodi \
-e PGID=1000 -e PUID=1000 \
-e TZ=Europe/Paris \
-p 8080:8080 \
-p 9090:9090 \
-p 9777:9777/udp \
linuxserver/kodi-headless
|
Installation
|
sudo useradd -m -G users,sudo <username>
|
Erreurs
Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
|
sudo umount /dev/sda1
sudo fsck /dev/sda1
|