This is an old revision of the document!


Version

su david
lsb_release -a

Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic

sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"

color prompt

ajoutezr dans le bashrc

export PS1="\[\e[32m\][\[\e[m\]\[\e[31m\]\u\[\e[m\]\[\e[33m\]@\[\e[m\]\[\e[32m\]\h\[\m\]]\[\e[m\]\[\e[32;47m\]\\$\[\e[m\] "
alias ls='ls --color'

Chrome desactive trousseau

sudo chmod a-x /usr/bin/gnome-keyring*

Mount disk

sudo mkdir /mnt/cyclops
sudo mkdir /mnt/magneto
sudo mkdir /mnt/diablo

sudo apt install pmount

sudo mount /dev/disk/by-label/cyclops  /mnt/cyclops
sudo mount /dev/disk/by-label/magneto  /mnt/magneto
sudo mount /dev/disk/by-label/diablo  /mnt/diablo

SSH

sudo apt install openssh-server
sudo apt install fail2ban
sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local


ssh-keygen -t rsa -b 4096 -C david20180919@home.server

restaure config

cat /mnt/magneto/warehouse/backup_sickrage/id_rsa.pub>> ~/.ssh/authorized_keys​​​
sudo cp /mnt/magneto/warehouse/backup_sickrage/authorized_keys​​​ /home/david/.ssh
chmod 600 /home/david/.ssh/authorized_keys
sudo cp /mnt/magneto/warehouse/backup_sickrage/sshd_config  /etc/ssh/
sudo cp /mnt/magneto/warehouse/backup_sickrage/jail.local  /etc/fail2ban/
systemctl restart sshd.service

installer la clé prive sur le clients (windows putty)

sauvegarde config

cp /home/david/.ssh/authorized_keys /mnt/magneto/warehouse/backup_sickrage
cp /home/david/.ssh/id_rsa /mnt/magneto/warehouse/backup_sickrage
cp /home/david/.ssh/id_rsa.pub /mnt/magneto/warehouse/backup_sickrage
cp /etc/ssh/sshd_config /mnt/magneto/warehouse/backup_sickrage
sudo cp /etc/fail2ban/jail.local  /mnt/magneto/warehouse/backup_sickrage

Empty Trash

sudo apt-get install trash-cli

desactiver ecran de veille

sur le desktop ubuntu : launch parametre puis  energie -> ecran noir = jamais

Retailer le Swap ​a 6Gb

free -h
sudo ls -lh /swapfile
sudo swapoff -a
sudo fallocate -l 6G /swapfile
sudo ls -lh /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon -a
free -h

Transmission

sudo add-apt-repository ppa:transmissionbt/ppa
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install transmission-cli transmission-common transmission-daemon

sudo usermod -a -G debian-transmission david
sudo usermod -a -G syslog debian-transmission
sudo service transmission-daemon stop
sudo adduser david debian-transmission
sudo chown david:david -R /var/lib/transmission-daemon/info/
sudo chown david:david -R /etc/transmission-daemon/settings.json
sudo chown david:david -R /mnt/magneto/videoclub/_complet/
sudo chown david:david -R /mnt/magneto/videoclub/_incomplet/
sudo chown -R david:david /var/lib/transmission-daemon/downloads
sudo chown -R david:david /var/lib/transmission-daemon/info
sudo chown -R david:david /var/lib/transmission-daemon/.config/transmission-daemon/settings.json

chmod +x /mnt/diablo/kitchen/source_code/GestionnaireDownloadScript/transmission-purge-completed.sh
chmod +r /mnt/diablo/kitchen/source_code/GestionnaireDownloadScript/transmission-purge-completed.sh

sudo touch /var/log/transmission.log
sudo chown debian-transmission /var/log/transmission.log
sudo chmod 644 /var/log/transmission.log

sudo nano /lib/systemd/system/transmission-daemon.service  #ExecStart=/usr/bin/transmission-daemon -f --log-debug --logfile /var/log/transmission.log

sudo service transmission-daemon start

restaure config

sudo service transmission-daemon stop
sudo cp /mnt/magneto/warehouse/backup_sickrage/settings.json  /etc/transmission-daemon/
sudo chmod 777 /etc/transmission-daemon/settings.json
sudo service transmission-daemon start

sauvegarde config

cp  /etc/transmission-daemon/settings.json /mnt/magneto/warehouse/backup_sickrage

Timeshift

sudo add-apt-repository -y ppa:teejee2008/timeshift
sudo apt-get update
sudo apt-get install timeshift
mkdir /90-warehouse/backup_system/timeshift
ln -s /90-warehouse/backup_system/timeshift /mnt/cyclops/timeshift

Emby

cd ~/
cp /mnt/magneto/warehouse/backup_sickrage/emby-server-deb_4.3.1.0_amd64.deb ~/
sudo dpkg -i emby-server-deb_4.3.1.0_amd64.deb

Webmin

https://www.digitalocean.com/community/tutorials/how-to-install-webmin-on-ubuntu-16-04

echo "deb http://download.webmin.com/download/repository sarge contrib" | sudo tee -a /etc/apt/sources.list
wget http://www.webmin.com/jcameron-key.asc
sudo apt-key add jcameron-key.asc
sudo apt-get update
sudo apt-get install webmin

Path Bin

sudo echo 'export PATH=$PATH:/mnt/diablo/kitchen/bin'>>  ~/.bashrc
export PATH=$PATH:/mnt/diablo/kitchen/bin

Organisation Répertoire

sudo apt-get install samba
sudo ln -s /mnt/cyclops /mnt/colossus
sudo ln -s /mnt/cyclops/home-desk /10-home-desk
sudo ln -s /mnt/cyclops/photo /20-photo
sudo ln -s /mnt/magneto/videoclub /23-videoclub
sudo ln -s /mnt/diablo/kitchen /50-kitchen
sudo ln -s /mnt/cyclops/home-desk/80-Photocopie /80-photocopie
sudo ln -s /mnt/diablo/kitchen/source_code /82-source_code
sudo ln -s /mnt/magneto/warehouse /90-warehouse

sudo ln -s /mnt/magneto/warehouse /home/david/OneDrive/

sudo ln -s /mnt/cyclops/office /30-office
sudo ln -s /mnt/diablo/locker /40-locker
sudo ln -s /mnt/magneto/mediarack /70-mediarack

https://websiteforstudents.com/share-files-on-ubuntu-16-04-lts-with-windows-10-systems/

restaure config

sudo cp /mnt/magneto/warehouse/backup_sickrage/smb.conf  /etc/samba/

sauvegarde config

sudo cp /etc/samba/smb.conf /mnt/magneto/warehouse/backup_sickrage

sur windows

  • netsh advfirewall firewall set rule group=“File and Printer Sharing” new enable=Yes
  • netsh advfirewall firewall set rule group=“Network Discovery” new enable=Yes

pkg a installer

sudo apt-get install tmux cpulimit ocrmypdf tesseract-ocr-fra php7.2-cli php7.2-curl php7.2-dom inotify-tools linux-tools-common linux-tools-generic linux-tools-`uname -r` dos2unix lynx ffmpeg curl dialog toilet

parametrage kitchen

ln -s /mnt/diablo/kitchen/source_code/.secret /home/david/.secret

Sickrage (Sickchill now)

https://github.com/SickRage/SickRage/wiki/Sickrage-installation-Ubuntu-15

sudo apt-get update && sudo apt-get install unrar-free git-core openssl libssl-dev python2.7
sudo addgroup --system sickchill
sudo adduser --disabled-password --system --home /var/lib/sickchill --gecos "SickChill" --ingroup sickchill sickchill
sudo adduser sickchill david
sudo adduser sickchill debian-transmission
sudo usermod -a -G david sickchill
sudo mkdir /opt/sickchill && sudo chown sickchill:sickchill  /opt/sickchill
sudo -u sickchill git clone https://github.com/SickChill/SickChill.git /opt/sickchill
sudo cp -v /opt/sickchill/runscripts/init.systemd /etc/systemd/system/sickchill.service
sudo chown root:root /etc/systemd/system/sickchill.service
sudo chmod 644 /etc/systemd/system/sickchill.service
sudo systemctl enable sickchill
sudo systemctl start sickchill
sudo systemctl status sickchill
sudo ln -s  /usr/bin/python /opt/sickchill/python

*

https://github.com/SickChill/SickChill/issues/5151 Backup config/setings/etc using built in backup tool Stop SickRage Edit config.ini from https://github.com/SickRage/SickRage to https://github.com/SickChill/SickChill.git Restart SickRage If you get an error stating “No NZB/Torrent providers found or enabled for daily searches and backlog searches” restore the backup completed in Step 1. Restart SickChill

restaure config

curl http://192.168.1.237:8081/config/backuprestore/restore?backupFile="/90-warehouse/backup_sickrage/sickrage-20180921183800.zip"
sudo systemctl restart sickchill

sauvegarde config

curl http://192.168.1.237:8081/config/backuprestore/backup?backupDir="/mnt/magneto/warehouse/backup_sickrage/"

NZBGET

sudo apt-get install nzbget -y
sudo apt-get install unrar -y
sudo apt-get install nodejs -y

sudo cp /etc/nzbget.conf ~/.nzbget
sudo chown david:david ~/.nzbget

​​​


sudo nano ~/.nzbgetMainDir=/mnt/magneto/videoclub/_nzbgetDaemonUsername=davidControlIP=192.168.1.237ControlUsername=nzbgetControlPassword=nzbgetMainDir=/mnt/magneto/videoclub/_nzbgetDestDir=/mnt/magneto/videoclub/_DownSickRage
[Unit]Description=NZBGet Daemon[Service]User=davidGroup=davidType=forkingExecStart=/usr/bin/nzbget –daemonExecStop=/usr/bin/nzbget -QExecReload=/bin/kill -HUP $MAINPIDKillMode=processRestart=on-failure[Install]WantedBy=multi-user.target

restaure config

cp /mnt/magneto/warehouse/backup_sickrage/file.nzbget  ~/.nzbget
sudo chown david:david ~/.nzbget
sudo cp /mnt/magneto/warehouse/backup_sickrage/nzbget.service /etc/systemd/system

sauvegarde config

cp ~/.nzbget /mnt/magneto/warehouse/backup_sickrage/file.nzbget
cp /etc/systemd/system/nzbget.service /mnt/magneto/warehouse/backup_sickrage

==== = MiniDLNA ===== https://doc.ubuntu-fr.org/minidlna#configuration_de_minidlna sudo nano /etc/minidlna.conf media_dir=/var/lib/minidlna media_dir=V,/mnt/magneto/videoclub/Film/ media_dir=V,/mnt/magneto/videoclub/Anime/ media_dir=V,/mnt/magneto/videoclub/Series/ media_dir=V,/mnt/magneto/videoclub/Insanity/ media_dir=V,/mnt/magneto/videoclub/Video/ media_dir=P,/mnt/cyclops/photo/50_Phototheque/ log_dir=/var/log ==== restaure config ==== cp /mnt/magneto/warehouse/backup_sickrage/minidlna.conf /etc/ ==== sauvegarde config ==== cp /etc/minidlna.conf /mnt/magneto/warehouse/backup_sickrage

java JRE

sudo apt-get install default-jre

filebot

curl -L -O https://downloads.sourceforge.net/project/filebot/filebot/FileBot_4.7.9/filebot_4.7.9_amd64.deb
sudo dpkg -i filebot_4.7.9_amd64.deb

restaure config

filebot -script fn:preferences /mnt/magneto/warehouse/backup_sickrage/david.prefs.xml

sauvegarde config

filebot -script fn:preferences --output /mnt/magneto/warehouse/backup_sickrage/

dropbox (in/out server)

https://www.dropbox.com/fr/install-linux https://www.dropboxwiki.com/tips-and-tricks/install-dropbox-in-an-entirely-text-based-linux-environment

cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
~/.dropbox-dist/dropboxd
mkdir -p ~/bin
wget -O ~/bin/dropbox.py "https://www.dropbox.com/download?dl=packages/dropbox.py"
chmod +x ~/bin/dropbox.py
sudo apt-get install nautilus-dropbox
mkdir ~/Dropbox/StudioPhotoIntrants/
mv ~/Dropbox/StudioPhotoIntrants/00_NEW/* ~/Dropbox/StudioPhotoIntrants/
ln -s ~/Dropbox/StudioPhotoIntrants /mnt/cyclops/photo/00_NEW

#depuis mi 2019 les lien symbolique ne sont plus suivi dans dropbox
#sudo ln -s /mnt/diablo/kitchen/source_code  ~/Dropbox/
#sudo ln -s /mnt/cyclops/photo/00_NEW ~/Dropbox/StudioPhotoIntrants
#sudo ln -s /mnt/magneto/warehouse/backup_sickrage/id_rsa.putty.ppk ~/Dropbox/

Lien de chaque projet en cours

sudo ln -s /mnt/colossus/home-desk/950-Construction\ Maison/2018-06-19\ PC\ SketchUp ~/Dropbox/

Spotify

sudo snap install spotify

vino/X11/vnc connection a distance

sudo apt install xrdp
sudo apt install x11vnc
sudo apt install dconf-editor

  sur le desktop ubuntu : launch dconf puis  org -> gnome -> desktop -> remote-access -> remove encryption

https://doc.ubuntu-fr.org/bureau_a_distance https://doc.ubuntu-fr.org/vnc?redirect=1 https://websiteforstudents.com/access-ubuntu-18-04-lts-beta-desktop-via-vnc-from-windows-machines/

relancer gnome apres un freeze

DISPLAY=:0 gnome-shell --replace

Server startup application

restaure config

cp  /mnt/magneto/warehouse/backup_sickrage/*.desktop ~/.config/autostart/

sauvegarde config

cp  ~/.config/autostart/*.desktop /mnt/magneto/warehouse/backup_sickrage/

Onedrive by rclone (sauvegarde)

curl https://rclone.org/install.sh | sudo bash
rclone config

https://rclone.org/onedrive/ https://rclone.org/downloads/

restaure config

cp /mnt/magneto/warehouse/backup_sickrage/rclone.conf /home/david/.config/rclone/

sauvegarde config

cp /home/david/.config/rclone/rclone.conf /mnt/magneto/warehouse/backup_sickrage/

scheduled task windows

importer fichier wol serveur.xml dans le schedule task de windows 10

Cron server job

start server

/mnt/diablo/kitchen/source_code/start_and_stop/start.sh
#tweet "start  "$(curl https://ipv4.icanhazip.com/)

CRONjob

#==== start photocopie ocr ====
cd /mnt/diablo/kitchen/source_code/ScriptOcr/;bash inotifywait80-Photocopie00_A_traiter.sh &
#==== sauvegarde photo ====
cd /mnt/diablo/kitchen/source_code/rclone/;bash rclonesync.sh
#==== sauvegarde ovh ====
cd /mnt/diablo/kitchen/source_code/rclone/;bash rclonesyncOvh.sh
#==== runtastic ====
cd /mnt/diablo/kitchen/source_code/Runtastic2Gagenda/;php Runtastic2Gagenda.php
#==== daily helth test ====
cd /mnt/diablo/kitchen/source_code/dailyHealthTest/;bash dailyHealthTest.sh
#==== auto shutdow ====
cd /mnt/diablo/kitchen/source_code/start_and_stop/;bash shutdown.sh

stop server

/mnt/diablo/kitchen/source_code/start_and_stop/stop.sh
#tweet "stop  "$(curl https://ipv4.icanhazip.com/)

restaure config

cp /mnt/magneto/warehouse/backup_sickrage/start_and_stop.service /etc/systemd/system/
crontab -u david /mnt/magneto/warehouse/backup_sickrage/backup.crontab
sudo crontab -u root /mnt/magneto/warehouse/backup_sickrage/backuproot.crontab

sauvegarde config

cp /etc/systemd/system/start_and_stop.service /mnt/magneto/warehouse/backup_sickrage/
crontab -l> /mnt/magneto/warehouse/backup_sickrage/backup.crontab
sudo crontab -u root -l> /mnt/magneto/warehouse/backup_sickrage/backuproot.crontab

WOL

sudo apt-get install ethtool
sudo apt install net-tools
sudo ethtool -s enp3s0 wol g

https://www.howtogeek.com/94110/wake-up-your-computers-using-your-android-phone/

redmine

mysql

https://linuxize.com/post/how-to-install-mysql-on-ubuntu-18-04/

''sudo apt autoremove --purge mysql\* mariadb\*
sudo apt clean
sudo mv /var/lib/mysql /var/lib/mysql_bak
sudo mv /etc/mysql /etc/mysql_bak
sudo apt install mysql-server''

retropie

https://retropie.org.uk/docs/Debian/

ln -s /40-locker/30-Salle\ de\ Jeux/roms ~/RetroPie/

django gnucash

Navigation
QR Code
QR Code public:informatique:ordinateur_perso (generated for current page)