Si j'avais le temps, ca me plairait bien !
wtf?
cd dir
time perl -e 'for(<*>){((stat)[9]<(unlink))}'
Keepalive Notes
A keepalive packet generally has a TCP ACK configured with a sequence number set to one less than the current number used on the connection. Any machine receiving a nudge from such a packet will simply respond with the correct sequence number and, Frankenstein jokes aside, announce that it is indeed alive.
These types of packets are sometimes empty and generally have three associated parameters. The retry parameter will declare how many times to send a packet before coming to the conclusion that the other end of the connection has given up the ghost. The time setting is configured as the frequency of the checks, and finally the interval dictates the length of time between two sent packets if no response is received.
Inside the kernel, you can alter these settings by editing these values in the eye-watering pseudo-filesystem known and loved as /proc. One file, in this case, is /proc/sys/net/ipv4/tcp_keepalive_time, and you can edit it
dstat -lrvn 10
via arnaudb
edition video sous linux basique
LiME
Draugr
Volatilitux
Memfetch
Crash utility from Red Hat, Inc
Memgrep
Memdump
foriana
plein d'outils network linux
via arnaub
wow could be useful
via skunnyk
How to pretty print a json string :
cat pref.json | python -m json.tool
for uuoc nazi ;) :
< pref.json python -m json.tool
or
python -m json.tool < pref.json
Merci à ce mec, il m'a fait gagner du temps ^^
find my_root_dir -depth -exec rename 's/(.)\/([^\/])/$1\/\L$2/' {} \;
ya du vrai la dedans :D
rgrep et grep -r sont équivalents : on cherche récursivement
grep -R est légerement différent dans le sens où il va suivre les liens symboliques ce qui peut être plus pratique..
La doc des propriétés : https://github.com/torvalds/linux/blob/master/Documentation/networking/ip-sysctl.txt
Ensuite on peut les définir dans le dossier spécifique à l'interface, exemple : /proc/sys/net/ipv4/conf/eth0/
Ou dans le dossier all : /proc/sys/net/ipv4/conf/all
Exemple :
La valeur pour ehto concernant la propriété arp_filter ne dépend pas seulement de /proc/sys/net/ipv4/conf/eth0/arp_filter mais aussi de /proc/sys/net/ipv4/conf/all/arp_filter
D'après la doc, arp_filter est un boolean (0 ou 1)
D'après ces liens :
http://marc.info/?l=linux-kernel&m=123606366021995&w=2
https://github.com/torvalds/linux/blob/master/include/linux/inetdevice.h (ligne 123 : #define IN_DEV_ARPFILTER(in_dev) IN_DEV_ORCONF((in_dev), ARPFILTER))
On utilise un OR pour déterminer la valeur finale : il suffit qu'un des deux arp_filter soit à 1.
Si la propriété n'est pas un boolean mais un integer qui peut prendre 0,1,2,etc... la valeur choisie entre le "all" et le "eth0" sera la valeur MAX d'après ce que j'ai compris.
On retrouve ce fonctionnement dans d'autres dossiers :
/proc/sys/net # find . -type d -name eth0
./ipv4/neigh/eth0
./ipv4/conf/eth0
./ipv6/neigh/eth0
./ipv6/conf/eth0
Pour consulter :
sysctl -a | grep arp_filter
Pour modifier :
à la volée :
echo "1" > /proc/sys/net/ipv4/conf/...
ou sysctl -w net.ipv4.conf.eth1.arp_filter=1
persistant au reboot :
/etc/sysctl.conf
/etc/init.d/procps restart
à notre un truc vicieux :
/etc/init.d/procps restart n'a pas le meme effet qu'un reboot complet
si on set une propriété à la volée à 1 comme net.ipv4.conf.eth1.arp_filter par exemple
elle va rester à 1 apres un /etc/init.d/procps restart
par contre elle se remet bien à 0 apres un reboot
Au cas ou un jour je passe mon desktop sous linux.
via arnaudb
Tiens je connaissais pas ce blog de bluetouff
Sympa tous ces one liners ! il y a même un repo dans lequel on peut ajouter les siens : https://github.com/fxn/tkn
Mes préférés :
$ echo "!!" > script.sh
$ cp file.txt{,.bak}
$ (cd /tmp && ls)
$ nc -l 5566 > data-dump.sql
$ nc <his-ip-address> 5566 < data-dump.sql
via Olivier
pour voir les limites d'un user : ulimit -a <user>
Pour setter définitivement : voir fichier /etc/security/limits.conf et limits.d
Pour setter on the fly, par exemple pour les open files : ulimit -n 32000
Parce qu'avec l'outil par défaut proposé par gnome3, on ne peut pas faire d'annotation.
Une commande qu'elle est bien :
namei /path/to/the/deepest/file
Affiche toutes les permissions + les owners de toute l'arborescence jusqu'au fichier.
via nicolasc
A mettre au début d'un script qui se trouve dans un des dossiers /etc/cron.xxxx pour qu'il soit éxécuté par un utilisateur autre que root.
USER='some-low-privilege-user'
if [ whoami
!= "$USER" ]; then
sudo -u $USER "$0"
exit
fi
... rest of the script ...
Parait que ça va plus vite que ack
à tester
Outils en ligne de commande pour trouver ce qui occupe de la place, bien pratique
Tools de monitoring à tester
via ArnaudB