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
Swaks is a featureful, flexible, scriptable, transaction-oriented SMTP test tool written and maintained by John Jetmore.
ifconfig netstat route .. autant de cmd à abandonner!
distrib firewall
Bon article pour comprendre un peu mieux les histoire d'io
Parfois il arrive qu'un fichier de conf soit corrompu a cause dun caractère invisible a la con qui peut venir dun copier coller ou autre.. Pour vérifier ça, on peut dumper le fichier en affichant ces caractères : car -e fichier
Pour comprendre un peu mieux certaines subtilités de rsync + compléter mémo
Petit outil sympa qui donne l'explication de n'importe quelle commande shell (on peut c/c ce qu'on veut)l
Il peut arriver qu'un package ait un comportement anormal, on peut alors se demander si les fichiers n'ont pas été modifié à la main... (environnement de dev, coucou)
Heureusement rpm stocke plusieurs infos sur les fichiers originaux et permet de vérifier si il y a eu ou non des modifications. L'option magique est -V
rpm -Va --> vérifie TOUS les packages
rpm -V nom_du_package --> vérifie seulement le package concerné
run gnome-tweak-tool, "theme", and change keybinding theme to default
Pour créer une archive de la forme latest_2013-05-19-04-05-23.tar.gz ou .zip
dotd=date +%F-%H-%M-%S
tar -pczf /tmp/lastbackup/latest$dotd.tar.gz /var/cache/rsnapshot/hourly.0
zip -y -9 -r /tmp/lastbackup/latest$dotd.zip /var/cache/rsnapshot/hourly.0
L'option -y permet de ne pas suivre les liens symboliques (ce qui faisait planter mon backup). A enlever si nécessaire.
Des exemples de commandes hping3 pour réaliser des tests sur des firewall
ethtool to get info about network
group passwd hosts services
nload sur debian pour monitorer en temps réel la bande passante d'un serveur
Pour télécharger des images testing de debian (pas forcément simple de trouver le bon endroit sur le site..)
Ici les wheezy à l'heure actuelle
Ok the title may need some work but I am really excited that I found a way to make virtually any application to run over a SSH proxy without having to directly have support for the SOCKS protocol.
The first thing you need to do is go to SourceForge and download an application call proxychains. If you are using a debian based distribution, particularly Ubuntu you can simple use
sudo apt-get install proxychains
Once you have installed proxychains you need to connect via SSH to your SSH serve. You can use something like this:
ssh -fqND 5555 yanovich@10.28.183.40
This creates a connection to your ssh server and lets it run in the background. The 5555 is the port number it will run on the local level (the computer you can running proxychains from).
Next you need to edit /etc/proxychainds.conf (you'll need sudo permission to do this).
Uncomment "dynamic_chain" (by removing the # at the beginning of the line)
comment out "strict_chain" by adding a # to the beginning of the line.
Uncomment "quiet_mode" (This is not recommended the first time you do this. I would recommend doing this the second through once you are familiar with this and can see it is working).
Add "socks5 127.0.0.1 5555" on a new line at the bottom of the file.
Save
Now run the program you want to have applied this settings towards. For my situation I wanted to be able to use Opera Web Browser over SSH proxy but Opera doesn't have built-in SOCKS support.
$ proxychains opera
That line of code in the terminal will launch the Opera Browser and direct all traffic through the SSH proxy.
The above is recommended to be used for applications that do not natively support SOCKS. I would recommend doing the above in addition to apply a system wide setting (for Ubuntu you can do this through System > Preference > Network Proxy).
next generation linux shell
pour récup une ressource protégée par un wget, utiliser ces deux parametres dans la commande wget : --http-user=user --http-password=password
Un outils sous linux pour faire des screecast
Format de sortie en ogv
gtk-recordmydesktop
[09:18:59] amm@lynch:/usr/share/applications$ cat eclipse.desktop
[Desktop Entry]
Encoding=UTF-8
Name=Eclipsee
GenericName=Eclipsee
Exec=/home/amm/bin/ecl_launch.sh
Icon=/home/amm/bin/eclipse/icon.xpm
Terminal=false
Type=Application
Categories=Application;Development;
une fois qu'on a fait ça, l'application est accessible dans les menus et aussi accessible pour créer un launcher