Solving problems is fun. But solving the same problem over and over is pain. Once solved, forever solved.
sourcecode
Thursday, March 21, 2013
Friday, March 8, 2013
Mount USB external drive on Linux
1. Plug in the USB disk.
2. Under
/dev/disk/by-label
find the device info, e.g.
Seagate\x20Backup\x20Plus\x20Drive -> ../../usb_bk
(or, simple $ lsusb)
3. sudo makedir /mnt/usb_bk
4. cd ../..
5. mount sdb1 /mnt/usb_bk
Now, the disk shows up under /mnt/usb_bk
6. (optional)
To make it auto mount, first confirm the mount parameters:
$mount
it should show the mount type:
Then edit /etc/fstab
2. Under
/dev/disk/by-label
find the device info, e.g.
Seagate\x20Backup\x20Plus\x20Drive -> ../../usb_bk
(or, simple $ lsusb)
3. sudo makedir /mnt/usb_bk
4. cd ../..
5. mount sdb1 /mnt/usb_bk
Now, the disk shows up under /mnt/usb_bk
6. (optional)
To make it auto mount, first confirm the mount parameters:
$mount
it should show the mount type:
/dev/sdb1 on /mnt/usb_bk type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
Then edit /etc/fstab
/dev/sdb1 /mnt/usb_bk fuseblk defaults 0 0
http://linuxconfig.org/Howto_mount_USB_drive_in_Linuxhttp://myubuntublog.wordpress.com/2009/05/25/auto-mount-usb-hard-drive-at-boot/
ARECA backup tool
1. Install Java
sudo apt-get install openjdk-7-jdk openjdk-7-jre icedtea-7-plugin
2. Download and install areca:
http://www.areca-backup.org/
sudo apt-get install openjdk-7-jdk openjdk-7-jre icedtea-7-plugin
2. Download and install areca:
http://www.areca-backup.org/
Thursday, March 7, 2013
clang 3.2
compile from source code. Follow the instructions on:
http://clang.llvm.org/get_started.html
Note: the ./configure line is changed to
$ CC=gcc CXX=g++ ../llvm/configure
OR, apt-get install
http://askubuntu.com/questions/261636/how-do-i-backport-install-a-newer-version-of-clang
http://clang.llvm.org/get_started.html
Note: the ./configure line is changed to
$ CC=gcc CXX=g++ ../llvm/configure
OR, apt-get install
http://askubuntu.com/questions/261636/how-do-i-backport-install-a-newer-version-of-clang
Tuesday, March 5, 2013
Recursive global replace
find ./ -type f -exec \under a folder, do an exact match, and recursively replace to a new word.
sed -i 's/\<map\>/unordered_map/g' {} +
The motivation was this: I want to upgrade my source code to C++11. To be more efficient, all the old <map> header and usage, which is log(n), should be replaced by the new hash function in <unordered_map>. But there are other names with prefix or postfix "map", which should not be changed.
Subscribe to:
Posts (Atom)