Fév 232012
 

Par défaut chaque utilisateur est limité à un nombre de fichier ouverts (ulimit -n), 1024 par défaut.
Pour modifier cela :

echo "* hard nofile 65536" >> /etc/security/limits.conf
echo "* soft nofile 65536" >> /etc/security/limits.conf
if [ `cat /etc/pam.d/login  | grep "^session" | grep "pam_limits.so" | wc -l` -eq 0 ] ; then
echo "session required pam_limits.so" >> /etc/pam.d/login ; fi

A toute nouvelle connexion, la limite sera augmenté

Fév 192012
 
# ~/.bashrc: executed by bash(1) for non-login shells.
 
export PS1='\h:\w\$ '
umask 022
 
# You may uncomment the following lines if you want `ls' to be colorized:
export LS_OPTIONS='--color=auto'
eval "`dircolors`"
alias ls='ls $LS_OPTIONS'
alias ll='ls $LS_OPTIONS -l'
alias la='ls $LS_OPTIONS -la'
alias l='ll'
alias vi='vim'
alias pstree='pstree -A'
 
[ -f /etc/bash_completion ] && . /etc/bash_completion
HISTTIMEFORMAT="%d/%m/%Y(%H:%M:%S) # "
HISTSIZE="5000"

http://blog.jeremm.fr/.bashrc

 Posted by at 16 h 03 min
Fév 192012
 

TCPDUMP

Tout sauf le ssh :

tcpdump -n port not 22

Tout sauf moi :

tcpdump -n host not <IP>

Les paquets syn et ack sur le port 80 :

tcpdump -n tcp and port 80 and 'tcp[tcpflags] & tcp-syn == tcp-syn'

Les paquets syn sur le port 80 :

tcpdump -n tcp and port 80 and 'tcp[tcpflags] == tcp-syn'

Les paquets arp ou ping :

tcpdump -enqti eth0 \( arp or icmp \)

NETSTAT

Le nombre de connexions sur le port 80 :

netstat -nt | grep ":80" | awk '{print $5}' | cut -d':' -f1 | sort | uniq -c

Port qui écoute :

netstat -tulpn

Nomre de connexions :

netstat -nt | wc -l
Fév 192012
 

Pour voir rapidement à quel lv correspond un block device ID :

lvdisplay|awk  '/LV Name/{n=$3} /Block device/{d=$3; sub(".*:","dm-",d); print d,n;}'
 Posted by at 13 h 36 min  Tagged with: