Archive for the ‘Open Source’ Category

MacPorts - tweaking the ports

Tuesday, October 7th, 2008

Have you thinking of tweaking the ports for some reason, e.g. sources downloading are slow, checksum error from a site and etc. Below are the configs and directories :

ports file is store at /opt/local/var/macports/sources/rsync.macports.org/release/ports/

source downloaded are kept in /opt/local/var/macports/distfiles/

Happy tweaking !!!

macports - port common usage

Monday, October 6th, 2008

update port database with the latest list :
e.g. port -v selfupdate

search for a port :
e.g. port search apache

install a port with verbose output :
e.g. port -v install apache2

wild card search of a port :
e.g. port list apache*

list variants of a port :
e.g. port variants apache2

information of a port :
e.g. port info apache2

installed port on the system :
e.g. port installed

bash - dealing with backtics ” ` ” in mysql statement

Saturday, October 4th, 2008

problem :

using backticks in bash for mysql statements. e.g. :

mysql -u username -h host -e “GRANT SELECT, LOCK TABLES ON `somedatabase`.* TO ’someuser’@’somehost’;” -p<password with no space after parameter>

would get an error :

./scriptname: line 5: somedatabase: command not found

solution :

escape (\) the backticks ” ` ” surround “somedatabase”

mysql -u username -h host -e “GRANT SELECT, LOCK TABLES ON \`somedatabase\`.* TO ’someuser’@’somehost’;” -p<password with no space after parameter>

vim - error when starting

Saturday, October 4th, 2008

problem :

For some reason, starting up vim pops up an error at the bottom :

E575: viminfo: Illegal starting char in line: d^\^F
Press ENTER or type command to continue

solution :

delete the contents in ~/.viminfo

Voila !!!

Firefox 3 - “force” your add on compatible with it

Friday, October 3rd, 2008
  • On the url bar, type “about:config”
  • Right click on any of the empty space, click new –> boolean
  • In the box, preference name –> extensions.checkCompatibility
  • specified the value –> false

restart firefox and Voila !!!