Skip to content

Instantly share code, notes, and snippets.

@rodesousa
Last active August 24, 2016 09:15
Show Gist options
  • Select an option

  • Save rodesousa/d8e48612c1c9668335fc to your computer and use it in GitHub Desktop.

Select an option

Save rodesousa/d8e48612c1c9668335fc to your computer and use it in GitHub Desktop.
dl files from url with wget

wget |curl

#dl tout les tar.gz d'une page
wget -A tar.gz -r -l 1 -nd 
#dl un fichier
curl -O PATH

extraire tout les .tar.gz (mais y'a mieux)

cat *.gz | tar -xf - -i > /dev/null

sort by date

ls -ltr

date

date +%Y-%m-%d-%H-%M

splitWhile

for x in echo "/tmp/rodrigo/roberto" | tr "/" "\n"; do echo $x; done

sed

sed -re 's/hosts: dns files/hosts: files dns/g' -i /etc/nsswitch.conf

reseau

tcpdump -n -i lo host lxpt904a.unix-int.intra-int.bdf-int.local port 514 netstat -i netstat -an | grep 514 ###interface ifconfig -a ifup INTERFACE

scp

Login1@Serveur1:Chemin1/NomFichier1 Login2@Serveur2:Chemin2/NomFichier2

array for

array="/etc/init/mongodb-mms-monitoring
/etc/init/mongodb-mms-backup-daemon
"
for element in $array
do
echo $element
done

rsync

rsync --exclude .git -avu --chmod=go+rX SOURCE USER@HOSTNAME:DEST

lien symbo

ln -frs .vimrc ~/

add un group à un user

usermod -a -G groupname username

port d'écoute de localhost

nmap -sT -O localhost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment