Extrage IP-urile alocate ?i le pune într-un array, în afar? de 127.0.0.*. În caz c? dori?i s? v? juca?i cu propriile scripturi/paneluri de administrare poate fi util. Le afi?a?i cu echo ${IPs[0]} 1,2,3 ?i tot a?a. ar putea fi îmbun?t??it?, dar e ok ?i a?a.
extrage ip-uri dintr-un fisier grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' file extrage email-uri dintr-un fisier grep -o '[^:]*@[^:]*' file.txt sorteaza ip si elimina duplicat cat ip | sort | uniq for ip in 192.168.1.{1..255}; do ping -c 1 -t 1 $ip > /dev/null && echo “${ip} is up”; done
Daca vreti sa faceti misto de un regular user , punetii asta in profil si chimbati ownership cu root:root si file atribute 0600 ; Usefull administration commands alias ifconfig="echo $1 error fetching interface information: Device not found" alias iptables="echo Try `iptables -h' or 'iptables --help' for more information." alias w="echo -bash: w: command not found" alias whoami="echo Un bou" alias last="echo -bash: last: command not found" alias netstat="echo -bash: netstat: command not found" alias lsmod="echo -bash: lsmod: command not found" alias insmod="echo -bash: insmod: command not found" alias uname="echo -bash: uname: command not found" alias su="echo -bash: su: command not found" alias sudo="echo -bash: sudo: command not found" ; Editors alias mc="echo -bash: mc: command not found" alias mcedit="echo -bash: mcedit: command not found" alias vi="echo -bash: vi: command not found" alias pico="echo -bash: vi: command not found" ; Editors util alias cat="echo -bash: cat: command not found" alias awk=""echo -bash: awk: command not found" alias grep="echo -bash: grep: command not found" Sigur o sa ii ia un pic sa se prinda ce naiba se intampla pyth0n3 eu zic sa te apuci sa iti scrii propriul shell , eventual bazat pe python.
Simple http server cu python. Se listeaza pe port 8000 si este util cand dorim sa punem ceva disponibil pe web, fara a avea apache sau alt daemon instalat. python -c "import SimpleHTTPServer;SimpleHTTPServer.test()" Acelasi lucru, insa se listeaza pe port 80 python -m SimpleHTTPServer 80