Archive for the ‘Scripting/Programming’ Category

bash file descriptors, pipes and … lockf.

Monday, June 14th, 2010

Bash and long-standing file descriptors is a pain, to put it politely. For example, I’d like to spawn a sub-process into which I can “write” stuff at arbitrary points in time by doing echo fneh >&4 … sounds simple enough right? But how to spawn that sub process?

bash, lockf and flock

Sunday, June 13th, 2010

So after having had enough I decided it’s time to make torpage integrate better into the portage locking. The current state isn’t bad, it’s just not complete. The fact of the matter is that it is possible should torpage initiate the fetch that portage will (permitting it attempts to fetch the same file) ignore the fact that torpage is busy downloading the file and kick off a dual download. What’s happening is that torpage (currently) treats the mere existence of the file as a lock, whereas portage takes out a fcntl (lockf) based lock on the file. Using the existince/lack of existence of files as the basis for a lock is a bad idea anyway, so I decided it’s time I took what I learned in the last six years and fix it. (more…)

Is asterisk ready for a fork?

Wednesday, January 27th, 2010

It is with a heavy heart that I start writing this entry. I’ve always enjoyed working with asterisk after overcoming an initial (unfounded) fear of it, in part due to the words from a relatively brilliant ex-coleage of mine from my days working at Techteam (CS dept at the University of Pretoria). It’s a mind-bending experience, to say the least, fun and requires a decent amount of intuition. However, recently I’ve been realizing that the current state of affairs is oh so very far from ideal. (more…)

RadeonHD … and some dual-head trickery

Friday, January 22nd, 2010

So for a year now I’ve been using ati-drivers (fireglrx, ccc, catalyst, watever you want to call that garbage) and wishing every other day that I didn’t have (some versions simply doesn’t work, older versions won’t compile with newer kernels – which I sometimes need for other bugfixes wrt wireless and possibly due to external requirements – asterisk’s dahdi driver comes to mind). So finally during the week when the proverbial shit once more hit the fan where I wanted to upgrade my kernel to 2.6.32 for some intel wireless fixes and the newest ati-drivers simply exploded in my face and the version just down didn’t want to work … I decided it’s time. Time to try the OSS drivers that didn’t want to work slightly over a year back again. And this time the story is quite different … (more…)