January 2011
1 post
Migrated to Posterous
This site has migrated to Posterous.
April 2010
6 posts
Compiling SYSV_IPC python module with GCC on AIX...
I had a need to use good old SYSV message queues to interoperate with a bunch of old C programs, straight from python. Come in sysv_ipc module to the rescue, which works great on a variety of systems, but I need it on AIX.
Using Perzl wonderful rpm packages for AIX, I was able to compile it with GCC 4.2 and setup it into Python 2.6.
Modify common.h to unset SHM_SIZE (Obsolete step as of...
Play a MP3 file with pymad and pyaudio
Based on the wave example from pyaudio:
import pyaudio
import mad
import sys
if len(sys.argv) < 2:
print "Plays a wave file.\n\n" +\
"Usage: %s filename.wav" % sys.argv[0]
sys.exit(-1)
mf = mad.MadFile(sys.argv[1])
p = pyaudio.PyAudio()
# open stream
stream = p.open(format =
p.get_format_from_width(pyaudio.paInt32),
channels = 2,
...
Play an MP3 file with pymad and pyao
This is for Mac OS X, adapt to your needs:
import mad, ao, sys
mf = mad.MadFile(sys.argv[1])
dev = ao.AudioDevice('macosx', bits=32, rate=mf.samplerate(), channels=2)
buf = mf.read()
while buf != None:
dev.play(buf, len(buf))
buf = mf.read()
Crash on object deletion in pyao and pyogg
The author of pyogg goofed up on python object deletion in the wrapper. This was reported.
Unfortunately libao (0.82) is also affected, and there’s no action even on the previous pyogg bug. It causes a “glibc double-free” on Linux and a “pointer being freed was not allocated” on Mac OS X.
The project seems quite dead, but is merely a wrapper to the C libs where...
Uninstalling ActivePython and ActiveTCL
Little script to easily uninstall either. Take care to adapt to your needs.
#activepython
sudo rm -R /Library/Frameworks/Python.framework /Applications/Python\ 3.1 /usr/local/bin/{2to3*,py*,idle*}
#activetcl
sudo rm -R /Library/Frameworks/{Tcl,Tk}.framework /Applications/Utilities/Wish\ 8.5.app /usr/local/bin/{tclsh8.5,wish8.5} /Library/Documentation/Help/ActiveTcl-8.5
March 2010
1 post
Lovely command to obtain the processes (or rather, PID) using a socket port (here 23) on AIX:
$ netstat -Aan | egrep '\.23 ' | awk '{print $1}' | \
sed -e 's/^\(.*\)$/sockinfo \1 tcpcb/' | kdb | egrep '^pvproc' | awk '{print $4}' | sort | uniq | \
sed 's/^\(.*\)$/hcal \1/' | kdb | grep Value | awk '{print $6}'
Useful when you don’t have lsof at hand.
January 2010
3 posts
Scar tissue is stronger than regular tissue. Realize the strength, move on.
– Henry Rollins (via malty)
November 2009
3 posts
Apple should lower their prices. Not.
I am sick of hearing all around things like:
Hey, Apple hardware/software is awesome, but is too pricey! They should lower their prices and then sell millions and crush everyone! And then masses could bathe everyday in Apple goodness!
Apple cares less about market share. Apple cares about profit by relying on excellence.
It’s just like exotic cars. Of course Porsche, or Ferrari, or...
MonoRail custom scaffolded views
A long time ago, I needed (and still need) Castle MonoRail to use custom NVelocity scaffolded views instead of the embedded ones. This feature is supposed to be present, unfortunately a bug prevents it from picking filenames correctly.
I reported MR-ISSUE-537 with the text above and a patch against svn revision 5884. We’re at r6332, the patch still applies cleanly (read: it has not been...
Underrated technology
Since the advent of graphical environments, the desktop metaphor has become the core of the modern computer experience. It is the very first thing a user will experience of his computer. It is also the least spoken about, and quite underrated.
The desktop metaphor presents a number of interesting side-effects inferred from its very design, or rather non-design. Being a bunch of icons of any kind...
July 2009
1 post
Syncing Notes via IMAP
In his latest essay about note solutions, John Gruber mentioned two ways to sync:
locally, via USB (Notes) or WiFi (Things)
remotely, via HTTP (SimpleNotes)
There is a third one. I’ve seen only a single instance of it implemented, and it is implemented in Mac OS X, but not on the iPhone.
It is IMAP.
This is precisely how Notes are synced across various Macs in Apple Mail. All it...
June 2009
6 posts
Tabs in TextMate
TextMate tabs:
are ugly
look out of place
don’t scroll
don’t allow you to close files
are insanely less efficent than Command+T
at least five more quibbles
Therefore, them being essentially useless and annoying, I just turn them off:
defaults write com.macromates.textmate OakProjectWindowShowTabBarEnabled false
AppleScript with shebang
This kind of workaround is useless nowadays, as in Leopard AppleScript takes # as a comment marker. So we can write this just fine:
#!/usr/bin/osascript
do shell script "echo Hello World"
Nice.
Cartographer
Ever since the web has been browsable, web browsing has been very linear. As a consequence, there are two historical ways one can look back at its navigation path:
the time-based way, via one’s history, unrelated to windows or tabs. It is mostly used in long journeys backwards in time.
the sequence-based way, via the toolbar: next, previous and their associated list, linked to the current...
Bing logo →
Not only it is stretched, but this G just looks horribly out of place.
Compromised Design →
Interesting take on some situation I encounter A LOT. Some people just don’t seem to ever get a clue, and you just have to talk them out of crap.
Creating New Documents →
Funny, the folder solution (mixed with the Windows approach to creation) is how say, GNOME, handles templates in the first place.
May 2009
2 posts
Amazon Updates The Kindle App To Be More... →
Still not available in France. Ridiculous.
Terminus for Mac OS X →
Fantastic, non-broken Mac OS X version of that awesome fixed-width font, both functionally and aesthetically pleasant.
April 2009
4 posts
Obscured
I loved to have some blurriness in my transparent terminal consoles under Linux. This allow to have some see-through, yet not having the background be distractive. Since I moved to Leopard, I’ve been dying to find that. And I’ve found it. I do prefer a blur radius of 1.2, with full black 80% opacity background color.
Change
Tumblr is definitely great. You can change both your log URL and your account name (in fact, email address). This is simply brilliant, not technically because it’s fairly trivial, but tumblr just has that grok feeling.
Certified
If you ever happen to have to import a PEM certificate file (foo.crt) containing only a public key together with a private RSA key also in PEM format in its own file (foo.key) into MAc OS X Keychain, here’s a tip. Although you can just click on foo.crt it will just import the public key, and Keychain Access won’t handle foo.key alone. Don’t bother to convert, regenerate, whatever...
Removal
John Gruber asks:
Gall’s law raises hard questions. Where do you start? How small? How simple? Where do you draw the line between simple enough to make it work and complex enough to be interesting? That’s the magic.
Well, the answer is just so simple:
Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
—Antoine de...
March 2009
7 posts
Hunted
Since OpenOffice.org 3.0 was released, with its native Mac OS X port, I was dying to have NeoOffice removed because even in its 2.2 incarnation it was excruciatingly slow, notably when navigating styles. What’s more the 3.x branch has had many performance improvements and bug fixes in many areas, along with many features I like and use, like export to MediaWiki.
Since now however, I...
That should turn out to be a win for everyone.
– John Carmack on pacific derivative works
Easy cash
Some BBC article (again):
Despite the growth in new platforms, games still need a modicum of programming talent and the ability to engage audiences.
A modicum? Hell, I should be making millions right now then…
Boyd Multerer, a general manager at Microsoft, said: “You need some programming skill but it’s more about having a good story and an idea for what is fun.*
...
Ruled out
Consoles VS PCs… This argument never ends. Two months ago you could read how PC games were bound to a certain death due to massive amount of what people like to call “piracy”. Now you can read that they thrive up to the point of ruling supreme. Seriously. Then you wonder why I can’t believe in the slightest data in journalistic sources, unless I triple-checked it myself and...
Unrevolution
Some people just hope for the best… Thin client dreams at its best. I just wonder how the duck they would stream 1920x1080p to my HDTV through my DSL line (end point), let alone stream it for thousands of people (source point). It just does not scale.
Besides, consoles more and more become home appliances, or rather, part of the local home network of communicating appliance modules. For...
Bewildered
Lately Scribble has been updated. I don’t remember what was the update text but I’m fairly sure it didn’t mention ads. It is already painful to have a free app being updated to an ad-supported one by masquerading it behind a generic ‘bug fix’ update, but having done so in the way they did that one is just even more insane: basically a huge dialog pops up when the app...
Nailed
NIN released yet another album for free, this time in a joint effort with Jane’s Addiction and Street Sweeper. The idea is to promote their upcoming tour. This is “just” an EP, so there’s not many songs but they’re awesome, and the three groups styles make a perfect blend.
As always many high quality formats are available, DRM-free. Note that once you submitted your...
February 2009
9 posts
Convenience →
Excellent way to have Citrix Presentation Client open his .ica files, yet not have the default .dmg files mount on download.
Schizophrenic →
As always, the Mac way is so simple it just sits right under your nose and you just never ever thought of it. So multiple identities with one single account in Apple Mail is as simple as separating email addresses with commas.
Goofy →
World of Goo is a totally awesome puzzle game. Brilliant design, brilliant music, brilliant interface, and just plain, perfect 2D fun. Exactly the same pattern as Lemmings or Chu Chu Rocket. What’s more it leverages open-source power to be both cross-platform and cutting-edge. They’ll get my money ASAP.
Quidquid latine dictum sit, altum sonatur.
– The HitchHiker’s Guide to the Galaxy
Quickness →
Excellent idea. Installed ASAP, and obviously works just fine. People just can do wonders when things are engineered the right way.
Displacement
Today I had a weird bug. In a web app, I have a form which contains a generated table of children items of a given item. This table has some dynamicity in that you can add and delete rows dynamically via DOM and JavaScript, then you submit the form and Castle ActiveRecord/MonoRail does its magic. It worked well with IE and FF on my Windows work machine, but deleting a row failed in a weird way...
Disconnection
It seems I can’t access daringfireball.net. According to traceroute, it seems the last item I can contact on the path is ae-5-5.car1.Oakland1.Level3.net (4.69.134.37). DNS Stuff free tools traceroute reaches it and indicates me that the next and last step before server.daringfireball.net (4.71.165.89) is unknown.gtei.net (4.71.164.91), which I can’t reach.
I hate that. We’re...
Formatting
By the way, the below post was written with markdown. Which is just great. Seriously. I guess I’m sold on tumblr.
Future
I took a stab at ZFS on my MacBook Pro, using MacOSForge r119 read/write version, as a pkg.
As I don’t have any spare hardware to put a new filesystem on, I used a simple file. Oh I love Unix. This way:
dd if=/dev/zero of=zfs.disk bs=1m count=100
zpool create somename /Users/lloeki/Sandbox/zfs/zfs.disk
put in some file with the finder
zpool export somename
zpool import -d...
January 2009
13 posts
Breakout →
Fantastic. Now, combined with openssh socks proxy option I can work around some broken proxy in absurdly pseudo-secured environments and actually do what I’m meant to.
Enhancement →
Excellent additions to an already awesome plug-in that disappeared as soon as it appeared. I hope this one will now stay for good.
Astonishment
Someone tried to break into our flat. The guy cracked the door open, and both he and my girlfriend stood astonished before he escaped down the stairs.
Improvement →
A better tumblr dashboard widget. I don’t really care about photo posting from dashboard, but the lack of title input for the previous one was kinda disappointing.
Precognition
I don’t like this weird irrational feeling that a specific piece of hardware is gonna die on me. Lately it’s my home server’s hard disk. Hold on lil’ NSLU2.