A Perl tip to replace strings, symbols.. 

perl -pi'.orig' -e 's/oldstring/newstring/g' fileA, fileB...the i argument is backup option, fileA, fileB will be backed up as fileA.orig, fileB.orig. Ever have format problem with '\r','^M', '\n' after transfering files between windows/mac/linux. try perl -pi'.orig' -e 's/\r(\n)?/\n/g' fileA, fileB...

If on unix/linux, try unix2dos command
[ add comment ] permalink ( 3.1 / 70 )
Wonder how to get two way packets from tcpdump? 

Such a simple question, silly me. run tcpdump on both end and specify the src host and dst port or src port.
[ add comment ] permalink ( 3.1 / 82 )
MySQL setup hassle 

While fiddling with mysql setup, the new mysql command client connect to the new mysql server fine, but not old mysql command client, so I have to make symbolic link to the new mysql command client like ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql, same as mysqladmin...

I thought the above symbolic link should solve all the setup problem, but it didn't. When I run the WebCalendar setup and test mysql conncetion from the web setup interface, error "could not connect /var/lib/mysql/mysql.sock..." pops up, damn! why would the WebCalendar look for the old mysql server socket file instead of the new one /tmp/mysql.sock? is this PHP mysql client problem? To work around this issue, I reset the socket file to /var/lib/mysql/mysql.sock in the mysql client and server section of /etc/my.cnf "socket = /var/lib/mysql/mysql.sock" and restarted msyqld. this sovled the socket problem.
I was so happy to get rid of the complain and test the mysql connection again, but guess what, I came across another problem "Client does not support authentication protocol". I googled around the Internet, found the http://dev.mysql.com/doc/refman/5.0/en/old-client.html link. (pre-4.1) mysql clients does not support the new hash algorithm, well, I don't know how the WebCalendar PHP application call the old mysql client and don't want to update all mysql client libraries. I could reset the WebCalendar mysql user password to pre-4.1 style:

mysql> SET PASSWORD FOR
-> 'webcalendar'@'localhost' = OLD_PASSWORD('newpwd');

I can identify these accounts with the following query:

mysql> SELECT Host, User, Password FROM mysql.user
-> WHERE LENGTH(Password) > 16;

when you

mysql> desc mysql.user;

you will see the pos-4.1 mysql use varchar(41) to define the "Password" colum.

After I reset the Password, all works fine
[ add comment ] permalink ( 2.9 / 80 )
Floppy on Fedora Core 3 

Today, I tried to dd if=boot.img of=/dev/fd0 bs=1024 conv=sync; sync , but I always got error message "dd: opening '/dev/fd0', read-only file system". then I fdformatted /dev/fd0 and did the dd command again, it works
[ add comment ] permalink ( 3 / 74 )
Apple ical does not support ssl over http 

While testing WebDav and iCal setup, it seems iCal does not know what https is. iCal works fine with http. From macosxhints someone mentioned that iCal does not support ssl, it sucks.
Mozilla sunbird support standard .ics files and runs on Mac/Windows/Linux, so you could share your calendar cross platform on Mac OS X and Windows, Linux.
[ add comment ] permalink ( 3 / 88 )

Back Next