Mar 28

Štai radau keleta lietuviškų ip adresų sąrašų. Gal kam pravers praktikoje :)

  1. wget -c -O – ftp://ftp.ripe.net/ripe/stats/`date "+%Y"`/delegated-ripencc-`date "+%Y%m%d"`.bz2 | bzcat|grep -i "|LT|ipv4|" | awk -F ‘|’ ‘{print $4}’

arba tiesiog parsisiuskite adresais:

ftp://ftp.ripe.net/ripe/stats/2008/
http://www.completewhois.com/statistics/data/ips-bycountry/rirstats/LT-cidr.txt

Mar 28

Kartais po apt atnaujinimo, gaunama klaida del blogo rakto.
Tokiu atveju reikia importuoti atnaujinta rakta, tai daroma taip:

gpg –keyserver wwwkeys.eu.pgp.net –recv-keys 4F368D5D
gpg –armor –export 4F368D5D | apt-key add -
apt-get update

Mar 28

Štai bash shortuctai, gal pravers daznai dirbantiems consolej :)

Ctrl + A – Go to the beginning of the line you are currently typing on
Ctrl + E – Go to the end of the line you are currently typing on
Ctrl + L – Clears the Screen, similar to the clear command
Ctrl + U – Clears the line before the cursor position. If you are at the end of the line, clears the entire line.
Ctrl + H – Same as backspace
Ctrl + R – Let’s you search through previously used commands
Ctrl + C – Kill whatever you are running
Ctrl + D – Exit the current shell
Ctrl + Z – Puts whatever you are running into a suspended background process. fg restores it.
Ctrl + W – Delete the word before the cursor
Ctrl + K – Clear the line after the cursor
Ctrl + T – Swap the last two characters before the cursor
Skaityti toliau »

Mar 26

Kadangi dauguma sysadminų truputi pritingi, tai šiandien ne pats rašiau, o ieškojau jau paruošto mysql backup scripto.

Po keliasdešimties minučių googlėj radau visai neblogai veikiantį scriptuką.

Šį mysql scriptą parsisiūsti galite iš čia.

Jis puikia veikia su defaultiniais nustatymais. Tik aš šiek tiek pritaikiau jį savo reikmėms. T.y padariau, kad logus jis rašytų ne kaskart i naują, o į vieną failą.

Tam tereikėjo 165 eilutėje pakeisti:

iš $log_path = $BACKUP_DEST . ‘/’ . $LOG_FILE;
į $log_path = ‘/var/log/db_backup.log’;

Ir dar 166 eilutėje vietoj w įrašyti a, tai reiškia apendinti failą, o ne rašyti ant viršaus.

($f_log = fopen($log_path, ‘a‘)) || error( true, ‘Cannot create log file: ‘ . $log_path, true );