Mar
27
2007
4

Colorful grep

grep is a useful little *nix command line utility that makes it easy to search for strings in files. The real beauty comes when you start using it with pipes. One thing that kind of bothered me since I started using it, that it didn’t highlight the string you where searching for in it’s output.
Turns out, this can be accomplished very easily (should really just have reade the man page ;) ).

Put the following in your shell startup script (/home/flo/.bashrc in my case)
export GREP_OPTIONS='--color=auto'
Now that was simple wasn’t it (though you’ll have to re-log in to make it work or at least spawn another shell process, so the startup file gets sourced) :)

But now if you followed my tip and started using pipes like mad, after applying this tip, you’ll quickly encounter that the colors are gone again. To hand over colors to say the often used less program you have to make an alias that hands grep the –color=always option (don’t put this in GREP_OPTIONS it tends to break things!) and call less with the -R option.
Or simpler, just add the following to your shell startup script:
export LESS=-R
alias cgrep='grep --color=always'

Written by Florian Beer in: linux
rel-tag , , , , , ,

Mar
27
2007
0

Back from London

[fa:p:p=3,id=435544984,j=l,s=t,l=p] Hi I’m back from London now. Had three absolutely superb days there. On the first day Olli & me had our fair share of beers in the typical inner city pubs and went out to Canary Warf in the evening with Maria & Sinead (yep, no sightseeing at all ;) ).

[fa:p:p=3,id=435548894,j=r,s=t,l=p] Second day saw us getting up very late and then heading out to Campten Town markets. This thing absolutely rockz! I could spend a whole week there, shopping, looking and eating :)
[fa:p:p=3,id=435555561,j=l,s=t,l=p] Sadly we didn’t really have much time because we had to get back to the London east end to prepare the flat for Maria’s rockstar party.
Finally a party with decent music all night long. Find some more pics in my gallery!
It was awesome :)

Written by Florian Beer in: private
rel-tag , , ,

Mar
22
2007
0

One sunny day in Graz

Written by Florian Beer in: moblog
rel-tag

Mar
19
2007
0

Justin.tv - 24/7 live streaming to the net

justin.tv

This is really sick!
Justin is a guy from SF who decided to launch a site where he is streaming live video to the net 24/7.

I started Justin.tv because I thought it would awesome for people to see what it was like to be Justin.

…hmm, whatever!
Movies becoming reality and reality becoming a movie.

Right now it’s running for 22h, let’s see how long he can keep up ;)

Written by Florian Beer in: web
rel-tag , , ,

Mar
19
2007
2

Speechless

Hours of fun :D

Speechless

[via pfig]

Written by Florian Beer in: web
rel-tag , , ,

Mar
17
2007
6

Automatic coverart wallpaper with last.fm

The following post outlines how I managed to get a wallpaper compiled out of my top 50 artists at last.fm that changes automatically every hour. To achieve that I used the last.fm cover art website, Automator and the Unix utility cron.

  1. Open Automator and start a new workflow. First thing we have to make sure is that the old wallpaper gets deleted. You wouldn’t want your harddisk fill up with wallpapers. So drag the “Find Finder Items” action from the Finder Library to the workflow and set it up as showed in the picture. (Wallpaper is a folder in my Pictures folder that holds all of my background images.)
    Find Finder Items
  2. Choose the “Move to Trash” Action from the Finder Library and drag it under the previous Action.
  3. Next we have to get the desired wallpaper from the previously mentioned page. First go there and set up the wallpaper just as you like it. Make sure the “Randomise” checkbox is checked, otherwise it wouldn’t make much sense to reload the image every hour, would it? ;)
    When you’re done setting up your image click on “Image Me” and wait for the picture to appear, then copy the address from the address bar of your browser.
    Back in Automator choose the Safari Library and drag the “Get specified URLs” Action to the workflow. Paste the just copied address into the “Address” field in the Action. (Or if you did this with Safari and got the page still open, just click the “Current Safari Page” button)
    Get Specified URLs
  4. To save the image in the right folder we need the “Download URLs” Action from the Safari Library and specify the folder we chose previously in the delete step.
    Download URLS
  5. In the following two steps of the workflow the file is renamed with date and seconds till midnight, so it has a different filename each time it gets downloaded. Otherwise OS X wouldn’t change the wallpaper even if the image changed.
    Rename
  6. The last Action is Finder’s “Set the Desktop Picture” which you just have to drag into the workflow and you’re done.
  7. Save the workflow as Application into your Applocations folder and remember the name. (I named mine “last.fm - Azath0th - Wallpaper”). Now comes the scary part - the Terminal ;)
  8. We have to set up a cronjob. In order to do that type in crontab -e and paste the following in the crontab file.
    SHELL=/bin/bash
    0 * * * * /usr/bin/open "/Applications/last.fm - Azath0th - Wallpaper.app"

    Of course you have to substitute the name of the program with yours.
    This executes the Automator workflow every hour at 0 minutes on every possible day. (0 * * * *)

That’s it!
A few words of caution though:

Be sure that your desired download folder doesn’t contain any other files that contain “coverart” in their filename or Automator will delete those as well.

When the workflow runs it forces itself into the foreground which can be a bit annoying sometimes. I’m not sure what happens if you’re in the middle of a presentation and the workflow kicks in, it might be better to deactivate it during those occasions by putting a hash caracter (#) in front of the call in the crontab file.

Enjoy it and please tell me if you’ve got any ideas to improve the whole thing.

Written by Florian Beer in: mac, web
rel-tag , , , , , , ,