45 private links
Parce que comprendre comment ça marche, c'est important.
Je profite de ton post sur debian pour dire/rappeler que le full freeze de debian 10 a été annoncé. Vous pouvez tester donc debian 10 dès maintenant et remonter les bugs si vous en voyez ;-)
parce que ça claque mieux et que c'est toujours bien de savoir comment va une machine en se connectant.
This feature is very nice as it will give you a quick look at useful information. Unfortunately, Debian Server does not include the dynamic MOTD. First you will need to install some prerequisites and build the directory structure. To do so, run the following commands in terminal. If you would like to add update notification, I have written another article detailing the steps at Debian MOTD Update Notifier.
Shell
install lsb-release
sudo apt-get install lsb-release
install figlet to enable ASCII art
sudo apt-get install figlet
create directory
mkdir /etc/update-motd.d/
change to new directory
cd /etc/update-motd.d/
create dynamic files
touch 00-header ; touch 10-sysinfo; touch 90-footer
make files executable
chmod +x /etc/update-motd.d/*
remove MOTD file
rm /etc/motd
Once the above commands have been run, you can move on to populating the files you created. Below you can copy and paste.
Header (00-header)
!/bin/sh
#
00-header - create the header of the MOTD
Copyright (c) 2013 Nick Charlton
Copyright (c) 2009-2010 Canonical Ltd.
#
Authors: Nick Charlton hello@nickcharlton.net
Dustin Kirkland kirkland@canonical.com
#
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
#
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
#
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
[ -r /etc/lsb-release ] && . /etc/lsb-release
if [ -z "$DISTRIB_DESCRIPTION" ] && [ -x /usr/bin/lsb_release ]; then
Fall back to using the very slow lsb_release utility
DISTRIB_DESCRIPTION=$(lsb_release -s -d)
fi
figlet $(hostname)
printf "\n"
printf "Welcome to %s (%s).\n" "$DISTRIB_DESCRIPTION" "$(uname -r)"
printf "\n"
System Information (10-sysinfo)
!/bin/bash
#
10-sysinfo - generate the system information
Copyright (c) 2013 Nick Charlton
#
Authors: Nick Charlton hello@nickcharlton.net
#
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
#
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
#
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
date=date
load=cat /proc/loadavg | awk '{print $1}'
root_usage=df -h / | awk '/\// {print $(NF-1)}'
memory_usage=free -m | awk '/Mem:/ { total=$2 } /buffers\/cache/ { used=$3 } END { printf("%3.1f%%", used/total*100)}'
swap_usage=free -m | awk '/Swap/ { printf("%3.1f%%", $3/$2*100) }'
users=users | wc -w
time=uptime | grep -ohe 'up .*' | sed 's/,/\ hours/g' | awk '{ printf $2" "$3 }'
processes=ps aux | wc -l
#ip=ifconfig $(route | grep default | awk '{ print $8 }') | grep "inet addr" | awk -F: '{print $2}' | awk '{print $1}'
#ip=hostname --all-ip-addresses || hostname -I
ip=ip a | grep 'inet ' | awk '{print $2}' | tr '\n' ' '
echo "System information as of: $date"
echo
printf "System Load:\t%s\tIP Address:\t%s\n" $load "$ip"
printf "Memory Usage:\t%s\tSystem Uptime:\t%s\n" $memory_usage "$time"
printf "Usage On /:\t%s\tSwap Usage:\t%s\n" $root_usage $swap_usage
printf "Local Users:\t%s\tProcesses:\t%s\n" $users $processes
echo
Footer (90-footer)
!/bin/sh
#
90-footer - write the admin's footer to the MOTD
Copyright (c) 2013 Nick Charlton
Copyright (c) 2009-2010 Canonical Ltd.
#
Authors: Nick Charlton hello@nickcharlton.net
Dustin Kirkland kirkland@canonical.com
#
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
#
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
#
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
[ -f /etc/motd.tail ] && cat /etc/motd.tail || true
Once these files are populated with the above, you should now be able to logout and then log back in either using putty or on the console and you will be presented with something that looks like below.
à tester. comment certains peuvent encore prétendre être efficace sur nano...
EDIT:
echo "set undodir=~/.vimundo" >>/etc/vim/vimrc
echo "set undofile" >>/etc/vim/vimrc
et bim !
#debian 7->8
apt-get update
apt-get upgrade
sed -i.$(date +%y%m%d-%H%M%S).bak 's/wheezy/jessie/' /etc/apt/sources.list
apt-get update
apt-get upgrade
apt-get dist-upgrade
reboot
#debian 8->9
apt update
apt full-upgrade
sed -i.$(date +%y%m%d-%H%M%S).bak 's/jessie/stretch/' /etc/apt/sources.list
apt update
apt full-upgrade
reboot
#debian 9->10
apt update
apt full-upgrade
sed -i.$(date +%y%m%d-%H%M%S).bak 's/stretch/buster/' /etc/apt/sources.list
apt update
apt full-upgrade
reboot
#debian 10-> 11
apt update
apt upgrade
sudo sed -i 's/buster/bullseye/g' /etc/apt/sources.list
sudo sed -i 's/buster/bullseye/g' /etc/apt/sources.list.d/*.list
sudo sed -i 's#/debian-security bullseye/updates# bullseye-security#g' /etc/apt/sources.list
apt update
apt full-upgrade
apt autoremove
reboot
#debian 11-> 12
apt update
apt upgrade
sudo sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list
sudo sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list.d/*.list
sudo sed -i 's#/debian-security bullseye-updates# bookworm-security#g' /etc/apt/sources.list
apt update
apt upgrade --without-new-pkgs
apt full-upgrade
apt autoremove
reboot
Qui a dit que Linux c'était dur ?
Génial :
Pour l'utiliser, on va juste changer les sources de paquets dans le /etc/apt/sources.list pour pouvoir l'utiliser.
Concrètement, il faut remplacer tous les
par
aptitude install ntp ntpdate
/etc/init.d/ntp stop
ntpdate -s ntpserver
/etc/init.d/ntp start
Coudifié, ça a marché.
Parce que l'université de Tours ne dépote pas tellement et me renvoi des erreurs 403.
Exemple : fichier sources.list de Debian 7 "Wheezy"
deb http://http.debian.net/debian wheezy main
deb-src http://http.debian.net/debian wheezy main
deb http://http.debian.net/debian wheezy-updates main
deb-src http://http.debian.net/debian wheezy-updates main
deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main
Ou mieux.
Juste la maj de bash sans faire la maj de tout le serveur. Coudifié
La classe !
Les fichiers de conf de transmission ne sont pas modifiables tant que le démon n'est pas arrêté. Sinon ils sont ré-écraser à l'extinction du démon.
Indispensable -> sudo chown debian-transmission:debian-transmission /var/lib/transmission-daemon/info/settings.json
Sinon patatra ! Couldn't read "/var/lib/transmission-daemon/info/settings.json": Permission denied
De côté ;-) : iface usb0 inet dhcp suffit dans /etc/network/interfaces
Update raspberry pi en cours... Une ptite copie de la carte et let's go http://www.moovika.fr/raspberry-pi.fr/?p=69