12/31/07

gusty firefox + google toolbar = hang

I love google toolbar and it's my number one online bookmark for a long time. After upgrade to gusty I feel that my firefox is not stable as it use to be. My firefox is freeze on some site that try to open second window. I'm not sure what's wrong firefox or toolbar but I know that after uninstall toolbar the problem gone. [to uninstall go to "Settings" > "Help" > "Uninstall" option on toolbar]
Now I need something to replace google toobar jobs. Not too hard to find this.
"Firefox Google Bookmark" for bookmarks. After install this extensions your firefox will has new menu "GBookmarks". below is screenshot

Another thing i need is gmail notifyer, there are many firefox extension and linux apps can do this job. For me i choose checkgmail.

pnix@pnix-a7n:~$ sudo aptitude install checkgmail
Reading package lists... Done
Building dependency tree
...
Building tag database... Done
pnix@pnix-a7n:~$

note: for now look like checkgmail from repos has problem about authorization. If you have a problem, go to get latest version from svn should fix it.
wget http://checkgmail.svn.sourceforge.net/viewvc/*checkout*/checkgmail/checkgmail
sudo mv checkgmail /usr/bin/
sudo chmod +x /usr/bin/checkgmail

Thanks to hotweiss from ubuntuforums for the trick.


Last, Happy new year 2008. :D

12/27/07

using cron to execute sqlscript in oracle

Using cron to run sql script is a good idea to apply with a periodic database job. When running any scripts, cron doesn't know any environment variable. So, in the script, we always
-use full path with execute command.
-define all environment variable.

ex. to see data in customer table in oracle database and log in customer_rpt.log, I create sql script[testsc1.sql] like this

[oracle@oracle1 ~]$ cat testsc1.sql
spool /home/oracle/customer_rpt.log
select * from customer;
quit;
[oracle@oracle1 ~]$


next create shell script file to run sql script file.
[oracle@oracle1 ~]$ cat mydbshell.cron
#!/bin/bash
ORACLE_HOME=/u01/app/oracle/product/10.1.0/db_1; export ORACLE_HOME;
ORACLE_SID=my_sid; export ORACLE_SID;
/u01/app/oracle/product/10.1.0/db_1/bin/sqlplus user/password @/home/oracle/testsc1.sql
[oracle@oracle1 ~]$
note that oracle_home, oracle_sid variable must be defined and sqlplus command called with full path.

Now, we define new cron job by 'crontab -e' in console and make it look like this[this is only example you need to modify it as you wish. to learn more about crontab type 'more crontab' ]
[oracle@oracle1 ~]$ crontab -l
0 4 * * * /home/oracle/mydbshell.cron
[oracle@oracle1 ~]$

12/22/07

sopcast on gutsy


To celebrate liverpool winning today[not yet but I'm so sure :D],this post will show you how to watch tv on gutsy. First goto sopcast download page and get these two rpm files, qsopcast-0.3.5-2mgc.i686.rpm and sp-sc-1.0.2-1mgc.i686.rpm.
Then to convert rpm packages to deb we need alien

pnix@pnix-a7n:sopcast$ sudo aptitude install alien
[sudo] password for pnix:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Building tag database... Done
The following NEW packages will be automatically installed:
libbeecrypt6 libneon25 librpm4 rpm
The following NEW packages will be installed:
alien libbeecrypt6 libneon25 librpm4 rpm
0 packages upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 1911kB of archives. After unpacking 6488kB will be used.
Do you want to continue? [Y/n/?] y
...
Building tag database... Done
pnix@pnix-a7n:sopcast$

now convert them to deb packages and install
pnix@pnix-a7n:sopcast$ ls
qsopcast-0.3.5-2mgc.i686.rpm sp-sc-1.0.2-1mgc.i686.rpm
pnix@pnix-a7n:sopcast$ sudo alien -k *
qsopcast_0.3.5-2mgc_i386.deb generated
sp-sc_1.0.2-1mgc_i386.deb generated
pnix@pnix-a7n:sopcast$ sudo dpkg -i *deb
Selecting previously deselected package qsopcast.
(Reading database ... 119336 files and directories currently installed.)
Unpacking qsopcast (from qsopcast_0.3.5-2mgc_i386.deb) ...
Selecting previously deselected package sp-sc.
Unpacking sp-sc (from sp-sc_1.0.2-1mgc_i386.deb) ...
Setting up qsopcast (0.3.5-2mgc) ...
Setting up sp-sc (1.0.2-1mgc) ...
pnix@pnix-a7n:sopcast$

That's it. Now goto "Applications/Intenet/qsopcast" and have fun

12/19/07

color your nano

nano editor is no syntax highlight for any language by default. It is only black and white as in the picture below.

To enable syntax highlight, you can uncomment the line [# include "/usr/share/nano/ruby.nanorc"]in /etc/nanorc[for global effect]. Or if you just want this effect to your user only. create ~/.nanorc and include default[sample] language specific config file from /usr/share/nano. Here is my java syntax highlight .nanorc file

include "/usr/share/nano/java.nanorc"