August 28, 2011 2

My Pegboard+Standing Desk Installation

By in Switzerland (Danish), Work at JBoss

I’ve been thinking about getting a height adjustable table for my home office for months, possibly even years, but never got around doing it because of either price or just not being motivated enough to do it.

I recently noticed that IKEA sells an electric frame for my IKEA Galant table that doesn’t cost a fortune anymore. It might be it’s always had that price but my starting knee/back pain and realization that I won’t get a new body by magic made me think 499 CHF was a sweat deal for a healthier working life. That made me go ahead and get an adjustable desk plus use the pegboard solution to handle all the devices and wires I need to have mounted near my desk.

IMG_9603.JPG

Since I got inspired by others writing about similar changes to their office I thought I would add my story to the mix too hoping that can encourage others to try it out.

Getting the materials

The full list of materials I used were:

1 IKEA Galant electric raisable legs frame (bought in a Danish IKEA, Swiss IKEA only have the square version)

2 pcs. of custom-cut pegboards to fit into the frame of the Galant desk

6 shackle “rings” from a padlock shackle (bought in Landi, similar to this from Amazon)

6 small round wooden dowels

Many tens of long and small cable ties

Getting the two main parts turned out to be a bit more difficult than anticipated. Firstly, I learned that not all IKEA’s are created equally. In Denmark you can buy the adjustable frame for both the square and the corner version of Galant, but in Switzerland you can only buy the square version even though they do sell the corner desk.

Luckily my parents were about to embark on their annual vacation to Switzerland and I convinced my father to go to their “local” IKEA and pickup the corner version of the frame.

Beyond having to get my parents to bring the corner frame from Denmark another tricky part of this setup was that pegboards weren’t easy to come by in my area. None of the common places like Jumbo, Landi or Coop had it thus I ended up having to custom order a full-sized 2.5 x 2.5 m pegboard from HGC for ~40 CHF.

But don’t let that discourage you – I live in a “rural” area :) , btw. an alternative to the IKEA Galant frame is the desks from GeekDesk which even ships internationally – it’s more expensive but at least it exists as an option.

Construction

Note, if you click on the images below they will link to a more detailed image with notes on the various parts if you are interested in the details of what is shown on the pictures.

Assembly of the frame for the Galant is pretty straight forward, just removed the old and added in the new.Installing the pegboard and configuring it was a bit more work.

First, add the shackles on which to install the pegboard.

IMG_9587.JPG

Secondly, drill hole in pegboard and check if it can be easily installed.

IMG_9588.JPG

As a last minute thing I decided to mount a leftover Phillips MX 5100 Home Audio System directly on the frame just by adding a bunch of cable ties together and tighten them well.

.IMG_9591.JPG

Once that was all up it was time to start configuring the pegboards with my “Stuff”.

11252025201.jpg

This is really where this setup shines, because it is using the shackle+dowel I could easily try out some options before installing and if in the future I need to change something I can easily reconfigure it.

Here is the best shots I could get of the final pegboard configuration mounted on the desk (click on the image to see details):

IMG_9602.JPG

This photo shows how “flat” the setup is and everything is out of your way – none of what you see there bumps into my knee(s) neither when I stand or sit at the table.

IMG_9606.JPG

And here is the final result “lowered” to the sitting position:

IMG_9598.JPG

And finally, my long awaited end result, my standing desk with (almost) no wires visible:

IMG_9603.JPG

I’ve also uploaded a flickr set for this with some more details about the photo’s.

Hope you like it and it shows that it’s not that hard to do – Now I just need to start getting my back and legs used to standing up, I hear that is rather painful the first couple of days/weeks.

December 13, 2010 0

How to Geek-Pimp your Christmas Party

By in Work at JBoss

Lisbeth and I normally try to throw a Danish Christmas party every
year and this time was no exception; and I even got to have some fun
geek-pimping the event.

This time around I had setup my 52″ TV to have a slide show of gorgeous
Christmas style pictures mixed in with photos taken during the party
transferred wireless via an Eye-Fi card and had it synced across two
laptops via Dropbox and to top it all off I were taking a picture
every 15-seconds to be able to do a “high-speed” playback of the whole
event to the tunes of the “Benny Hill” theme song.

Below I’ll outline the things I did to make it all happen.

What I used in the process:

* 52″ Sony LCD TV
* Mac Mini
* Eye-Fi X2 Pro
* OSX built-in screensaver (since no other app out there does it right)
* Hazel w/Apple Script
* Macbook Pro
* Gawker
* Some hours of searching for initial images

“Live” screenshow:

The setup is simple.

First you configure your Eye-fi card to place the photos in a specfic directory, i.e. "/Users/max/Pictures/incoming".

Secondly you configure Hazel to on any change to that directory to move the file to the location you want the screensaver to pick up the files, i.e. I used "/Users/max/Dropbox/screensaver" which is in my Dropbox so I could easily sync to another machine when needed. Then add an Apple script action to Hazel that contains the following code:

tell application id "com.apple.ScreenSaver.Engine" to quit
tell application "ScreenSaverEngine" to activate

Those two lines are needed to have the Screen Saver restart to make it pickup any new photos coming in.

Finally, you need to enable and configure the Screen Saver to pick up the pictures from the "screensaver" directory. Beyond that I believe I used the default transition settings since they give a very smooth but still somewhat dynamic experience.

With those things in place every time I took a picture with my camera containing the Eye-Fi card it would automatically upload the photos, restart the screen saver and eventually the photo taken would show up.

I would say it is important to pre-load your screen saver folder with some beautiful images (search for 1080p desktop backgrounds will give you a good start); otherwise the same, possibly ugly and boring photos taken in the beginning of the evening will be shown again and again. It’s better to have it spread out with something beautiful in the middle.

And for those who are curious, the reason for the Hazel/script instead of i.e. a scrip that reloads the screensaver every 5 minutes is to avoid to constantly see the Screen Saver stop and then start again. With this solution you only get a reload when it is actually need. You could probably do this without Hazel and just use Folder Actions but Hazel is just simpler to setup.

Screensaver Synced to another screen

Having the screensaver synched to another screen I did because our party is “spread” over two rooms. It was remarkably simple to do since I already configured Hazel to move the files to Dropbox and therefore the only thing I had to do on the second machine was to setup a Hazel script or if you wish Folder Action to run the same script as shown above.

Then when Dropbox syncs over a new file the screen saver is automatically updated.

Recording the Party for later playback

For this I used Gawker which is a free opensource piece of software which only functionallity is to grab images from a source such as your webcam.
Thus I simply configured Gawker to take a picture every 15 seconds with the built-in iSight of the Macbook pro and it automatically creates the video stream.

Before publishing the result I used iMovie to spice it up with some background music and cut out some boring segments to make it a bit more lively and the result is as seen above.

I had great fun setting this up, having a party and then edit the result and now you can too :)

August 27, 2010 1

Dial numbers (incl. conference bridges) with Skype via Launch Bar, Quick Silver or others

By in Work at JBoss

I’ve been pretty happy with my previous Service Apple script to dial a specific conference call bridge, but as I started having to use more it got too annoying to add a script per specific numbers.

Now I’ve updated the script to be able to use directly from LaunchBar (or other launchers) as the dial action for contact book entries.

on dial_skype(num)
  set connect_wait to 10 (* seconds to wait before sending additional tones *)
  set dtmf_wait to 0.2 (* seconds to wait between sending DTMF tones *)
  set pause_char to "," (* character used to indicate a pause *)
  set pause_wait to 2 (* seconds to wait for a pause *)

  if num starts with "tel:" then
    set num to (text ((count "tel:") + 1) thru -1 of num)
  end if

  (* remove any spaces in the number otherwise Skype won't make the call *)
  set num to replace_string(num, " ", "")
  (* replace %23 with # since launchBar seem to force encoding of numbers *)
  set num to replace_string(num, "%23", "#")
  set parts to split(num, pause_char)
  set parts_count to count parts
  set phone_number to item 1 of parts
  if (parts_count > 1) then
    set dtmf_parts to items 2 through -1 of parts
  else
    set dtmf_parts to {}
  end if

  tell application "Skype"
    set active_call to send command "CALL " & phone_number script name "s2"
    set skype_call_id to word 2 of active_call
    delay connect_wait
    set bridge to "ALTER CALL " & skype_call_id & " DTMF "
    repeat with dtmf in the items of dtmf_parts
      repeat with tone in the characters of dtmf
        send command bridge & " " & tone script name "s2"
        delay dtmf_wait
      end repeat
      delay pause_wait
    end repeat
  end tell
end dial_skype

on split(str, sep)
  set {tid, AppleScript's text item delimiters} to {AppleScript's text item delimiters, sep}
  set AppleScript's text item delimiters to sep
  set parts to text items of str
  set AppleScript's text item delimiters to tid
  return parts
end split

on replace_string(str, fr, t)
  set {tid, AppleScript's text item delimiters} to {AppleScript's text item delimiters, fr}
  set temp to text items of str
  set AppleScript's text item delimiters to t
  set str to temp as text
  set AppleScript's text item delimiters to tid
  return str
end replace_string

(* for LaunchBar *)
on handle_string(s)
  my dial_skype(s)
  open location "x-launchbar:hide"
end handle_string

(* comment out for QuickSilver *)
(*
using terms from application "QuickSilver"
  on process text qsText
    my dial_skype(qsText)
  end process text
end
*)

Instructions for usage with LaunchBar

  1. Copy the above script and save it with Apple Script Editor in your favorite script location (I use DropBox to share scripts such as this between machines)
  2. Goto LaunchBar Action Preferences
  3. Set “Phone Numbers” action to the file you saved in Step 1.
  4. Use Launch Bar to find a contact’s phone number and press Enter.
  5. Skype should now start and dial the number.

You can also simply add the above script to a directory that your LaunchBar scans for scripts and use it via “Tab” on items; allowing you to use it on everything not just Address Book phone numbers.

Instructions for usage with QuickSilver

To use the script as an action for QuickSilver simply remove the comments from the lower block mentioning QuickSilver. How to configure QuickSilver to pick up the script is left as an exercise for the readers who have QuickSilver installed.

Instructions for Other Launch mechanisms

My previous blog shows how to embed a script like this into a Service menu entry, and if you use another launcher you just need to read their docs for how they want the script formed and apply it similar to what is done above for Launch Bar and QuickSilver.

Last Minute Comments about Phone Numbers

The script assumes the following about phone numbers:

  1. has to be in international format (i.e. +<number>) as otherwise Skype will not dial it.
  2. spaces are ok, but they are stripped out automatically otherwise Skype will not dial it.
  3. ‘,’ is used as a pause character and as the start of DTMF tones. Thus “+123456789,1234#” will dial +123456789, wait 10 seconds for connection and then send 1234# as individual DTMF tones with a small pause in between. Additional commas will give a 2 sec delay. You can see and change the values for all these pauses in the top of script.
  4. due to LaunchBar escaping ‘#’ with ‘%23′ the script replaces ‘%23′ in your number with ‘#’; this should not be a problem since ‘%’ is not a valid DTMF tone AFAIK.

Hope you will enjoy it as much as me, it saved me a ton of time and frustration when it comes to conference call dialing :)

Leave a comment if it works for you!

July 31, 2010 0

Converting thousands of WMA files to MP3

By in Java

I’ve been using a Mac Mini for a while now to run my media center
but recently I discovered that I actually had more than 8.000 songs in WMA
format that iTunes silently ignores when importing.

This blog is about how I managed to get that converted without too much fuzz.

UI Conversion tools

There are many various conversion tools out there for OS X, Switch being one of the better ones but it does not seem to handle massive conversions very well. The Windows version has a command line interface that could be used but its just too much hassle.

If you got small set of files to convert then Switch works fine.
Be aware that the latest Flip4Mac might cause problems for Switch, I had to use an older version (2.2.2.3) to make it work.

Because Switch and all other UI’s I tried for OS X did not work well for large scale conversions I decided to find a way to do it via a command line. This allows me to easily control it and in case something fails restarting it from where it stopped is much easier than any UI tool.

Converting (non-DRM) files via command line on OS X (excl. Tags)

Note: The following converts the files fine, but tags are not maintained! Just be aware of this limitation! Using LameXP described below seem to copy tags better, but that requires a Windows installation.

For command line conversion under OS X you need Lame+MPlayer installed; I got mine installed by
simply using MacPorts:

sudo port install mplayer

You might need to also install Flip4Mac in case there isn’t another WMA decoder available.

After installing mplayer, create this shell script which convert a single file, name it
convert.sh:

if (test -e "`dirname "$1"`"/"`basename "$1" .wma`.mp3"); then
 #echo mp3 $1 already exists
 test true
 else
 mplayer -vo null -vc dummy -af resample=44100 -ao pcm:waveheader "$1" && lame -m j -h --vbr-new -b 160 audiodump.wav -o "`dirname "$1"`"/"`basename "$1" .wma`.mp3"
 rm -f audiodump.wav
 fi

This script checks if a wma file given as input has a matching mp3 file in the same directory and if it has not it uses mplayer + lame to perform a direct conversion to mp3.

With the convert.sh script in place you can use the following command to convert all .wma files that does
not have a matching .mp3:

find . -name "*.wma" -print0 | xargs -0 -n 1 -L 1 -I {} ./convert.sh "{}"

The -print0 and additional arguments to xargs is what ensures filenames with spaces, weird quotes or non-latin characters gets properly quoted.

Then you should see console output for all the conversions and get all your files converted nicely. It took my laptop about 24 hours to churn through my non-DRM WMA files.

In case you bump into a file that cannot be converted then check if the file is actually valid and can play somewhere else (i.e. on a Windows machine or with iTunes with right encodings installed) – if it can play, but Lame will not then it is mostly likely because it is a DRM protected WMA. I had about 2.500 of those (yeah, I forgot to disable DRM when converting parts of my CD collection ;(.

Conversion of DRM protected WMA files (incl. Tags)

There exists many weird applications which doc’s state they can “break” the DRM encoding by letting iTunes play them and then record the digital output stream to write them to a virtual ISO image for then to convert them to mp3.

I tried many and most of them simply did not work out of the box or required massive tweaking to actually work but then the conversion took ages plus it was not very fault tolerent.

Therefore I decided to simply startup my Windows 7 virtual machine, Install LameXP and simply let it do all the work.

Again, I had many DRM files that needed conversion (2.500+) and adding them manually would take forever. Once again a little script made it much easier.

Create a file named check.sh with the following content:

if (test -e "`dirname "$1"`"/"`basename "$1" .wma`.mp3"); then
 #echo mp3 $1 already exists
 test true
 else
 echo $1
fi

Then use this script with the following one-liner:

find . -name "*.wma" -print0 | xargs -0 -n 1 -L 1 -I {} ./check.sh "{}" > needconversion.m3

Running this finds all files matching *.wma, passes them to xargs
in a way so there won’t be problems with quotes, spaces, etc. and then
for every single found file calls the check.sh script and writes
the result to the file “needconversion.m3u”.

All there is left then is to Add the “needconversion.m3u” to LameXP
and when it has spent a few minutes on importing it press the Encode
button and let it do its business. On my laptop it takes about 10 sec. per file, thus 2.500 files takes about 7 hrs.

Be aware that LameXP as many other conversion UI’s does not seem to cope well when you have many thousands files to convert, but it did though a good job with my 2.500 files at once. If someone know a good way to do similar conversion but via command line on windows I would love to hear.

Fixing Tags

To fix broken tags i’m experimenting with using Jaikoz which is a for pay Java app that uses MusicBrainz to match songs by acustic fingerprints. For now it looks to doing a great job of matching up the songs, but if someone knows how to copy tags from 6.000 WMA to their matching mp3 let me know :)

July 11, 2010 3

Calling conference bridge numbers with Skype

By in Work at JBoss

I like Skype, but one of the features it has always lacked is a way to directly call into conference call bridges.

With a little help from AppleScript I finally managed to make that happen:

on run {input, parameters}

 set phone_number to "+1......"
 set dtmf to "1234567894#,*1234#" 

 tell application "Skype"
 set active_call to send command "CALL " & phone_number script name ""
 set skype_call_id to word 2 of active_call
 delay 10
 set bridge to "ALTER CALL " & skype_call_id & " DTMF "
 repeat with tone in the characters of dtmf
 if tone contains "," then
 delay 2
 else
 send command bridge & " " & tone script name "s2"
 delay 0.2
 end if
 end repeat
 end tell
end run

Copy and edit the above, remember to set the phone_number and dtmf variables.

Note: the dtmf variable treat’s “,” as a 2 second pause to use for conf call bridges that are a bit slow :)

Save it as a Service and you can now directly call your conference line directly from any app via the Service menu.

Tags: ,

January 30, 2010 3

Migrating from Serendipity (s9y) to WordPress

By in Java

I migrated this blog from from Serendipity (s9y) to WordPress.

It turned out to be pretty simple to import s9y posts to WordPress with the s9y importer, but making sure the old links to posts and feeds turned out to be a bit trickier.

I found a blog post that outlined how to use .htaccess to solve some of these problems, but it included manually having to figure out which id’s that had become skewed during the import process. Luckily the SQL schema of both s9y and WordPress is pretty similar and easy to do queries against to generate matching .htaccess lines.

The following SQL queries is what I used to create a working .htaccess file for my migration, use at your own risk ;)

SQL for posts:

SELECT CONCAT( "RewriteRule ^archives/", s9.id,
"\-.*.html$ /index.php?p=", wp.id, " [L,R=301]" )
FROM `serendipity_entries` s9, wp_posts wp
WHERE wp.id != s9.id
AND wp.post_parent=0
AND s9.title = wp.post_title
ORDER BY s9.id

SQL for category feeds:

SELECT concat("RewriteRule ^feeds/categories/", s9y.categoryid,
 "\-.*.rss$ /index.php?cat=", wp.term_id, "&feed=rss2 [L,R=301]")
FROM `wp_terms` as wp, serendipity_category as s9y
where name = category_name

SQL for category:

SELECT CONCAT( "RewriteRule ^categories/", s9y.categoryid,
 "\-.*$ /index.php?cat=", wp.term_id, "[L,R=301]" )
FROM `wp_terms` AS wp, serendipity_category AS s9y
WHERE name = category_name

Once you have the output from these insert them into the following .htaccess file:

RewriteEngine On
RewriteBase /

## skewed articles
[Insert output for Posts]

## categories
[Insert output for Categories]

## category feeds
[Insert output for Categories feeds]

## handle defaults
RewriteRule ^archives/([0-9]+)\-.*.html$ /index.php?p=$1 [L,R=301]
RewriteRule ^archives/([0-9]{4,4})/([0-9]{2,2}).*.html$ /index.php?m=$1$2 [L,R=301]
RewriteRule ^archive$ / [L,R=301]
RewriteRule ^feeds/index.rss2$ /index.php?feed=rss2 [L,R=301]
RewriteRule ^feeds/index.rss1$ /index.php?feed=rss [L,R=301]
RewriteRule ^feeds/index.rss$ /index.php?feed=rss [L,R=301]
RewriteRule ^feeds/index.atom$ /index.php?feed=atom [L,R=301]
RewriteRule ^plugin/tag/(.*)$ /index.php?tag=$1 [L,R=301]
RewriteRule ^categories/(2)\-.*$ /index.php?cat=3 [L,R=301]

With that in place in the root of your WordPress installation those using your old s9y links should now be redirected automatically to the matching WordPress posts/feeds/categories.

Another useful post I found were about how to move WordPress between domains, which I needed because I intially installed it on wordpress.xam.dk but needed it to end up on blog.xam.dk and apparently WordPress thinks it is a good idea to stored absolute url’s in its settings.

Now if I could just find a WordPress theme that were both beautiful, simply and functional…still searching..

May 24, 2008 1

Rant about international airports, especially Geneva

By in Work at JBoss

The last 3-4 years I’ve been travelling alot to and from Switzerland and especially Geneva Airport.

I normally always take a trolley for my suitcase and carry on luggage since I realized that it makes my long flights much smoother not having strained my back or feet with moving around bulky and semi-heavy luggage (and no, four-wheeled luggage does not help since I still have to carry my carry on bag).

But lately Geneva did the most annoying thing. They started requiring you to put 2 CHF in to get a trolley.

I understand the reasoning about it since the airport probably feel that it is cheaper to let their customers put back their trolley instead of paying personel to pick them up.

But seriously, how many international passengers arriving in the airport will have an actual swiss franc coin in their pocket ? Bill notes maybe, but not coins! And even you have a coin you can’t get it back when you reach the “No trolleys allowed signs” since Geneva airport never bothered putting up trolley stations inside the airport where you can get your 2 CHF back!

End result: Tired international passengers will have to carry their luggage since they don’t have the coins, and local swiss passengers that have the 2 CHF will still leave the trolleys left and right since there are no sane place to get the 2 CHF back again….I guess those 2 CHF is now a tip for the personel Geneva airport couldn’t let go since there is still work for them to move the left over trolleys back to their origin.

Rant over – now ill continue wait for my flight ;)

January 16, 2008 6

This category is moving to in.relation.to

By in JBoss Tools and devstudio

In the future i’ll put my blogs about JBoss Tools/Developer Studio and related at in.relation.to.

First entry is already there, an updated version of “Making Eclipse look good under Linux”, see it here.

November 29, 2007 0

JBoss Tools & Developer Studio at JavaPolis

By in JBoss Tools and devstudio

JavaPolis is getting near and this year I’ll finally have time to go to it – yay!

If you want to hear about JBoss Tools and Developer Studio (or just meet up and try out the belgium beer) then come meet me in the JBoss/Red Hat booth or catch me listening in on some of the presentations that are related to the tooling:

Seam In Action with Pete Muir et.al.

Intro to Richfaces and JBoss JSFUnit with Stan Silvert.

See you there.

November 15, 2007 3

Jing – the best tool for reporting bugs for any UI!

By in Java

Jing is a tool for grabbing screenshots and screencasts on Windows and Mac.

That does not sound so new and exiting until you actually try and use Jing.

They made it so easy to do the screenshot and screencasts that everybody can do it without spending any more time than it takes to actually do the act you want to record.

Furthermore they provide a one-click sharing facility so the only thing you have to do is to paste the automatic generated url into your favorite products issue tracker to be able to let everyone see what the bug is about.

Jinq does not have many editing facilities so you can’t fix any stupid mistakes you did for e.g. a demonstration (I currently use Wink for that), but for quick’n'dirty grabbing a screenshot or recording a screencast nothing gets close to the ease and use of Jing!

I’m definitly going to recommend it to anyone that want to easily show a bug (or a cool thing) in JBoss Tools or JBoss Developer Studio.

Update: I realized I had written jinq instead of jing. That is now fixed ;)

canl sohbet hatt telefonda sex telefonda seks sex erotik sohbet hatt sex sex sex siki porno porno porno porno izle