31 March 2010, 8:51 pm
Mostly for my recollection I’ve made a list of the DevDays presenations I attended this year. I’ve tried to add some links to e.g. homepages, blogs and twitter accounts to each speaker
Trends and future directions in programming languages
Inside Modern Javascript
Reverse Engineering, van code naar kunst
Windows Phone 7 Development
VS2010 Tips and Tricks: Part 1
Geek Night Keynote 2010 – Making the Social Connection
Giving Robots Life with the .NET Micro Framework
Microcontrollers voor .Net ontwikkelaars
Lap around .NET 4
Reactive Extensions for .NET (RX)
How we do Language Design and Microsoft: VB and C
10 January 2010, 4:09 pm
I often use to favor certain tweets in order to read the links in them at a later moment. To do so I added the RSS feed of my Twitter Favorites to NetNewsWire. Unfortunately the items in the RSS feed consist of plain text linking to the corresponding status page on Twitter.
Some time ago I used Yahoo Pipes to create a RSS feed that linkifies my Twitter Favorites RSS feed. Yesterday I made this a bit better:
- It tries to find all links by using a simple regex. I know this is a hard problem (see 1, 2, 3) but I haven’t noticed it missing a link yet
- It uses the first link found as the link on the RSS item, making it possible to directly open what the tweet is about in one click
- It adds a ★ that links to the corresponding status page on Twitter, like Daring Fireball does when he’s mostly quoting another article
- It adds links to usernames and hashtags
The only problem with the RSS feed is that it needs your Twitter User ID, not your Username, to work. This can be found by going to twitter.com while logged in and looking for the RSS feed icon. When hovering over it, you’ll see it linking to something like http://twitter.com/statuses/friends_timeline/659313.rss. In my case my User ID is 659313.
You can add the RSS feed of the Yahoo Pipe directly by adding http://pipes.yahoo.com/pipes/pipe.run?id=1fd5eef468624286c4bfbbe6192ac9c9&render=rss&user_id=659313 to your RSS reader. You’ll only need to change the User ID into your own.
I did find a Yahoo Pipe by earth2marsh that is able to use your Username instead of the User ID. It directly uses Twitters API instead of the RSS feed and a bit of YQL to construct an RSS feed of your Twitter Favorites, including avatars. Unfortunately it does not linkify the text. Perhaps I should combine both feeds someday
24 October 2009, 3:17 pm
After downloading a .crx file, Google Chrome installs the extension into a randomly generated directory in ~/Library/Application Support/Google/Chrome/Default/Extensions and registers it in its Preferences file.
To remove an extension
- Close Google Chrome
- Open
~/Library/Application Support/Google/Chrome/Default/Preferences in a text editor
- Search for the extension and write down its id
- Remove it from the settings element
- Go to
~/Library/Application Support/Google/Chrome/Default/Extensions
- Remove the directory with as name the id from above
- Start Google Chrome
For example
Lets remove an extension that provides a toolbar icon for Google Reader. In the Preferences file this is registered using the id cciomicmolmofdcijoabgmccejjbacgg
....
"extensions": {
"autoupdate": {
"last_check": "12900842060608418",
"next_check": "12900863894021384"
},
"settings": {
"cciomicmolmofdcijoabgmccejjbacgg": {
"location": 1,
"manifest": {
"background_page": "tpgr.html",
"content_scripts": [ {
"js": [ "feedLine.js", "makeRequest.js", "tpgr_cs.js" ],
"matches": [ "http://*/*", "https://*/*" ]
} ],
"description": "Google Reader on the toolbar. Extension by TPReal (tpreal@gmail.com)",
....
},
"kebibidoobkefhegbnfmlkcejmaebblf": {
....
},
....
After removing the setting for cciomicmolmofdcijoabgmccejjbacgg the Preferences file looks like this:
....
"extensions": {
"autoupdate": {
"last_check": "12900842060608418",
"next_check": "12900863894021384"
},
"settings": {
"kebibidoobkefhegbnfmlkcejmaebblf": {
....
},
....
Now simply remove the directory using rm -rf '~/Library/Application Support/Google/Chrome/Default/Extensions/cciomicmolmofdcijoabgmccejjbacgg' in the Terminal.
Edit
Hehe, going to chrome://extensions/ is a lot easier, didn’t know that
18 April 2009, 5:35 pm
In the first days of january Dreamhost ran a promotion where one could get two years of hosting for about 20 dollars on which I acted. As part of this package came a free one year .com registration. I used it to registrer www.sofinummer.com on which I intended to implement a tiny web application that can be used to generate and validate BSN/sofinummers
I have tried to keep the site as simple as possible. It shows an oversized text input field that is used for both validating and generating numbers and a message box that shows if the input field contains a correct sofinummer. After generating a number the contents of the input field are selected for easy copy/pasting.
Initially I wanted to use Ruby and learn a little about Sinatra and Haml. When I found out that deploying was quite hard I decided to rewrite it in Javascript.
The javascript has been split in two scripts. The first handles the user-interface and uses jQuery to add some event handlers and to show/hide the message boxes. The second script handles validating and generating numbers. I’ve implemented generating numbers by simply taking a random number, validating it and retrying if incorrect. In modern browsers Javascript is fast enough to make a few tries before arriving at a correct number and this has the advantage that the code is kept simple and that the numbers aren’t pulled from a skewed distribution.
I’ve used TDD and QUnit when creating the second script, and the test suite has really saved me a lot of times. To test the user-interface I’m thinking of using Selenium as I want to get some knowledge of it.
As dutch bankaccount numbers use almost the same check I’ve also registered www.banknummer.com to check bankaccount numbers that are 9 decimals large. Perhaps one day I’ll extend this to bankaccount numbers that are 10 decimals large, or to SEPA numbers
4 February 2009, 12:40 pm
At home I have a NAS that holds all my media files. Next to residing on my NAS these files are also backed up to dvd. To be able to move these files around while also changing their filenames I needed an way to fingerprint these files.
As I only needed the fingerprint to match files to each other, not to validate their contents, and as the files reside on an external disk I though that using md5sum would be too much. So I’ve created a small shell script that creates a fingerprint using only the first megabyte of a file.
The script md5sum_partial:
#!/bin/sh
FILE="$1"
MD5=`head -c 1M "$FILE" | md5sum | sed -e 's/ -//'`
echo "$MD5 $FILE"
To recursively run it on an entire directory and send the output the STDOUT run
find . -type f -print0 |xargs -0 -IF md5sum_partial F
2 February 2009, 12:12 pm
After inserting an external hard drive yesterday, my iTunes library became corrupt. It apparently saw the external hard drive as the location of my music, something for which I indeed used the drive eons ago.
After disconnecting the drive I noticed that some newly added songs would not sync to my iPhone. I reconnected the external drive, checked the location of my music (which as I later found out is only updated after relaunching iTunes) and used the _File > Library > Consolidate _ . When I noticed that it was copying all my music to instead of from the external drive I canceled the process. And so I ended up with an iTunes library that thinks that my music is split between two disks even when all the music is still available in its original location.
I’ve quit iTunes and tried to fix iTunes library. iTunes keeps its music library in the file ~/Music/iTunes/iTunes Library and also exports it the XML file ~/Music/iTunes/iTunes Music Library.xml. iTunes directly uses ~/Music/iTunes/iTunes Library and will only reconstruct it from the XML file when this file is corrupt (if it’s simply deleted iTunes will start with an empty library).
First I’ve made a backup of ~/Music as these steps might make the problem even worse.
mv ~/Music/iTunes Music Library.xml ~/Music/iTunes Music Library.xml.backup
Corrupt the database by replacing it with some data, I suggest
echo 'stupid iTunes' > ~/Music/iTunes Library
Then replace all occurrences to the external hard drive with the original location. In my case the external hard drive lives at /Volumes/Music/Music and the original location was /Users/ckuijjer/Music
perl -pe 's@Volumes/Music@Users/ckuijjer@g' ~/Music/iTunes Music Library.xml.backup > ~/Music/iTunes Music Library.xml
Start iTunes and wait for it to import the XML file
Now lets see if all my iPhone applications are still there and that it still syncs with my iPhone. Also updating Time Machine as I had it configured to skip ~/Music. Changing that to skip ~/Music/iTunes/iTunes Music, e.g. skip the music files itself, but please, please backup iTunes library.
19 October 2008, 4:43 pm
This weekend I’ve been trying to move Esther her Windows XP installation from a NTFS partition to a new, larger harddrive.
Initially I tried doing this using a Clonezilla live CD, by letting Clonezilla create an image of each partition (the Windows XP installation, the rescue partition, etc.) to an USB drive. Restoring the images to the new harddrive failed because there appeared to be some bad sectors on the old harddrive.
After this I used SystemRescueCd to manually clone the Windows XP installation:
- Create an image of the Windows XP partition (in my case the 2nd partition, /dev/sda2) using
--rescue to ignore bad sectors: ntfsclone --rescue --save-image --output sda2.img /dev/sda2 - Replace the old harddrive with the new harddrive
- Recreate the partition table on the new harddrive. Apparently Windows will not (easily) boot if the partition number or starting sector is different. As the 1st partition was only 100 MB large, and Clonezilla already recreated the partition table, I’ll restore the image to the 2nd partition.
- Restore the image:
ntfsclone --restore-image /dev/sda2 sda2.img - The bad sectors are also copied to the new harddrive, but do not exist there. Reset the bad sector list using:
ntfsinfo -i 8 /dev/sda2 and write down the "Allocated size" close to ‘$Bad’ ntfstruncate /dev/sda2 8 0x80 '$Bad' 0 ntfstruncate /dev/sda2 8 0x80 '$Bad' "Allocated size"
- Reboot into Windows and check the harddrive for bad sectors (by right-clicking on the harddrive, Settings, TODO
- Reboot into SystemRescueCd
- Resize the partition to cover the rest of the harddrive
- Start fdisk:
fdisk /dev/sda - Set the display units from cylinders to sectors:
u [enter] - Delete the partition (in my case the 2nd partition):
d [enter] 2 [enter] - Recreate the partition:
n [enter] p [enter] 2 [enter]. By default the 1st sector is the 1st sector of the deleted partition, and the last sector the last sector on the disk, so [enter] [enter] - Set the partition type to HPFS/NTFS:
t [enter] 2 [enter] 7 [enter] - Set the 2nd partition active, so that it will be booted:
a [enter] 2 [enter] - Write the partition to disk:
w [enter] and quit: q [enter]
- Resize the filesystem to fill the enlarged partition (by default the filesystem gets resized to the entire partition):
ntfsresize /dev/sda2 - Boot into Windows