Monday, December 8, 2014

thunderbird (icedove on debian) and /tmp/ issue

Thunderbird has a flaw. When you open attachment directly from it, it
saves the file under /tmp/ with read permission to the world. Any other
users on the same machine can read it freely.

To fix this, you must set the tmp directory for thunderbird manually
like the line below.

$ TMP=~/tmp/.icedove icedove -P default -no-remote > /dev/null 1>&2 &

Sunday, December 7, 2014

Monday, November 24, 2014

How To Backup BootSector/MBR for Windows Boot

Backup the BootSector/MBR

Some guides show only taking the first 512 bytes (MBR), others show the
first 63 blocks (MBR + Bootloader).

# dd if=/dev/sda of=/mnt/storage/sda.mbr bs=512 count=1
# dd if=/dev/sda of=/mnt/storage/sda.vbr bs=512 count=63

Friday, November 21, 2014

how to delete samba session on windows

control keymgr.dll

พอลบ user แล้วก็ใช้คำสั่ง net use ดูว่าเราค้างอยู่ในแชร์ไหนของ samba ก็ delete ออก
อย่างเมื่องเช้าค้างอยู่ใน folder share ก็ใช้ net use \\samba\share /delete

Sunday, November 16, 2014

how to permanently set max_user_watches of inotify in debian

add the following lines:

> fs.inotify.max_user_watches=200000

into this file: /etc/sysctl.d/local.conf

Saturday, November 15, 2014

how to get serial number of harddisk on dell server

Dell server uses PERC controller so...

smartctl -a -d megaraid,$a /dev/sda

$a is 0, 1, 2 and 3 for disk #0, #1, #2 and #3, expectively

Sunday, November 9, 2014

rsync

useful rsync command line

rsync -avz --delete --append src/ dst