2011/08/26

Undelete in Linux (ext3 file system)

I accidentally wide out my 200 and some gigabytes of mp3 (again) by rsync'ing between bad disk. Luckily I found this undelete program and recover most of them.

http://extundelete.sourceforge.net

Also check out this great article if you're techie: http://carlo17.home.xs4all.nl/howto/undelete_ext3.html

Install BootCamp 4.0

If you upgrade to Lion from Snow Leopard + Win7 bootcamp, you might find that you can't download new bootcamp 4.0 from Bootcamp Assistant. The way I go around it is by downloading it from Apple's CDN:
  1. Download Bootcamp 4.0 Drivers, here's a link on some Apple CDN for the .pkg file containing the drivers (603MB): http://bit.fosk.it/bootcamp40
  2. Open this file with 7Zip in Windows, and go through a few layers to extract BootCampESD.pkg\Payload\Payload~\.\Library\Application Support\BootCamp\WindowsSupport.dmg\0.Apple_ISO
  3. Rename the file from 0.Apple_ISO to BootCamp4.iso
  4. Extract the iso with 7Zip to a folder.
  5. Open command prompt and navigate to the extracted folder, for example:
    E:
    cd WindowsSupport\Drivers\Apple
  6. From the prompt in that folder, run msiexec /i BootCamp64.msi

2011/05/12

Generating Video Thumbnails With FFMPEG

Check out flowplayer's - http://flowplayer.org/tutorials/generating-thumbs.html

In short,

ffmpeg -i [video_file] -f image2 -vframes 1 [output_image].jpg


For example,

ffmpeg -ss 12 -i flowplayer.mov -f image2 -vframes 1 flowplayer-12.jpg

Finding video/ image file info

In ffmpeg, you can determine video or image file info:


ffmpeg -i my_video_filename


Another option is exiftool tool.

1. Install on RHEL
yum install perl-Image-ExifTool.noarch
**you need to have rpmforge repository installed.

2. Use it
exiftool my_video_file

2011/05/07

Install Google Chrome on RHEL

This howto explains howto install Google Chrome Web browser on Fedora 14, Fedora 13, Fedora 12 and Red Hat 6 (RHEL 6). Best way to install and keep up-to-date with Google Chrome browser is use Google’s own YUM repository.

1. Enable Google YUM repository

Add following to /etc/yum.repos.d/google.repo file:
32-bit
[google]
name=Google - i386
baseurl=http://dl.google.com/linux/rpm/stable/i386
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
64-bit
[google64]
name=Google - x86_64
baseurl=http://dl.google.com/linux/rpm/stable/x86_64
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
Note: Both 32-bit and 64-bit repos can be placed in the same file.

2. Install Google Chrome with YUM (as root user)

Install Google Chrome Stable Version

## Install Google Chrome Stable version ##
yum install google-chrome-stable

Install Google Chrome Beta Version

## Install Google Chrome Beta version ##
yum install google-chrome-beta

Install Google Chrome Unstable Version

## Install Google Chrome Unstable version ##
yum install google-chrome-unstable

2011/03/12

Fix backspace/delete when ssh'ing into Linux machines

the solution is very simple now-the-day. Just go to Terminal's preference, settings, advanced, and check the "Delete sends Ctrl-H".

There's no need to modify .tcshrc what so ever..

2011/02/12

Mac: Print screen key






Windows 鍵

Mac 鍵

用途



Alt

Option

輸入特殊字元,如 é。



Control

Command (⌘)

執行動作或快速鍵。例如,按下 ⌘ + S,通常會儲存文件或檔案。



Num Lock

Num Lock

Shift + Clear

在某些應用程式中,控制是否按下數字鍵盤的按鍵來輸入數字或移動游標。



Scoll Lock

Control + F14

在某些應用程式中,控制是否按下方向鍵來移動游標或在視窗中捲視。



Print Screen

⌘ + Shift + 3
⌘ + Shift + 4

拍攝螢幕照片。⌘ + Shift + 3 會擷取整個螢幕的畫面。⌘ + Shift + 4 會擷取您螢幕所選區域的畫面。


On Windows 7, use those combo keys:
Shift + Fn + F11: Print Screen
Alt + Shift + Fn + F11: Print Active Window

http://docs.info.apple.com/article.html?path=Mac/10.5/yh/cdb_winkeys.html

2011/02/10

Building HandBrakeCLI for CentOS

Problem with CentOS & other RHEL is that it's packages are updated slowly. Building software like Handbrake needs additional steps.

1. First of all, you need to have the essential development tools:
yum groupinstall "Development Tools" "Development Libraries" \
"X Software Development" "GNOME Software Development"

yum install yasm zlib-devel bzip2-devel \
dbus-glib-devel libgudev1-devel webkitgtk-devel libnotify-devel \
gstreamer-devel gstreamer-plugins-base-devel


2. Build Autoconf 2.61 (stock is 2.59) and install to /opt
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.61.tar.bz2
tar xjf autoconf-2.61.tar.bz2
cd autoconf-2.61
./configure --prefix=/opt
make
sudo make install


3. Use the 2.61 version
export PATH=/opt/bin:$PATH

4. Greb latest source from subversion or download from Handbrake source.
Here we assume you download the tar source:
wget http://handbrake.fr/rotation.php?file=HandBrake-0.9.5.tar.bz2
tar zxvf HandBrake-0.9.5.tar.gz


5. Config & build
GUI version is no supported according to the Handbrake forum. --disable-gtk option will generate CLI build.
cd HandBrake-0.9.5
./configure --disable-gtk --launch

it's gonna take awhile depending on your hardware...

-------------------------------------------------------------------------------
time end: Thu Feb 10 12:57:49 2011
duration: 20 minutes, 2 seconds (1202.42s)
result: SUCCESS
-------------------------------------------------------------------------------
Build is finished!

6. Install
If no other trouble, you get the success build result. Now install it:
cd build
make install

This will copy the build to /usr/local/bin/HandBrakeCLI and now enjoy the work!
HandBrakeCLI --help

Reference:
  1. https://trac.handbrake.fr/wiki/CompileOnLinux
  2. https://forum.handbrake.fr/viewtopic.php?f=13&t=19479
  3. http://linuxtoolkit.blogspot.com/2010/10/installing-handbrake-on-fedora-13.html

2011/01/14

Snow Leopard - clean up MySQL installation

For whatever reason you need to reinstall/ clean MySQL. Here are the spots:

sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQLStartupItem.pkg/
sudo rm -rf /var/db/receipts/com.mysql.mysql*
sudo rm -rf /var/db/receipts/com.mysql.mysqlstartup*


edit /etc/hostconfig and remove the line MYSQLCOM=-YES-

Launchctl
launchctl list|grep mysql


remove anything found.

2011/01/07

iphone, 威寶 & APN

威寶APN設定
吃到飽APN: internet
日租APN: vibo
username / password 皆空白

設好後internet tethering才會work.

device: iPhone 3G
iOS: 4.1 Pwnage JB
baseband: 6.15
bootloader: 6.02

Mercury簡易改裝

有同好有一樣的困擾 - 如何使用自己的data logging軟體,因此寫了這篇來分享我的簡易改裝。 Background 雲豆子 MERCURY roaster 烘豆機的設計是使用自行開發的軟體,來:1. 操控風門/火力; 2. data logging/自動烘焙。 ...