Archive for the ‘unix+freebsd’ Category

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 !!!

FreeBSD - portupgrade rrdtool_1.2.26

Thursday, October 2nd, 2008

Problem :

grep: /usr/X11R6/lib/libfontconfig.la: No such file or directory
sed: /usr/X11R6/lib/libfontconfig.la: No such file or directory
gnome-libtool: link: `/usr/X11R6/lib/libfontconfig.la’ is not a valid libtool archive
gmake[4]: *** [libpangoxft-1.0.la] Error 1
gmake[4]: Leaving directory `/usr/ports/x11-toolkits/pango/work/pango-1.20.5/pango’
gmake[3]: *** [all-recursive] Error 1
gmake[3]: Leaving directory `/usr/ports/x11-toolkits/pango/work/pango-1.20.5/pango’
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory `/usr/ports/x11-toolkits/pango/work/pango-1.20.5/pango’
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/usr/ports/x11-toolkits/pango/work/pango-1.20.5′
gmake: *** [all] Error 2
*** Error code 2

Stop in /usr/ports/x11-toolkits/pango.
*** Error code 1

Stop in /usr/ports/databases/rrdtool.
*** Error code 1

Stop in /usr/ports/databases/rrdtool.
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade.28338.0 env UPGRADE_TOOL=portupgrade UPGRADE_PORT=rrdtool-1.2.26 UPGRADE_PORT_VER=1.2.26 make
** Fix the problem and try again.

solution :

After satisfying the dependencies (cairo & pango), do “ln /usr/local/lib/libfontconfig.la /usr/X11R6/lib/libfontconfig.la”

bash script accept parameter when called

Monday, September 29th, 2008

example :

#!/bin/bash

echo this is the first parameter supplied $1, and this is script name is $0