tag:blogger.com,1999:blog-74819171656240499622024-02-07T03:19:08.123+01:00w00tbl0gWout Mertenshttp://www.blogger.com/profile/05787109608088688477noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-7481917165624049962.post-67476962804596864012008-06-02T07:22:00.005+01:002008-06-02T09:22:46.539+01:00SmalltalkOk, <a href="http://discuss.joelonsoftware.com/default.asp?biz.5.594244.20">this</a> has me impressed:
<blockquote> One of our applications is an energy trading platform, parts of which have a stringent bug-fix time requirement: 15 minutes from bug report till fix or our customer gets hit with crippling fines. Those applications are deployed without sealing them, so when we get a bug report we connect to the machine and see an open debugger on the thread that failed while the rest of the application happily purs along; we modify the code and/or data in the debugger and hit the continue button, nearly always within this 15 min time frame. We then code up a permanent fix in our shop and hoist this permanent patch in the production server /while/ it is running. Again something that is mostly impossible in dead-code systems. </blockquote>
<p>
Mr. Reinout Heeck is talking about Smalltalk. Recently it has come in the news again because <a href="http://gemstone.com/">this company</a> repurposed their Smalltalk VM to run Ruby, <a href="http://www.avibryant.com/2008/06/maglev-recap.html">with great performance boosts</a>. Their VM is not entirely ready but is meant to replace most of the Ruby on Rails stack. They're calling it <a href="http://ruby.gemstone.com/">MagLev</a> (geddit? rails-maglev hee hee :)).
<p>
It sure sounds mightily impressive: an environment that automatically persists objects, has them available to many concurrent worker threads (including across hosts) with a fully transactional model and is zippy to boost... now <span style="font-style:italic;">almost</span> available for a scripting language that has its users cooing with pleasure! Throw in some of that live debugger salsa and I'm sold.
<p>
Sometimes, life is good. Cue the Louis Armstrong playlist, please.Wout Mertenshttp://www.blogger.com/profile/05787109608088688477noreply@blogger.com0tag:blogger.com,1999:blog-7481917165624049962.post-54970261461373900412008-02-08T19:56:00.001+01:002008-11-13T04:45:57.700+01:00PQI i810 2GB USB flash drive mini review<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcEjPRqgemqx_I2EOOhf4ZjhQHXzYajqwVNDnMI_t3Ba1Z0LoWgiKzTpBwZG2szlm_zqoxLWgP6xBOXfwOeJHoyJJvX1IDDtE1ZYguLAA2RoB58f-k2B5TIYfSRpHWClhKsn0brwqBYs4/s1600-h/pqii810gray.jpg"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcEjPRqgemqx_I2EOOhf4ZjhQHXzYajqwVNDnMI_t3Ba1Z0LoWgiKzTpBwZG2szlm_zqoxLWgP6xBOXfwOeJHoyJJvX1IDDtE1ZYguLAA2RoB58f-k2B5TIYfSRpHWClhKsn0brwqBYs4/s320/pqii810gray.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5169816750027918546" /></a>
I just bought a PQI i810 2GB flash drive, and I must say I'm <span style="font-weight:bold;">very</span> happy with it.
<p>
I did some benchmarks on it, and I attained 10MB/s write speeds and 30MB/s read speeds on my Mac. For something so small that I can have it in my pocket at all times, that's astounding!
<p>
It's shaped like a small square, and it can slide out the USB connector using a small switch. It feels sturdy either slid out or retracted, and it fits snugly in the USB port.
<p>
Bottom line: If you're looking for a USB flash drive that's small enough to <span style="font-style:italic;">always</span> have on you, get this one. Heartily recommended!Wout Mertenshttp://www.blogger.com/profile/05787109608088688477noreply@blogger.com1tag:blogger.com,1999:blog-7481917165624049962.post-80395851898057379212008-01-05T14:06:00.000+01:002008-01-05T14:27:42.044+01:00AirPortAtheros5424.kext and pkgutilSo I boot my Mac in verbose mode, mostly for the geekiness factor. But sometimes, you see a problem that needs fixing.
<p>
First off, to turn on verbose booting permanently, simply run "sudo nvram boot-args=-v" on the command line. <span style="font-style:italic;">nvram</span> is the interface to the OpenBoot BIOS environment of PowerPC based macs. To my surprise, this works with Intel systems as well. It's one of those little things that make Apple such a great software company.
<p>
The error that caught my attention was:
<blockquote><code>a link/load error occured for kernel extension /System/Library/Extensions/IO80211Family.kext/Contents/PlugIns/AirPortAtheros5424.kext</code></blockquote>
You can grep for this error in your <span style="font-style:italic;">/var/log/system.log</span> .
<p>
I did some searching and came up empty-handed, which is why I'm posting this. I think this is a leftover from upgrading my system from 10.4 to 10.5.
<p>
I'm pretty sure, because 10.5 now has a package database! You can actually find out which package installed a file now (provided the file was part of a package and not a drag'n'drop installer of course).
<p>
You can query this database using the command <span style="font-style:italic;">pkgutil</span>. Just typing it at the command line will give you a lengthy usage statement. The option we're interested in is <span style="font-style:italic;">--file-info</span>:
<blockquote><pre>$ pkgutil --file-info /System/Library/Extensions/IO80211Family.kext/Contents/PlugIns/AirPortAtheros.kext
volume: /
path: System/Library/Extensions/IO80211Family.kext/Contents/PlugIns/AirPortAtheros.kext
pkgid: com.apple.pkg.BaseSystem
pkg-version: 10.5.0.1.1.1192168948
install-time: 1194966975
uid: 0
gid: 0
mode: 40755
</pre></blockquote>
<p>
So we know that the <span style="font-style:italic;">AirPortAtheros.kext</span> plugin is installed by Leopard. The same search for <span style="font-style:italic;">AirPortAtheros5424.kext</span> comes up empty, however.
<p>
Therefore we can conclude that <span style="font-style:italic;">AirPortAtheros5424.kext</span> isn't owned by anything Leopard installed, and therefore I moved it away. The error is now gone and my wireless card is still functional.
<p>
I guess doing this doesn't buy you much but at least reading this taught you about the <span style="font-style:italic;">pkgutil</span> command ;-)Wout Mertenshttp://www.blogger.com/profile/05787109608088688477noreply@blogger.com0tag:blogger.com,1999:blog-7481917165624049962.post-85402353778386425632007-07-27T19:35:00.000+01:002007-07-27T19:36:20.921+01:00Happy System Administrator Appreciation DaySee subject. Give your sysadmin a hug today, or maybe not ;-)
<a href="http://www.sysadminday.com/">More info</a>Wout Mertenshttp://www.blogger.com/profile/05787109608088688477noreply@blogger.com0tag:blogger.com,1999:blog-7481917165624049962.post-46492878279284174282007-06-14T13:45:00.000+01:002007-06-14T14:24:05.729+01:00From Safari to Firefox, and back again!Well, I have to say, I <i>love</i> the new <a href="http://www.apple.com/safari">Safari 3.0 beta</a>.
<p>
I was an avid Safari user until a few months ago. I switched to <a href="http://mozilla.com">Firefox</a> for the following reasons:
<ul>
<li>Asks before closing a window with tabs
<li>Able to reopen tabs after crash (with the <a href="https://addons.mozilla.org/en-US/firefox/addon/2324">Session Manager</a> add-on, it even saves text you were typing in forms!)
<li>Allows opening a tab in a new window (but needs to refetch the page)
<li>Less annoying download status (with the <a href="https://addons.mozilla.org/en-US/firefox/addon/26">Download Statusbar</a> plugin)
<li>Absolutely kick-ass website debugger: the <a href="https://addons.mozilla.org/en-US/firefox/addon/1843">Firebug</a> add-on.
<li>Extensibility through add-ons and themes
<li>Works with slightly more websites
</ul>
So I switched, and suffered through the things that aren't so nice about Firefox, such as no real integration with OS X (Keychain, application launching etc), some graphical glitches and general clunkiness.
<p>
Consider me biased, once you're used to being given applications that Just Work and do the sensible thing 99.9% of the time, you become, shall we say, <i>sensitive</i> to less well thought-out applications. Firefox is an impressive effort, but in part due to its cross-platform requirements, it's somewhat lacking on OS X. Safari goes the extra mile for you, like slowing down Flash animations when you're not looking at them, and waiting until you look at a tab to activate animations.
<p>
And now Apple released <a href="http://www.apple.com/safari">version 3.0 beta of Safari</a>, for free, including a Windows version! Magically, Apple's engineers have seen the things I disliked about Safari 2.0 and fixed them:
<ul>
<li>Asks before closing a window with tabs
<li>Able to reopen tabs after crash (from the History menu)
<li>Allows opening a tab in a new window, you can just drag it off the bar (without refetching!)
<li>You can even move a window back to a tab bar, all with spiffy animations of course
</ul>
For extra chunkyness, they added a Web Inspector as well, which more or less shows what Firebug would show. All you need to do to see it is <a href="http://www.macosxhints.com/article.php?story=20030110063041629">enable the Safari debug menu</a> and it's right there. Firebug is still slightly more useable, and it allows you to change the page while it's loaded, but still kudos to Apple for adding it!
<p>
Safari 3.0 has those little touches you get from Apple, for example extra-visible highlighting when searching for something, or resizeable text boxes for when those forms just aren't big enough. Very nice.
<p>
Heartily recommended. <a href="http://www.apple.com/safari">Download it now.</a>Wout Mertenshttp://www.blogger.com/profile/05787109608088688477noreply@blogger.com0tag:blogger.com,1999:blog-7481917165624049962.post-34762063231947740232007-05-25T22:50:00.000+01:002007-06-11T11:00:03.737+01:00Global WarmingHere's an extremely interesting video to watch:
<blockquote><a href="http://video.google.com/videoplay?docid=4499562022478442170">The Great Global Warming Swindle</a></blockquote>
It makes a case for the following two statements:
<ol><li><em>Yes</em>, the Earth is obviously getting warmer
<li><em>No</em>, humankind doesn't have all that much to do with it
</ol>
It shows very convincing science which indicates man-made CO<subscript>2</subscript> has nothing to do with global warming. It looks like we're just in it for the ride.
<p>But, on the other hand, check out <a href="http://www.durangobill.com/Swindle_Swindle.html">this link</a> for a thorough debunking of the video.Wout Mertenshttp://www.blogger.com/profile/05787109608088688477noreply@blogger.com0tag:blogger.com,1999:blog-7481917165624049962.post-90959773807233647132007-05-21T15:14:00.005+01:002012-02-09T15:56:03.969+01:00Using bash functions under sudo<b>Update:</b> Now <a href="https://github.com/wmertens/sudo.bash">on github</a>
<p>
Have you ever done the following?
<blockquote><pre>$ type duk
duk is a function
duk ()
{
du -k "$@" | sort -n
}
$ sudo duk /tmp
sudo: duk: command not found</pre></blockquote>
<tt>duk</tt> is a function that will show you directory sizes under a given pathname (or the current directory), nicely sorted by size, largest at the bottom just above your next prompt. It's very handy, put it in your <tt>.bashrc</tt> ;-).
<tt>sudo</tt> doesn't know what to do with <tt>"duk"</tt> however, since it's not a system command.
Therefore, I wrote a function that is a front-end to <tt>sudo</tt>. It parses the command line you give it, and expands any functions or aliases that you call. For bonus points, it shows you the full command line as the shell receives it before you type your password.
Use it as follows:
<blockquote><pre>$ source sudo.bash
$ sudo duk /tmp
/opt/local/bin/sudo -- bash -x -v -c duk ()
{
du -k "$@" | sort -n
};"duk" '/tmp'
Password:</pre><em>[...]</em><pre>3648 /tmp/synergy-1.3.1/lib
6184 /tmp/synergy-1.3.1
20128 /tmp/prarora
1294048 /tmp/tmp
5304016 /tmp</pre></blockquote>
Looks like I'll need to do some cleaning up in <tt>/tmp</tt>.
Full source follows. To use it, place a <tt>source ~/.sudo.bash</tt> (for example) in your <tt>.bashrc</tt> after copying the code to your <tt>~/.sudo.bash</tt>, or copy the full code to your <tt>.bashrc</tt>.
Then, simply use sudo as you would before. This function handles all sudo arguments.
There is one extra argument, <tt>-x</tt>, which expands arguments as you, not as root. This is needed in some corner cases.
(<b>Update: New version which no longer uses sed and handles spaces in sudo options!</b>)
<div style="overflow: auto;border:solid 1px;margin:1em;padding:1em;font-size:90%"><pre># Wrap sudo to handle aliases and functions
# Wout.Mertens@gmail.com
#
# Accepts -x as well as regular sudo options: this expands variables as you not root
#
# Comments and improvements welcome
#
# Installing: source this from your .bashrc and set alias sudo=sudowrap
# You can also wrap it in a script that changes your terminal color, like so:
# function setclr() {
# local t=0
# SetTerminalStyle $1
# shift
# "$@"
# t=$?
# SetTerminalStyle default
# return $t
# }
# alias sudo="setclr sudo sudowrap"
# If SetTerminalStyle is a program that interfaces with your terminal to set its
# color.
# Note: This script only handles one layer of aliases/functions.
# If you prefer to call this function sudo, uncomment the following
# line which will make sure it can be called that
#typeset -f sudo >/dev/null && unset sudo
sudowrap ()
{
local c="" t="" parse=""
local -a opt
#parse sudo args
OPTIND=1
i=0
while getopts xVhlLvkKsHPSb:p:c:a:u: t; do
if [ "$t" = x ]; then
parse=true
else
opt[$i]="-$t"
let i++
if [ "$OPTARG" ]; then
opt[$i]="$OPTARG"
let i++
fi
fi
done
shift $(( $OPTIND - 1 ))
if [ $# -ge 1 ]; then
c="$1";
shift;
case $(type -t "$c") in
"")
echo No such command "$c"
return 127
;;
alias)
c="$(type "$c")"
# Strip "... is aliased to `...'"
c="${c#*\`}"
c="${c%\'}"
;;
function)
c="$(type "$c")"
# Strip first line
c="${c#* is a function}"
c="$c;\"$c\""
;;
*)
c="\"$c\""
;;
esac
if [ -n "$parse" ]; then
# Quote the rest once, so it gets processed by bash.
# Done this way so variables can get expanded.
while [ -n "$1" ]; do
c="$c \"$1\""
shift
done
else
# Otherwise, quote the arguments. The echo gets an extra
# space to prevent echo from parsing arguments like -n
while [ -n "$1" ]; do
t="${1//\'/\'\\\'\'}"
c="$c '$t'"
shift
done
fi
echo sudo "${opt[@]}" -- bash -xvc \""$c"\" >&2
command sudo "${opt[@]}" bash -xvc "$c"
else
echo sudo "${opt[@]}" >&2
command sudo "${opt[@]}"
fi
}
# Allow sudowrap to be used in subshells
export -f sudowrap</pre></div>Wout Mertenshttp://www.blogger.com/profile/05787109608088688477noreply@blogger.com12tag:blogger.com,1999:blog-7481917165624049962.post-29279608692003420982007-01-06T16:41:00.000+01:002008-11-13T04:45:58.273+01:00A cute desktop clock for OS X<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlK_LmiqBNAPIcZLxjSRI_nQy7nOnq8ImtbqqLQE9Ht-Vm6-ni8g45qDoIL92hgxO-wU672ks_YSUqtcPHyHSKdu4LU8EqVeGeFlK8hEiEhH6HLAB5OrUvKe_okD3eXnN8zteOmUr_WpI/s1600-h/Picture+1.png"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlK_LmiqBNAPIcZLxjSRI_nQy7nOnq8ImtbqqLQE9Ht-Vm6-ni8g45qDoIL92hgxO-wU672ks_YSUqtcPHyHSKdu4LU8EqVeGeFlK8hEiEhH6HLAB5OrUvKe_okD3eXnN8zteOmUr_WpI/s320/Picture+1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5016944567707415458" /></a>
One of the reasons I love OS X so much is that it makes it so easy to do cool things with Unix. In today's post I'll show how I made a desktop clock using GeekTool and the <tt>date</tt> command.
GeekTool is an OS X application that will render text files, images and shell command output into the desktop. <a href="http://projects.tynsoe.org/en/geektool/">Its website</a> isn't really updated a lot, but it still works, and if it doesn't, <a href="https://sourceforge.net/projects/geektool">its source is out there.</a>
I guess it got mostly superseded by the widgets of the Dashboard, but it renders into the desktop, which Dashboard won't do without some hacks. (Although that might change next week if/when Leopard comes out :-) )
I also used this great free font I found, <a href="http://www.acidfonts.com/freefonts/atomic_clock_radio.htm">Atomic Clock Radio</a>.
To set it up, I created a rounded background (using <a href="http://www.gimp.org/macintosh/">The Gimp</a> of course), and told GeekTool to put that on the right side of my screen with a pleasing opacity (in the style tab).
<center><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsjKDwiRbDNh8NLR8-5Q_roVMuA_U0ypK0tQgh44EIYxtHmPWXa2iGD4LJ61MKeEGmw2JShCcdLnhdtXfOAFNZTWehENVVLSRfcSalP0Zf0QXUbJvjWkwoDOCCa4vGHKc2-I9kX-TObuc/s1600-h/Picture+2.png"><img style="margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsjKDwiRbDNh8NLR8-5Q_roVMuA_U0ypK0tQgh44EIYxtHmPWXa2iGD4LJ61MKeEGmw2JShCcdLnhdtXfOAFNZTWehENVVLSRfcSalP0Zf0QXUbJvjWkwoDOCCa4vGHKc2-I9kX-TObuc/s200/Picture+2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5017045568158348226" /></a></center>
Then I added the output of the command <tt>date "+%H%n--%n%M"</tt>, updating every 20 seconds, in another item and told it to render with the Atomic Clock Radio font. That command renders a 24h clock with embedded newlines. The dashes looked most pleasing. Experiment, it's easy.
<center><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2XNheQ9lZWOLmlj-Inf7cU_3BRz3N0FcXaUsC2ir0zfFoyNQAoPznwyOL36ktGqeoBPi4dnXxg8S7sL2LCbVR06A7mqUXQCZhcSHFFsgG4ltpKNKlZP1yuKHzZU-QuxEDWyhGjg6EKHE/s1600-h/Picture+1.png"><img style="margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2XNheQ9lZWOLmlj-Inf7cU_3BRz3N0FcXaUsC2ir0zfFoyNQAoPznwyOL36ktGqeoBPi4dnXxg8S7sL2LCbVR06A7mqUXQCZhcSHFFsgG4ltpKNKlZP1yuKHzZU-QuxEDWyhGjg6EKHE/s200/Picture+1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5017045572453315538" /></a></center>
That's all there is to it. Simple tools with big impact, that's how I like my Unix ;-)
You can get the background image I used <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy4toVyJIbp4wgSkRVtC_PcC0V1YMddP3dQrpALZHZScysp9xcn5uWV3NY9v9cE-l6W7AdQ0l9BiTw-MPqhLJGBQImSKjJ9kv90IUmJ9eEPRjrIKsO4xH_Iv0SdHQLFGf2nRRRoteIZTw/s1600-h/GeekToolClockBackground.png">here</a>. It's rounded on all sides, so you can choose where you put <em>your</em> clock.Wout Mertenshttp://www.blogger.com/profile/05787109608088688477noreply@blogger.com0tag:blogger.com,1999:blog-7481917165624049962.post-9341708748666364932007-01-02T17:10:00.000+01:002008-11-13T04:45:58.417+01:00Control iTunes over SSH<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzu-ZKcK5NRFId8F8a8Rc36Ix5nQzupOhoSVYAnqbVbHH0NXIgyJmcMiXQBkd-ON31idY3-6Kg8E9bmV8h8KDDJNSso7v3ktJv5CrZcCWW7qW-Wvt7cfht0Gq-U8_-S49kkMYBitE5TbM/s1600-h/iTunesCLI+screenshot.png"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzu-ZKcK5NRFId8F8a8Rc36Ix5nQzupOhoSVYAnqbVbHH0NXIgyJmcMiXQBkd-ON31idY3-6Kg8E9bmV8h8KDDJNSso7v3ktJv5CrZcCWW7qW-Wvt7cfht0Gq-U8_-S49kkMYBitE5TbM/s320/iTunesCLI+screenshot.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5015375341194690194" /></a>
So I was looking for a good way to control iTunes running on my Mini mac at home.
There's some payware options, like <a href="http://www.shirt-pocket.com/netTunes/netTunesDescription.html">netTunes</a> and <a href="http://www.deadendsw.com/Products/webRemote.html">webRemote</a>, and some freeware options, like <a href="http://www.brothercake.com/site/resources/scripts/ztunes/">zTunes</a> and <a href="http://them.ws/itrc/">iTRC</a>.
I kind of prefer using open source if I can get it, so I am giving the payware options a miss for now.
Unfortunately none of the freeware options are cross-platform and secure at the same time. On top of that, most of the them are quite buggy.
So while I wait for zTunes to become faster, less buggy and more secure, I chose the third option, which is Write Your Own :-)
Thanks to the wonders of Applescript, iTunes is very accessible from other programs. You can basically get information about anything in your library and perform almost all the actions that you can perform from the program itself.
So I wrote a remote control <b>in bash</b>, to be accessed over SSH. I present to you <a href="http://users.skynet.be/unseen/iTunesCLI">iTunesCLI 1.0</a>.
To use, save this script where you can find it again on the system that you
want to use it from, for example in your home directory or in /usr/bin.
Make it executable with <b>chmod +x</b>
Then ssh to that system and run the script:
<blockquote><b>ssh -t mysystem ./iTunesCLI</b> (when stored in your home directory)</blockquote>
<blockquote><b>ssh -t mysystem iTunesCLI</b> (when stored in /usr/bin)</blockquote>
The -t option is needed to make keystrokes be recognized immediately.
SSH tips:
<ul><li>Use an SSH agent so you don't have to type your password every time.
For OS X, try for example <a href="http://www.phil.uu.nl/~xges/ssh/">SSH Keychain</a></li>
<li>The hostname for the remote machine is most likely machinename.local.
For example, my Mac Mini is hooked up to the stereo and is called
mini-me. I just run "<b>ssh -t mini-me.local iTunesCLI</b>".</li></ul>
I had to come up with some nifty tricks to make it fast and pretty. Look at the script file to see bash arrays, IFS swizzling, printf builtins, tput abuse, multiline commandlines embedded in backticks and a mangled model-view-controller concept, oh my!
I sprinkled it with comments in the hopes of making it maintainable :-)
Enjoy!Wout Mertenshttp://www.blogger.com/profile/05787109608088688477noreply@blogger.com3