SMS to Web

June 10, 2010 - 10:10am
I set out to find just some basic information about how text messages translate into website actions, and ended up with more information than expected. SMS is the term for short messages service, referring to a message being up to 160 characters, and being sent from a mobile phone, or (SME) to a short messages service center, (SMSC), stored, and then forwarded to another SME. A good diagram...

Filter a directory listing by characters

November 6, 2008 - 11:32am
In Bash, you can get a list of files filtered by a range or choice of characters in the filename by using character expansion. For example, to get a listing of just log files in /var/log ending in .1, .2, .3 and .4, use this command: $cd /var/log $ls -l *.[1-4] Or to just see the files ending in .1 and .4, use: $ls -l *.{1,4}

Open a directory in Mac OS X Finder from the Terminal

November 6, 2008 - 11:17am
From the Mac OS X Terminal application, you can open the Finder to any directory you wish by typing: $open <directory name here> For example, to open up the current directory in the Finder, type: $open . or the apps directory: $open /Applications

Bash Shell Quickies

October 9, 2008 - 9:50am
CTRL-C : cancel the line you are typing CTRL-D : log out CTRL-R [word] : Search command line history for a command matching [word]. Keep typing CTRL-R to cycle thru all matches. CTRL-L : clear the terminal screen

show all process information with ps

July 16, 2008 - 1:10pm
$ps axww The a option displays all process information other than your own. The x option displays process information for those with no terminal; in other words, daemons and such. The ww option tells ps to display all process information regardless of the window size. Info will be wrapped to the next line and not cut off like normal. Ps is useful for getting information about what and how...

Old Greenwich Traffic Calming

July 16, 2008 - 12:50pm
My neighbors have banded together to implement a traffic calming program on our streets. Read the about the goals and progress of our efforts on the Old Greenwich Traffic Calming site.

How to find listening tcp processes

July 10, 2008 - 9:36am
Sometimes you need to know what services are listening to what ports on your unix box. Two utilities that can get you some of this port and process information are netstat and lsof. With netstat, you can find out which services are listening under which ports: # netstat -na The n option prevents ip to hostname lookups. The a option adds to the output the sockets used by server processes. Part...

bash floating point arithmetic

May 21, 2007 - 11:09am
Bash supports arithmetic but it does not support floating point arithmetic. For example bash$ echo $((1 + 1)) 2 bash $ echo $((1 + 1.1)) -bash: 1 + 1.1: syntax error in expression (error token is ".1") Bash will treat the floating point number as a string. However, the utility bc does handle floating point arithmetic and can be called from within bash scripts. Here we call it from the command...

Delete a file whose name begins with a dash

May 16, 2007 - 4:15pm
When using a unix terminal, sometimes you make typos and end up creating files starting with a dash "-" For example, instead of typing $touch ./h-ello.txt if you ended up typing $touch ./-hello.txt this would create a file named -hello.txt Trying to delete a file with a name starting with a dash will cause an error in the bash shell: $rm -hello.txt rm: invalid option -- h Try `rm --help' for more...

Using tail and awk to view part of a logfile

May 16, 2007 - 11:05am
Logfiles can often contain information that is not immediately helpful while diagnosing a problem. For example, we may be only interested in finding what files are being currently requested via the apache log files. A typical log line would look like this: - - [16/May/2007:07:49:50 -0700] "GET /index.php?main_page=product_info&manufacturers_id=6481&products_id=107321 HTTP/1.1"...

Old Greenwich, CT 06870 - (914) 275 5520