Saturday, December 27, 2008

some tips

  1. "\ls" will use the raw "ls" instead of the aliased one
  2. in Android, if two projects with the same package name are created in Eclipse, they are not going to co-exist on the emulator, the later-installed apk will overwrite the earlier one.
  3. resue damaged hard drive:
    dd bs=512 conv=noerror,sync if=/dev/hda of=/some_dir/foo.image
    Also can use gzip or bzip2 to compress.
  4. FAT32 can only allow a maximum file size of 4GB. So when doing the data rescue with a destination of FAT32 partition, it will show "stdout: file too large" when the image file reaches 4G. It's not the gzip or bzip2 problem. Solution is to change the file system. BTW: better stay away from HFS, an Apple monoply file system, except some frenetic apple fans who are using HFS for all their drives.
  5. On an Apple iBook G4, hold down 'Option' key when it boots, will let you choose the boot media. If having trouble ejecting a disc, ultimate solution is to restart the computer while holding down the trackpad button.
  6. The hfsplus file system is supported in linux kernel, which has to be selected. The location is 'File systems -> Miscellaneous filesystems -> Apple xxxx support'.
  7. To burn an toast image under windows: use daemon-tools to mount the toast image, then use DVD burn software to copy from the virtual device to the destination DVD-RAM. Windows is not able to read files from the toast image.
  8. convert dmg file to iso (under mac os x)
    hdiutil convert /path/to/filename.dmg -format UDTO -o /path/to/savefile.iso
    It will add a .cdr suffix. Just rename it to iso.
  9. xargs with blank space in file name. The GNU xargs (used on Linux) has a -0 (zero) option; this means the pathnames it reads are separated by NUL characters instead of whitespace. GNU's find (also used by Linux) has a -print0 operator that puts a NUL between pathnames instead of a newline. Use them together like this:
    find . -type f -mtime +7 -print0 | xargs -0 rm
    Here is a good article on find/xargs.