Monday, December 24, 2012

watch "ps -xv | grep php"

Installing watch on mac


Download the “watch” command from Terminal.app
We are using “curl” a command line “broswer”
curl -O http://ktwit.net/code/watch-0.2-macosx/watch
Make “watch” executable
By doing this we tell Mac OS that this is a program that can run
chmod +x watch
Test the program
Let’s make sure everything is in working order.
./watch
Install “watch”
Optional: By following this next step we are placing watch into a system location that will allow you to run it from any location in the Terminal (You will be prompted for your password)
sudo mv watch /usr/bin/


Trying to run pconnect via terminal on MAC

Warning: mysql_pconnect(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock)

can be fixed with:


sudo su
ln -s /Applications/xampp/xamppfiles/var/mysql/mysql.sock /tmp/mysql.sock
mkdir /var/mysql
ln -s /Applications/xampp/xamppfiles/var/mysql/mysql.sock /var/mysql/mysql.sock

Saturday, October 20, 2012

Forex Exchange

Planning on a trip overseas and trying to understand the forex table that is on the back of all these money changers. But this is a cheat sheet to try to understand them:

Remember, buy and sell is always from the money exchanger point of view
     
Hence in Singapore,   
Buy Rate: The bank buying TWD (multiply)
Sell Rate: The bank selling TWD (divide)
     
Hence in Taiwan  
Buy Rate: The bank buying SGD (multiply)
Sell Rate: The bank selling SGD (divide)
     
At home, look for selling rate. Overseas look at buying rate.

Examples:

1. You are from Singapore going to Malaysia.
a. If you are changing money in Singapore, you will look at the 'sell rate' say it is 0.4013
b. You will then 'divide' by the amount you want to change say $100
c. So you will net: $100/0.4013 = $249.19 MYR

2. You are from Malaysia going to Singapore.
a. If you are changing money in Singapore, you will look at the 'buy rate' say it is 0.3987
b. You will then 'multiply' $100 * 0.3987 = $39.87 SGD

Singapore Credit Cards for Miles

The two best cards are the DBS VISA Altitude Card and the UOB PRIV Miles Card

DBS Visa Altitude
- 1.6mies if you spend $2k per month
- What i like most about the card is that it is a VISA. i.e. more generally accepted and I can use this one card for literally everything
- What i dislike most about this card is the travel insurance, take note their travel insurance may cover your LIFE for $1million but it does not cover anything else e.g. late baggage, medical (which is the main reason why one should buy travel insurance anyway)

UOB PRIV Miles Card
- 1.6 miles without a minimum spend
- 2.5 miles for purchases overseas
- Partnership with AMEX and quite a lot of the shops I go to do not accept AMEX
- Apart from good miles, the travel insurance is fairly comprehensive (it includes medical)
- Free limo trip to the airport if you charge the airfare.

These two are certainly the top two. The other cards (that are within reach of normal/slightly affluent Singaporeans) are really shitty, the worst being Krisflyer gold, Citi Premier Miles etc. 

Sunday, August 19, 2012

Managing photos on iPhone/iPad iEtc

Syncing photos on the mac for iPhone can be such a pain because syncing and managing it is two separate function. And since I was too cheap to buy appeture or iPhotos, I have to find other ways to manage photos on my macbook.

To manage photos (i.e. download them to your macbook) and not sync and find that your photos is inside a "Photo Database" file which is a 4KB unix file - which actually redirects to the iPhone backup folder. Truth be told, whenever you sync, the files are actually on your computer inside the following path: but you can't use them. its giberish. You need to organise them and this is how:

http://www.maclife.com/article/howtos/how_manage_photos_pain_free

In short:

1. Connect your iphone
2. Create a folder on your Pictures main folder, I call mine "Aaron's Iphone"
3. Start Image Capture (can be found under applications)
4. Select to import to "Aaron's Iphone" folder and import all.
5. Manage the pictures and the next time you can sync accordingly

Friday, March 30, 2012

hdd recovery

1. try this:
diskutil list
sudo gpt recover /dev/disk3

2. if that fails, try recovery:
- easeu data recovery is pretty good and fast
- disk drill is also pretty good but doesn't remember the file names