Here is yet another way to diplay a list of IP address associated with the current computer. python -c "import socket; print '\n'.join(socket.gethostbyname_ex(socket.gethostname())[2])" The socket.gethostname() call returns the host name of the computer. The socket.gethostbyname_ex() call returns a list of three items: The host name, the list of aliases for this host, and a list […]
April 30, 2009
This year we once again went to the Skagit County Tulip Festival. However, we were in a bit of surprise: the fields are yet to bloom due to the colder-than-usual winter. Instead of driving around and watch the disappointing fields, we decided to visit the Roozengaarde and enjoyed their spectacular tulip patches. I took most […]
April 25, 2009
Problem I practically “live” on the Linux command line and one thing that has been bugging me for so long that now I decided to do something about it. On my company’s Linux systems the ls command produces color output, which makes it easy to distinguish different file types. However, the directories are dark blue […]
April 25, 2009
Problem Statement I write program in many languages and the one thing I keep forgetting is how to spell “else if”. OK, stop laughing and think about it: each language spells “else if” differently: else if, elseif, elsif, or even elif. Solution To put my mind to rest, I create this list which serves as […]
April 23, 2009
Using puts is the one of the oldest, yet effective debugging technique. For example: puts "before calling myproc" puts "myvar = $myvar" myproc myvar puts "after calling myproc" puts "myvar = $myvar" This technique is good, but it has at least two problems: To turn off debugging output, I either have to delete or comment […]
April 23, 2009
Many people who write Tcl script get confused when it comes to boolean logic, especially within if, while construct. To clear up some of these confusions, let’s take a look at the following interactive session: (tcl) 66 % # What is true? (tcl) 66 % set var -1 -1 (tcl) 67 % string is true […]
April 4, 2009
I often need to look up information to setup my mail clients such as POP3, IMAP, or SMTP servers and ports. Today, I decided to create a spreadsheet with these information which should help me and others. Feel free to edit the spreadsheet to include other services such as comcast, verizon, … Here is the […]
April 30, 2009
0