March 3, 2007 by Vincent Wang
in ssh manual:
-T Disable pseudo-tty allocation.
-t Force pseudo-tty allocation. This can be used to execute arbi-
trary screen-based programs on a remote machine, which can be
very useful, e.g., when implementing menu services. Multiple -t
options force tty allocation, even if ssh has no local tty.
So to ssh to nordicserver directly out of office, we can run:
$ ssh -A box -t ’ssh nordicserver’
I got this tip from http://terrencemiao.com/Webmail/msg00921.html
For more ssh details, read ssh man page.
Posted in SSH | Leave a Comment »
March 2, 2007 by Vincent Wang
Perl vs Python(or some other similiar language) is just like Vim vs Emacs, it is painful to choose which one to learn. Both are very powerful and have tons of fans. At first, I had no idea which one is suitable for my requirement. The first day I think Perl is compact and powerful; The second day, I think the codes written in Python are more readable.
After I hesitated for several days between them, I chose Python in the end. But I still had a problem that I don’t want to refuse Perl since some features of Perl is really cool: the syntax is compact, powerful and CPAN is very good. In fact, I want to use Perl to do small daily tasks, especially in terminal. Yes! Use Perl as a tool, just like sed,awk,grep, instead of programming language! A powerful and complete tool that includes complete data structure, powerful(maybe the most powerful) regular expression, many functions, lots of modules etc.
After thinking it clear, I can not feel better now!
Enjoy powerful tools!
Posted in Perl | Leave a Comment »
March 2, 2007 by Vincent Wang
“”"
/START REGEX/ .. /STOP REGEX/ and print ;
Prints all records between the first containing “START REGEX” and the first containing “STOP REGEX” (which could be the same record), and then repeats that process, looking for the next record containing “START REGEX”, etc.
/START REGEX/ … /STOP REGEX/ and print ;
Same as the two-dot form, except the first evaluation of STOP REGEX doesn’t occur until after the record that yielded True for START REGEX has already been processed, thereby preventing both patterns from mathing the same record.
“”"
for example:
$ perl -w -nle ‘/Oct 19/ … /Oct 20/ and print ‘
Above texts comes from Book <>, that is a really good book for me. It focuses on use perl to replace other legacy Unix command like grep, sed, awk etc. It describes perl one-liner in details, that is just the way which I want to use perl in.
Strongly recommended!
Posted in Perl | Leave a Comment »
March 2, 2007 by Vincent Wang
When use one-liner perl command , use single quote always.
Because when you use double quote, the commands within double quote will be expanded by shell first, most of the time, that is NOT what I want. And the worst thing is it is not easy to find out sometimes. So use singel quote always.
Posted in Perl | Leave a Comment »
March 2, 2007 by Vincent Wang
perl command s/…/…/ will return how many thing has been replaced but not the result after replacement, it is very different from what sed does.
$ echo a b c | perl -w -nle ‘print s/a/aa/’
will return 1
do it this way:
$ echo a b c | perl -w -nle ’s/a/aa and print’
aa b c
Posted in Perl | Leave a Comment »
January 19, 2007 by Vincent Wang
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
Posted in nss | Leave a Comment »
November 22, 2006 by Vincent Wang
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/
Posted in Uncategorized | Leave a Comment »
October 23, 2006 by Vincent Wang
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”.
Posted in nss | Leave a Comment »
October 12, 2006 by Vincent Wang
For more details, have a look on output of “man update-rc.d”
SEE ALSO
Debian Policy Manual,
/etc/init.d/skeleton,
init(8).
Posted in Uncategorized | Leave a Comment »