[Irssi] Irssi rocks!

March 10, 2007 by Vincent Wang

I heard irssi before, but only one week ago I start to learn it. Within this week, I am excited on the wonderful experience of irss. If you are like me: I focus on highly configurable, efficient, powerful, easy to extend. And the most important thing is it is command line based(so I can use it locally or remotely). If you are not interested on these features, then you can skip my post now(I hope not ;) ).

screenshots first:

NOTE: there are tens of screenshots at http://www.irssi.org/themefiles , if you want to see more screenshots before you decided to try it on my computer.

The main features of irssi are at http://www.irssi.org/about .

I am still learning functions of irssi, but based on what I learned till now, it is really worth you having a try!
I will post more in future!

[ssh]: How to solve "Pseudo-terminal will not be allocated…"

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.

[Perl Learning]: Consider Perl as a tool instead of a programming language

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!

[Perl Learning]: A wonderful book for perl one-liner

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

[Perl Learning]: use single quote always

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.

[Perl Learning]: pay attention to s/…/…/ trap

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

how to use pk12util

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

my experience to build nss

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/

[Linux] how to setup printer under linux

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”.

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

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).