Archive for the ‘Uncategorized’ Category

September 14, 2007

This is a test post from vimpress.

Hello world!

August 31, 2007

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!

how to use pk12util

January 19, 2007

an post that describes how to use pk12util(a utility of libnss3-tools package in Ubuntu or Debian):
http://www.mail-archive.com/mozilla-crypto@mozilla.org/msg03792.html
AFAIU, pkcs12 file will contains certificate and private key, and you can export/import the pkcs12 file certificate database created by certutil. More details, visit wikipedia.org

my experience to build nss

November 22, 2006

From here[http://gaim.sourceforge.net/faq-ssl.php#q25] I found the following instructions to build nss:

Download NSS & NSPR source from here: ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_9_2_RTM/src/nss-3.9.2.tar.gz

Extract nss-3.9.2.tar.gz

cd nss-3.9.2/mozilla/security/nss
make nss_build_all
make install

The steps are very general and simple, the problem is when I got the latest version ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_11_4_RTM/src/nss-3.11.4-with-nspr-4.6.4.tar.gz, but it did not work.
Just note down.

For details about nss, goto http://www.mozilla.org/projects/security/pki/nss/

[Linux] how to setup printer under linux

October 23, 2006

The following is the steps that make linux start to print files:
1. install cups (Common Unix Print System?)
2. use command “lpstat -h print.exoweb.net -p ” to get the status of all printers on server print.exoweb.net
3. generate a test.ps file to get with command “a2ps hello.txt -o hello.ps”
4. use command “lp -h print.exoweb.net -d LaserJet hello.ps ” to print file hello.ps.(TODO: command lpr can also print files, what’s the difference between lp and lpr? )
5. open /etc/cups/client.conf file, and put “ServerName print.exoweb.net” into this file to avoid type “-h print.exoweb.net” again and again.

NOTE: if you want to print something, then try a2ps, most of time, it works very well. For more details, run “info a2ps”.

[Debian] update-rc.d: install/remove deamon script from rcX.d folder

October 12, 2006

For more details, have a look on output of “man update-rc.d”
SEE ALSO
Debian Policy Manual,
/etc/init.d/skeleton,
init(8).

[Mac] How to create an ISO image by Mac’s Disk Utility

October 9, 2006

The following method comes from http://forums.macrumors.com/showthread.php?t=220740, it will create an iso file from a folder.

==================================================================================

Create a folder with the contents you want on your ISO.

Open Disk Utility and use the New Image from Folder(Comment: File->New->Disk image From Folder) menu item to create an image. Ensure it is uncompressed and use the CD/DVD master option.

In my experience this creates HFS+ masters which are no good in Windows.

Open the Terminal

Assuming your new image is called ~/Desktop/Master.cdr (the file is on your desktop and called Master.cdr) type:

Code:
cd ~/Desktop
hdiutil makehybrid -iso -joliet -o Master.iso Master.cdr

This will create an ISO/Joliet .iso file.

==================================================================================

[sms] how to send short message using curl by china mobile web interface

September 22, 2006

Recently, I want to send mobile message automatically through some web interface, after some investigation, I find curl is a very powerful tool. Here is the simple way I have found to do it.

1. You need to login to http://szx.bjmcc.net in firefox or other browser(yes, it is not automatically totally, but after you get the cookie, it will do it without any human help).

2. Get the cookie of the current session. There is a very useful firefox’s plugin, LiveHttpHeaders, that can record all the headers passed between browser and server.

3. Construct the url that curl uses to send message like the following:
curl -b “Webtrends=XXX.XXX.XX.XX.XXXXXXXXXXXXXXXXXX; JSESSIONID=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX” -d “operation=SelfDefined&smsSave=smsSave&maxlengths=70&destinationAddr=13611111111%2C&sourceAddrhidden=13622222222&mobilehidden=%2813622222222%29&lbl_limit=%C4%FA%D2%D1%BE%AD%CA%E4%C8%EB+26+%D7%D6%A3%AC%B7%D6%CE%AA+1+%CC%F5%B7%A2%CB%CD%2C%C3%BF%CC%F5%B6%CC%D0%C5%CA%D5%B7%D10.15%D4%AA%A1%A3&msgContent=this+is+a+test+only.+%B2%E2%CA%D4+%3A%29&delay=no&delayYear=2006&delayMonth=9&delayDay=22&delayHour=13&delayMinute=0″ ‘http://szx.bjmcc.net/szx/wsms/smswrite’ 1>/dev/null
msgContent contains the message and it need to be encoded. (I have mask the cookie and the my mobile number above, otherwise I will lose my money fast ;) ). For more information about curl, visit http://curl.haxx.se. And this article [http://curl.haxx.se/docs/httpscripting.html] is pretty good to start.
4. To keep the session active, you need to visit some page of the website from time to time.

That’s all.

[coding] Don’t ignore any condition

September 21, 2006

Recently, my team is doing group code review to improve the quality of our project. And we find a lots of places where assume that something will not happen, but the reality is the *exception* does happens. So I think we’d better not make any assumption when coding, handle the rare case reasonably, raise exception or at least log the error(so later the software will tell us what is not normal).

[amule] how to set it up

September 20, 2006

Under Debian or Ubuntu, install amule is very easy, just run:
apt-get install amule
in a shell, then it is done.

To set some servers, you need to give some servers-list url, you can put the following lines into file ~/.aMule/addresses.dat:
62.241.53.2:4242
http://www.gruk.org/server.met.gz

I have not found any good article that describes how to config amule clearly, but I find that config it by use the amule GUI version is a bit easier :)

And the coolest feature of amule is that I can control it through ssh or web! That is really convenient!

Enjoy Amuling! ;)