Sunday, November 1, 2009

Mute Spotify ads

Are you annoyed by Spotify pausing ads when you press mute? Here is a by-pass. It lets you mute your computer using the key combination of your choice (except Mute, unfortunately). Spotify won't notice and will let you skip the ad.

It is based on this observation, and on pieces of scripts from here and here.

The following AppleScript operates Spotify's pause/play command, then mute/unmute, and then pause/play again. Oddly enough, it does the trick, as long as they don't fix it.


on spotifypp()
 tell application "System Events"
  set MyList to (name of every process)
 end tell
 tell application "System Events" to set appList to ¬
  name of application processes whose frontmost is true
 set activeApp to item 1 of appList
 if (MyList contains "Spotify") is true then
  tell application "Spotify" to activate
  tell application "System Events"
  tell process "Spotify"
  click menu item 1 of menu 1 of menu bar item 5 of menu bar 1
  end tell
  end tell
 end if
end spotifypp

set isMuted to output muted of (get volume settings)
set newMuted to not isMuted
set volume output muted newMuted


Copy-paste in AppleScript editor. Hit the Compile button to check. Save it as a script under ~/Library/Scripts/.

To trigger the script with a keystroke, I use Quicksilver. Once Quicksilver is installed on your computer, open QuickSiver Preference, click Triggers, then + in the bottom. In the first box, pick your script. In the second box, pick Run.

To choose the key combination, click on the right side of your trigger bar. It will open a new pane for this.

This is it. Make sure Quicksilver is running when you listen to Spotify. I also recommend to use Growl. Growl displays a notification when a new song is playing. This tells you when to unmute.

Sunday, September 27, 2009

Vacuum-brewed coffee

Vacuum coffee-makers are supposed to reveal the whole taste of coffee. We bought the vacuum coffee maker by Bodum, to our knowledge the most affordable.

Water in the closed lower chamber is heated. With heat and evaporation, the volume of the air increases in the lower chamber and pushes water through a tube to the upper chamber. Water brews the coffee in the upper chamber. When the temperature of the lower chamber decreases, the liquid is sucked back to the lower chamber and thus separated from the coffee grounds. (see on Wikipedia)

Our first try rendered an awfully diluted coffee. The tube plundges down to 1 cm above the bottom of the lower chamber. The Bodum vacuum coffee maker is designed for regular electric or gaz stove, so the bottom is flat, and a lot of water remains there when the air finds its way into the tube. Although the coffee ended up very diluted, its taste was promising.

We extended the tube with aluminium paper. Aluminium does not react with air, water or coffee, even at water boiling temperature, so it preserves the taste, drinkability and remains unaltered. Furthermore it transmits heat as well as water, so its presence does not alter heat exchanges. We rolled an aluminium sheet around the round handle of a wooden spoon. We introduced the spoon into the tube, leaving 5 cm of foil outside. We rolled another sheet around the tube to cover it from its base to the exterior end of the inside foil. Finally, we squeezed the aluminium into a steady 1 cm extension of the tube, while keeping the spoon handle inside the tube to avoid cloging it with foil. We somehow twisted the fixation of a spring designed to grasp the end of the tube in such a way that it handles a longer extension in a tighter diameter.

As a result, virtually all the water is sucked up into the upper chamber. More caution is required though, not to leave the coffee maker unattended on the stove. Without boiling water to evacuate heat, the glass could explode.

Vacuum-brewed coffee looks relatively transparent and lean, about like tea. However, its taste is rich like an excellent espresso. Some say vacuum brewing is the best way to prepare coffee, because water penetrates coffee just below boiling temperature. I tend to disagree. In my opinion, water penetrates coffee at a wide range of temperatures. It starts to be pushed up long before boiling. When air goes from the lower chamber through brewing coffee, the temperature of these bubbles can be above 100°C. Using French press shows that water at different temperatures extract different aroma. My opinion is that vacuum brewing extracts all the aroma with the wide range of temperatures and without boiling the coffee.

Friday, August 28, 2009

Ergonomic laptop stand

When it is an option, I find it productive to alternate work from home and at the office. It helps me ignore the workplace to focus on my work. However, although the office is designed for work, home is not. The sofa is the most comfortable place to sit, but to hold the laptop a regular table is too high and a coffee table is too low. I use iLap but it does not last the whole day without straining my back and arm muscles.

In fact many homes have a designer laptop stand perfectly suited for the sofa : the plain old-style clotheshorse. An arm placed nearly horizontal makes a sturdy stand. Its strings have a solid grip with the lower angles of the MacBook screen shell. Its height and leveling can be adjusted by displacing elements with the help of pliers. I moved the central binders one level higher to spread the legs and lower the whole thing, and I moved the platform one level down to have it horizontal at the right height. It is slightly flexible and surprisingly comfortable. At least I have written this whole article without having to complain about it.

Now, seriously, to ventilate you laptop and keep it cool, how can you beat a clothes airer?

Sunday, August 23, 2009

Quick USB backup from a Mac

I find it very relaxing to keep with me at all times the data I don't want to loose. While I work an external drive is plugged in and Time Machine keeps regular backups on a 100GB partition of it. However, although this drive is very small and light, I don't bring it everywhere. What I keep everywhere is an up-to-date copy of my work on a tiny 8GB USB key attached to my key-ring.

So whenever I leave after work I update the key, and this is how it gets done.

Mac OS X detects the new device and mounts it as it does normally. In addition the key is recognized, its contents are synchronized, and the key is ejected. This can be automated with the following steps.

Step 1: Download and install Rsyncx.

Step 2: Create this workflow with Automator.

Drag and drop Run Shell Script action. Copy and paste the following script in a single line. Replace [KeyName] and [FolderPath] with your values.

if mount | grep -qs '[KeyName]'; then time sudo rsync -s -e ssh "[FolderPath]" /Volumes/[KeyName]/; fi

Drag and drop Get Specified Finder Items action, click "Add...", type a slash and a box appears. In the box type /Volumes/[KeyName] .

Drag and drop Eject Disk action.

Step 3: Save the workflow as plugin for folder actions attached to folder /Volumes . Save it as a workflow as well if you want to modify it later.

Step 4: Enable folder actions at startup.

To deactivate the workflow and use the USB key normally, Ctrl-click on any item in Finder, moseover "More", click "Configure Folder Actions...". The workflow is associated to "Volumes". Uncheck it.