I miss a feature in OS X

My list of missing features in OS X is getting shorter and shorter but there is one thing I’d really like: Access controls based on which wireless network I’m connected to.
In a nutshell I want my laptop to recognize that I’m currently at home (ie. connected to the wifi in my apartment) and therefore don’t need to type in my password whenever I exit the screensaver. Yes, it’s a potential security risk but I’m lazy and I have a non-trivial password so I’d rather not type it two hundred times a day if I can avoid it.

Gmail and fortune cookie signatures

I recently gave up on a text-based MUA, partly because I couldn’t be arsed moving it when my laptop’s harddisk died on me, partly because I figured it was time to embrace webbased email interfaces. We use Google’s mailhosting for the vennemindenet.dk domain, which gives us the nice Gmail-interface. Apart from the Google braindamage that only lets me use the basic html-interface in Konqueror, I also missed my random fortune cookie signatures.
As it turns out, there’s an easy solution for that. A small script that prints an RSS feed with a single fortune cookie and the Random Signature feature from the Labs settings in Gmail. The Labs feature gives you an additional setting under your default signature where you can specify an RSS feed to pull a random message from. Neat!

Web 2.0-sy in a classy way

I’m not very web 2.0-sy.. I haven’t joined any social wobsite and while I do blag every once in a while, it’s not as frequent as all the hip people and it’s usually a lot less interesting.

Nonetheless, I’ve wanted something simple to toy with awesome 3.0 (it became 3.1 while I pondered) and the lua configuration thingie. To be honest, I preferred the old libconfuse-based config system – it was a lot easier to wrap my mind around it and it was a lot easier to debug when something went wrong. I’ve seen the various mpd widgets, volume widgets and many, many monitoring widgets but I wanted to play with something that, to the best of my knowledge, hadn’t been done before.

So I thought of making an awesome widget for Twitter. It was a stupid idea so I promptly went on with it.

The first minor snag I hit was that I’ve actually never used Twitter. That was easy to solve though. Now with moar web 2.0!

I quickly gave up on writing something to actually interface with Twitter. There are countless of scripts, language modules/libraries and whatnot for doing that and while lua seemed to lack a Twitter-library I didn’t want to try my luck at writing that since I seriously lack lua skills as well. So I used the Net::Twitter perl module and wrote a short wrapper script to do the job. All that was left then was the awesome configuration. All of the following lua-code goes somewhere in your rc.lua.

First of all, functions. It seems these has to be defined earlier in the file than where they’re called…

function updateTwits()
    local twits = {}
    local fh = io.open("/tmp/twitlist")
    if not fh then
        mytwitbox.text = 
            "<small><b>No twits present!</b> I suggest looking at the gentoo community</small>"
        return
    end
    for line in fh:lines() do
        table.insert(twits, line)
    end
    if #twits > 0 then
        mytwitbox.text = awful.util.escape(twits[math.random(1, #twits)])
    else
        mytwitbox.text = 
            "<small><b>No twits present!</b> I suggest looking at the gentoo community</smal>"
    end
end

function postTwit()
    awful.prompt.run({ prompt = "Twit: " }, mytwitbox, function (msg)
        os.execute("/home/arkanoid/bin/twit post \""..msg.."\" &")
        mytwitbox.text = "Tweet posted! Go grab a cup of coffee ;-)"
    end, function () return nil end)
end

The first function, updateTwits, grabs a random tweet from a list of tweets generated by the twit.pl script and updates the text of the twitter-widget. postTwit spawns a prompt and posts your tweet to twitter.

To actually use this we define a textbox widget and fill it.

mytwitbox = widget({ type = "textbox", align = "left" })
mytwitbox:buttons({ button({ }, 1, updateTwits),
                    button({ }, 3, postTwit) })
updateTwits()

This way a left mouse click on the textbox will fetch another tweet and a right click will give you a prompt so you can submit a new tweet.

Remember to add the widget to a wibox. In this case I added a second wibox (statusbar in pre-3.0 terminology) which is located at the bottom of the screen.

mysecondwibox = wibox({
    position = "bottom", 
    fg = beautiful.fg_normal, 
    bg = beautiful.bg_normal 
})
mysecondwibox.widgets = { mytwitbox }
mysecondwibox.screen = 1

I might as well make awesome fetch a new list of tweets from twitter as well.

awful.hooks.timer.register(60, 
    os.execute("/home/arkanoid/bin/twit friends >/tmp/twitlist &"))

The main reason for not doing this in updateTwits is that the command might take a few seconds and awesome would be frozen while it ran. So I grabbed an idea from the awesome wiki and made a second timer that ran the fetcher in the background.

Add another hook to update the twitter-widget at a reasonable interval:

awful.hooks.timer.register(20, updateTwits)

Lastly a keybinding to post a new tweet by pressing Mod4+Shift+t:

keybinding({ modkey, "Shift" }, "t", postTwit):add()

And you’re all set – one very classy awesome twitter-widget fully operational. It is in the lower left corner:
Awesome twitter widget

It’s a pity I really don’t give a damn about twitter and probably won’t use it for anything. But at least it served as an icebreaker to awesome and lua for me.

And as for awesome and lua… it seems a lot less silly now than it did five hours ago.

Santa came to town…

<rant>
First of all, merry christmas!
Second of all, yay! I got an iPod Touch for christmas which was definitely a nice surprise. I take it as a sign that I’m probably past the “just-moved-away-from-home-must-give-kitchenware”-stage. While being nice and useful and all that, it’s really hard to get wound up over a frying pan.

Anyway, I’ve been toying around with the Touch since yesterday. It turns out that I have a 2nd generation machine, which means no jailbreak for it yet (as far as I could google… feel free to correct me). Now, I’ve always steered clear of apple, not out of spite og dislike for their products but mostly because of their price level. I’ve never ever touched iTunes but I’ve spent a fair amount of time and effort to organise my collection of music and make sure I can listen to anything when I want anywhere in my apartment or in the near vicinity. A combination of MPD, icecast, picard, flac and a handful of other nice tools made that possible. So I look forward to being able to integrate the iPod into that system, once it’s jailbroken.
Being a sucker for shiny stuff, I obviously won’t leave it idle until then so I dug out a windows installation, threw iTunes on it in order to sync my music to the little beast.

What a disaster!

I am certainly not at home using windows or an apple application so maybe it’s just me being stupid. But for the life of me, getting music on the iPod wasn’t a pleasant experience.
I used winscp to copy the music (in flac format) to the windows machine but wait, iTunes can’t handle flac… away to google I went only to see that iTunes + flac apparently required me to use mac osx. Not an option! So off I went, downloading the official flac tools and converted the flac music to wav, losing the tags in the process – sigh. But lo and behold: iTunes can read wav. In that case, problem solved. I should be able to just make iTunes convert the wav-files to their stinking aac-format, retag them and the nsync them onto the iPod… but no! You cannot convert wav files apparently, only mp3 and ogg. In that case, let’s convert the wav-files to ogg and then convert them to aac from within iTunes… it only takes about 4-5 minutes per track. iTunes is currently in the process of converting the second out of god knows how many albums. I guess I’ll go to bed soon and hope it’s done when I wake up. In the long run, I’m probably better off doing the flac->ogg conversion in linux, run windows xp in a virtual machine and iTunes in there. At least until I can jailbreak it and use either Amarok or gtkpod.

So much for actually getting music onto the iPod. But during these few hours, I’ve really grown to hate iTunes. I find it slow, buggy, unintuitive, annoying and difficult to navigate efficiently – and this is compared to Amarok, which is generally considered a serious ressource hog! I ran iTunes on a pentium 4 processor, running at 3.2 GHz. The system had 1gb memory and plenty of free diskspace. The windows installation was fully up to date (service pack 3 and all that crap), there’s a decent graphics card in the machine (decent enough to play Civ 4) and correct drivers and 3d-acceleration working. So I really, really can’t understand why iTunes made me feel like I was back in the glorious days of old and obsolete hardware. Some of the slowness seemed to be caused by lockups whenever iTunes interacted with the iPod.

In conclusion: I hate iTunes.

That being said, the iPod Touch itself is really nice, responsive, intuitive and a real pleasure to play with. Getting it set up to my basic preferences was way easier than I had expected, wifi just worked and finding free (as in free beer, mostly) apps that did what I needed (radiostreams and MPD controller among other things) turned out to be easy as well.

I guess apple’s stuff shines the brightest when you combine their hardware and software.

Oh, and did I mention how constrained I felt trying to do anything at all in windows?
</rant>

It is actually doable!

See DR, it’s not impossible to give people access to your media archives in an easy way. Please get your act together and start working on something like that instead of that lame web-based player and your sucky “Bonanza”-imitation.

Since I’m forced to pay a fee to you because of my internet connection, please give me (and everybody else, not just us “opensource freaks”) content for my money’s worth.

Lolinternet

Sorry guys, this one is in danish.

Denne kommentar blev postet til et gammelt blogindlaeg hvor diskussionen har vaeret doed et lille halvt aars tid. Jeg lader kommentaren tale for sig selv:

Peter Makholm og Makvaerk, herunder hans blogging: Danske Spammere
AF EJLER OTTESEN, 7. JUNI 19:13

Han maa jo have taenkt noget over hvad han goer,
naar han systematisk bagvasker nogle faa udvalgte.
Jeg har hidtil foergaeves anmodet ham og hans gruppe
i OpenSource.dk om hvordan han og DE definerer SPAM,
SPAMMERE og netetiquette.
En hel del i hans gruppe inklusive ham selv deltog
i forsoeget paa at kuppe foreningens DKUUG’s formue
paa 12 millioner KR ud af foreningen til egne
uspecificerede formaal.
I forbindelse med forsvaret mod dette kupforsoeg
skrev jeg en artikel om dette usaedvanlige
nederdraegtige kupforsoeg og sendte den som udkast
til de formentlige to hovedmaend Peter Toft og Jacob
Sparre Andersen ligesom jeg informerede andre om
denne artikel HERUNDER Peter Makholm, da jeg havde
laest hans blog, hvor han stoettede kupforsoeget.
Folkene i OpenSource.dk, som stoettede argumenterede
generelt for, at det var bedre, at foreningen DKUUG’s formue blev brugt til OpenSource formaal.
SOM disponeret af folk i denne gruppe.
HVORFOR denne gruppe ikke har stillet tilsvarende
forslag til de virkelig store danske pengekasser understreger kun at dette kupforsoeg var saerdeles
velplanlagt og KUNNE vaere lykkedes, hvis det ikke
havde vaeret for den ihaerdige modstand organiseret
foerst og fremmest af Keld Simonsen, hvor jeg gjorde
hvad JEG kunne som menigt medlem. I sidste ende
gik flertalllet i den davaerende bestyrelse ind
i forvaret i allersidste oejeblik.
Peter Toft stillede op som repraesentant for Nokia
Danmarks og brugte deres store blok af stemmer og indflydelse i kupforsoeget.
Det kunne vaere interessant at hoere hvilken interesse
Nokia havde i at deltage i en plyndring af en fredelig dansk forening for dens formue.
MVH fra Ejler Ottesen

lol…

Where to find spare laptop parts?

Recently, my laptop started acting up. The cooling fan will make a lot of noise and vibrate like mad, making it almost impossible to use the laptop since the vibrations goes straight through to the keyboard. Even if it weren’t for the noise and vibrations, the machine will still occasionally overheat since the fan isn’t running at full speed. So obviously I need to do something about this. I’ve already disassembled the laptop and cleaned the dust out of the fan. While it was out, I noticed that the actual rotor is somewhat loose, so it’s likely that this is what jumbles around. I was unable to massage it back in some useful state and I gave it oil but to no avail. So I’m down to either replacing the laptop or replacing the fan.
The laptop is a two-and-a-half year old Zepto machine and has worked brilliantly throughout its lifetime. The battery is still good and I’m not to keen on replacing it right now since I haven’t got the money.
Therefore I’ve been searching on the web for a spare fan. I found that the fan is the same that sits in some Acer Travelmate models, so there are plenty of stores that stocks it. The cheapest one I’ve found is approximately 60$ (including shipping) which seems to be a little on the high end though. So my question is: where do you find cheap spare parts for laptops? Are there any really good online shops that anyone can recommend (or perhaps some good shops in Copenhagen)?

The fan in question is called “AB0605UX-TB3″ and I’ve uploaded some pictures of it.

god dammit youtube!!

Sooo, I got in front of my laptop this morning and headed straight for questionablecontent and xkcd (as usual), spent a good time looking at those pages wondering just wtf went on here – until I remembered the date. Props to these two, along with dinosaur comic for confusing the hell out of me for a while :-)

Besides that one, which I’ll of course blame on sleepiness, I think I managed to steer clear of most jokes today (really… many, many of them are truly unoriginal, irrelevant, boring etc).

But the one that truly takes the price this year must be Youtube’s. Links to all featured videos were replaced with this and as can be seen from the page, many people took the bait (yes, me too, more times than I want to admit). Props to youtube for knowing who they are and use their own strengths. This is what makes a good april’s fools joke. Not some random false news-story.

Gimme yer chopsticks!

Environmental preservance is all the rage at the moment. Governments, organisations and corporations all want to be known as the saviour of our precious trees and birds and bees. Here in Denmark, the Danish Railways has put up special bins for collecting newspapers on the trainstations. A good idea, since newspapers are usually littered all over the place, because of those free papers that currently fight over advertisers.
In Japan, however, the government has decided to try another approach, though it has certain similarities to the danish one. The ministry of agriculture, forestry and fisheries have decided to support local projects to gather and recycle used chopsticks – as biofuel (either ethanol or wood pellets)! Not a bad idea, seeing as the japanese people manages to use approx. 90,000 tons of these each year, according to the aforementioned article. Now we just need to do this with pretty much everything else, and then the world environment’s crisis will be solved ;-)