среда, 17 августа 2011 г.

NOD32 update (FREEBSD+APACHE)

#!/usr/local/bin/bash

touch /root/nod32_start_$(date +%d-%m-%Y-%H:%M:%S)

export CURDIR="/usr/local/www/nod32"
export USERESET="ИМЯ"
export PASSESET="ПАРОЛЬ"

cd $CURDIR

wget -q --timestamping http://update.eset.com/eset_upd/update.ver &&

mv -f update.ver update.rar &&
cd $CURDIR/eset_upd &&
unrar e -y ../update.rar . &&
cd $CURDIR &&
mv update.rar update.ver &&

grep file= eset_upd/update.ver | \
grep "file=/download/" | \
sed -e 's/file\=/http\:\/\/um10.eset.com/' | \
grep engine3 | \
grep -v data > downlist1.txt

grep file= eset_upd/update.ver | \
grep "file=/download/" | \
sed -e 's/file\=/http\:\/\/um10.eset.com/' | \
grep engine3ess | \
grep -v data > downlist2.txt

grep file= eset_upd/update.ver | \
grep "file=/download/" | \
sed -e 's/file\=/http\:\/\/um10.eset.com/' | \
grep v3 | \
grep -v data > downlist3.txt

grep file= eset_upd/update.ver | \
grep "file=/download/" | \
sed -e 's/file\=/http\:\/\/um10.eset.com/' | \
grep emsx | \
grep -v data > downlist4.txt

cd $CURDIR/download/engine3/ &&
wget --timestamping --http-user=$USERESET \
--http-password=$PASSESET \
--input-file=../../downlist1.txt \
--user-agent="ESS Update (Windows; U; \
32bit; VDB 7001; BPC 4.0.474.0; \
OS: 5.1.2600 SP 3.0 NT; CH 0.0; LNG 1049; \
x32c; UPD http://um10.eset.com; \
APP ess; BEO 1; CPU 5964; ASP 0.0)"

cd $CURDIR/download/engine3ess/ &&
wget --timestamping --http-user=$USERESET \
--http-password=$PASSESET \
--input-file=../../downlist2.txt \
--user-agent="ESS Update (Windows; U; \
32bit; VDB 7001; BPC 4.0.474.0; \
OS: 5.1.2600 SP 3.0 NT; CH 0.0; LNG 1049; \
x32c; UPD http://um10.eset.com; \
APP ess; BEO 1; CPU 5964; ASP 0.0)"

cd $CURDIR/download/win/v3/ &&
wget --timestamping --http-user=$USERESET \
--http-password=$PASSESET \
--input-file=../../../downlist3.txt \
--user-agent="ESS Update (Windows; U; \
32bit; VDB 7001; BPC 4.0.474.0; \
OS: 5.1.2600 SP 3.0 NT; CH 0.0; LNG 1049; \
x32c; UPD http://um10.eset.com; \
APP ess; BEO 1; CPU 5964; ASP 0.0)"

cd $CURDIR/download/win/emsx/ &&
wget --timestamping --http-user=$USERESET \
--http-password=$PASSESET \
--input-file=../../../downlist4.txt \
--user-agent="ESS Update (Windows; U; \
32bit; VDB 7001; BPC 4.0.474.0; \
OS: 5.1.2600 SP 3.0 NT; CH 0.0; LNG 1049; \
x32c; UPD http://um10.eset.com; \
APP ess; BEO 1; CPU 5964; ASP 0.0)"


touch /root/nod32_end_$(date +%d-%m-%Y-%H:%M:%S)

eject CD-ROM

eject /dev/sr0
выдвигаем каретку

eject -t /dev/sr0
задвигаем каретку

crontab

создание(перезапись старой) записи кронтаб

crontab /path/to/file_cron

создание(перезапись старой) записи кронтаб для указаного пользователя

crontab -u user_name /path/to/file_cron

просмотр кронтаба

crontab -l

удаление записи кронтаб

crontab -r

редактирование записи кронтаб в текстовом редакторе по умолчанию

crontab -e

md5sum

$ dd if=/dev/sdc0 bs=2048 count=169383 | md5sum
169383+0 records in
169383+0 records out
cc363de222ba6fe7455258e72b6c26ca -
$ dd if=/dev/sdc0 | md5sum
$ md5sum image.iso

Wodim - запись дисков в консоли

wodim -eject -v speed=16 /path/to/image.iso
запись ISO образа на скорости 16х и выброс каретки

wodim blank=fast/all
Быстрое/полное стирание диска (только если остройство отмонтировано)