##Chave Windows Proxy Settings reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Control Panel" /v proxy /t reg_dword /d 0 /f ##Rsync fast rsync -aHAXxv --numeric-ids --delete --progress -e "ssh -T -c arcfour -o Compression=no -x" [source_dir] [dest_host:/dest_dir] ##Iperf nos routers service udp-small-servers iperf -c 192.168.0.1 -u -P 1 -i 3 -p 7 -f k -b 1024.0K -t 600 -T 1 ##DEBUG IP DHCP SERVER PACKET tcpdump -i any -vv -nn port 67 or port 68 and udp[38:4] = 0xa72df916 ##Router Cisco show ip flow top-talkers ! show ip access-list (Adiciona uma entrada na ordem desejada) (config)#ip access-list extended 199 (config-ext-nacl)#15 permit ip 172.23.202.200 ! (Remove uma entrada na ordem desejada) (config)#ip access-list extended 199 (config-ext-nacl)#no 15 ! (Reorganiza a sequencia das entradas na access-list) ip access-list resequence [nome | numero da lista] [valor inicial | valor do intervalo] Exemplo: (config)#ip access-list resequence 199 10 10 ##SSH redirect ssh -p443 -L 8888:192.168.0.97:80 user@server.com ssh remote-host -L 8822:REMOTE_IP_1:22 -L 9922:REMOTE_IP_2:22 ##Mandando email via shell echo "Mensagem" | mail -a "From: R2D2@server.mail.com" -s "Assunto" destino@dominio.com Com anexo: echo "Mensagem" | mutt -a /home/user/backup.tar.gz -s "Assunto" user@yourmaildomain.com ##Usando grep com “or” e “before” no bigip tmsh show gtm wideip detail|grep -e 'Gtm::WideIp:\|Gtm::Pool:'|grep -B 1 "sample" ##Usando while e if na mesma linha while sleep 1; do DDIG=`dig @208.67.222.222 www.google.com|grep "status"|awk '{print $5$6}'`;if [ "$DDIG" != " " ]; then echo "OK"; else echo "ERRO"; fi; done; ##Varrendo a rede nmap -sP 192.168.0.1-254 ##Usando ping com for for ip in 192.168.1.{1..10}; do ping -c 1 -t 1 $ip > /dev/null && echo "${ip} is up"; done ##Usando for com arquivo for IP in $(cat origem_dns.txt); do geoiplookup $IP | echo $IP - `awk '{ print $4$5$6$7 }'`; done ##Usando ping e filtrando apenas o IP, colocando em ordem e removendo os duplicados ping -b 192.168.0.255 | grep 'bytes from' | awk '{ print $4 }' | sort | uniq #Get the ip address for the range ip=$(/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}' | cut -d"." -f1,2,3) # ping test and list the hosts and echo the info for range in $ip ; do [ $? -eq 0 ] && ping -c 1 -w 1 $range > /dev/null 2> /dev/null && echo "Node $range is up" done ##TCPDump tcpdump -i any -n -A host 192.168.0.1 and host 200.100.50.10 -w arquivo.pcap -c 5000 tcpdump -i any -nn -vv -A port 53 tcpdump -e -vv -nn -i any ether host 00:11:22:33:44:55 #Capturar pacotes DHCP tcpdump -i eth0 -nn -vv -s 1500 port bootps or port bootpc tcpdump -i eth0 -vvv -nn -s 1500 '((port 67 or port 68) and (udp[8:1] = 0x1))' # I want to capture IPv4 packets using tcpdump that have had the DSCP class 'af21' set, but, tcpdump doesn't have a filter for DSCP and doesn't decode values to DSCP classes, what can I do? tcpdump -v -n -i eth0 'ip and ip[1] & 0xfc == 72' Fonte: http://www.tucny.com/Home/dscp-tos ##GnuGrep ggrep -Ril "192.168.0" /path/file ##Grep recursivo With find: cd /the/dir find . -exec grep pattern {} + With GNU grep: grep -r pattern /the/dir ##Find com cat find . -type f -print -exec cat {} \; ##Quebrando linha com Kate e bash Pressione F7 no texto e use a string: %s/exemplo /\n exemplo/g Via bash: sed -e 's/exemplo/\n exemplo/g' Arquivo.txt >Arquivo_Novo.txt ##Change AD user password Set-AdAccountPassword -Identity $AccountName -OldPassword (Read-Host -asSecureString "Enter the current password") -NewPassword (Read-Host -asSecureString "Enter the new password") ##Send e-mail via telnet telnet mail.sample.com 25 EHLO sample.com MAIL FROM: RCPT TO: NOTIFY=success,failure DATA Subject: Test from sample.com This is a test message. . ## PFX to .key/.crt #Extrair a key openssl pkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key] #Será solicitado a senha atual e depois solicitará uma nova senha, caso precise da key sem senha posterioemnte utilize "openssl rsa -in [file1.key] -out [file2.key]" para remover. #Extrair o crt openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [certificate.crt] #Checar crt e key openssl x509 -noout -modulus -in /etc/ssl/g.crt openssl rsa -noout -modulus -in /etc/ssl/g.key #AIX Check UUID disk lspv -u | awk -F " " '{print $1" - " substr($5, 1, length($5)-14)}' | awk -F "-" '{print "Disco: "$1" UUID=" substr($2,7);}' ou lsdev -Cc disk -F name | while read hdisk; do echo ${hdisk},$(odmget -q "name=${hdisk} and attribute=unique_id" CuAt|grep value|cut -d '"' -f2) done