elgoog.com
January 6th, 2012I find it hilarious that google has to go to the extremes of purchasing elgoog.com. I understand why, but it is either sad or funny… or maybe both…
I find it hilarious that google has to go to the extremes of purchasing elgoog.com. I understand why, but it is either sad or funny… or maybe both…
The Bash test construct “[" is different then the extended test construct "[[", which might be obvious after the fact. It is usually better to go with the newer extended test construct over the plain test construct.
Things that work with the extended test construct:
Things that don't work:
Here is an example of how "[" and "[[" differ
shrek@li118-154:~$ if [[ "a" > "b" ]] ; then echo "boo"; fi shrek@li118-154:~$ if [[ "a" < "b" ]] ; then echo "boo"; fi boo shrek@li118-154:~$ if [ "a" > "b" ] ; then echo "boo"; fi boo shrek@li118-154:~$ if [ "a" < "b" ] ; then echo "boo"; fi boo
Another example
shrek@li118-154:~$ if [[ ls && ls ]] ; then echo "hi"; fi hi shrek@li118-154:~$ if [ ls && ls ] ; then echo "hi"; fi -bash: [: missing `]'
Named pipes in linux are pretty cool. Here is an example of how to create a named pipe to send stdout to the logger shell command, which sends it to syslog.
#!/bin/bash echo "stdout going where you expect" # create the named pipe npipe=/tmp/n.pipe mknod $npipe p # fork the logger and have it listen on the named pipe logger <$npipe -t iamapipe & # link file descriptor 6 to stdout (save stdout for later) exec 6>&1 # now replace stdout with the pipe we created exec 1>$npipe echo "Now stdout is being logged to syslog" echo "1" echo "2" echo "3" echo "Done" # put stdout back in place and close fd 6 exec 1>&6 6>&- echo "stdout is back"
Here is the output that is sent to the console. Notice that the middle set of echos are not shown.
$ ./pipe.sh stdout going where you expect stdout is back
Here is the output found in the /var/log/syslog.
shrek@li118-154:~$ sudo grep iamapipe /var/log/syslog Dec 10 02:48:50 li118-154 iamapipe: Now stdout is being logged to syslog Dec 10 02:48:50 li118-154 iamapipe: 1 Dec 10 02:48:50 li118-154 iamapipe: 2 Dec 10 02:48:50 li118-154 iamapipe: 3 Dec 10 02:48:50 li118-154 iamapipe: Done
I am now the pipe master…
For development purposes, I have installed MongoDB on my laptop. Here is my launch script. It is called com.mongodb.mongod.plist and it is placed in ~/Library/LaunchAgents/. It starts up a single instance of mongod that I installed using brew.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>KeepAlive</key> <true/> <key>Label</key> <string>com.involver.mongod</string> <key>Program</key> <string>/usr/local/Cellar/mongodb/1.6.5-x86_64/bin/mongod</string> <key>RunAtLoad</key> <true/> <key>WorkingDirectory</key> <string>/usr/local/var</string> </dict> </plist>
I also added this to my .bashrc / .zshrc to easily start and stop mongod.
alias mongodb_start="launchctl load ~/Library/LaunchAgents/com.mongodb.mongod.plist" alias mongodb_stop="launchctl unload ~/Library/LaunchAgents/com.mongodb.mongod.plist"
My new Canon EOS D60 came in the mail yesterday. I am happy with it so far. Here are some of the quick pictures I took around the house.
![]() |
| Random Pictures from 12/5/2011 |
I presented at JavaOne 2011, and it was a interesting experience. It was my first time in San Francisco, and my first time presenting at a conference. I thought it went ok, and the two people that gave me reviews that averaged out to a 4 out of 5. Next time I will be more prepared for what to expect.
Here is the slideshare for the presentation:
So, sometimes I receive random E-Mails from people looking for somebody else with my name. Yesterday, I received an E-Mail from an unnamed major realtor in Australia. They sent me a bunch of documents to sign and send back. This is a little bit funny because I do not live in Australia, do not have any dealings in Australia, and never been to Australia. It was time for a bit of fun.
Here is the original E-Mail:
Finally, here is the realtor’s response:
Wait…What…I am confused… Is it such a normal thing to slaughter goats in your apartment in Australia?
Note: I do not slaughter animals.
Hello world!