Thursday, November 17, 2011

csshx and spark

csshx is a mac OS tool to connect in parallel to several machine and send the same command to all the machines see project page http://code.google.com/p/csshx/ spark is shell script to produce sparklines from your command line, project page https://github.com/holman/spark Suggestion from http://onethingwell.org

Saturday, September 03, 2011

Kindle reboot and network choice

To reboot the kindle you must do:
1. Menu
2. Settings
3. Menu
4. Restart

To choose manually the network to connect to do:
1. Menu
2. Settings
3. Type 311
You will get a menu with the detected networks.

Tuesday, August 23, 2011

Derpbox replacement for Dropbox, written in bash

Derpbox is a secure replacement for Dropbox, written in bash. Released under the beer-ware license, a pint of cider is fine too. It runs fine with GNU bash 4.2.8 and rsync 3.0.7.

https://github.com/L-P/Derpbox

Tuesday, July 26, 2011

Convert sound files using command line

MacOs X comes with a neat tool to convert sound files, afconvert. It has a bit of a crappy error reporting.
I used the following command to convert from aiff to wave: afconvert -f WAVE -d UI8 Mail_Sent.aiff
Some nice details here

Saturday, July 23, 2011

Time machine for linux

flyback :
Apple's Time Machine is a great feature in their OS, and Linux has almost all of the required technology already built in to recreate it. This is a simple GUI to make it easy to use.

Via onethingwell

Screen, tmux and reparenting

reptyr is a utility for taking an existing running program and
attaching it to a new terminal. Started a long-running process over
ssh, but have to leave and don't want to interrupt it? Just start a
screen, use reptyr to grab it, and then kill the ssh session and head
on home.

tmux is a terminal multiplexer: it enables a number of terminals (or windows), each running a separate program, to be created, accessed, and controlled from a single screen. tmux may be detached from a screen and continue running in the background, then later reattached. (Maybe a nice replacement of screen)

Wednesday, June 01, 2011

Export RSS fedds from Mac Mail

MacOS comes with a command line tool pubsub to access the RSS feeds.
Some interesting commands are:
  • Get list of clients:
    pubsub list clients:
  • Get list of RSS feeds from client com.apple.mail:
    pubsub list client com.apple.mail
  • Get only the URLs:
    pubsub list client com.apple.mail | cut -f3
Update: use background for the commands

Friday, May 27, 2011

Hide Dock Icon for an application

To instruct an application to hide the icon from the dock, you need to edit the file Info.plist, located in application.app/Contents.
Add the code
<key>LSUIElement</key> <string>1</string>

Wednesday, May 11, 2011

Pow and the website is up!

Pow

Pow is a zero-config Rack server for Mac OS X. Have it serving your apps locally in under a minute.

Via onethingwell

Monday, May 02, 2011

Ermine - package packer

Ermine packs a GNU/Linux application together with any needed shared libraries and data files into a single executable. This file can be copied to any GNU/Linux host and run without further modifications.

http://www.magicermine.com/

Suggestion form One Thing Well

Tuesday, January 11, 2011

Global shortucut for opening new Finder window

A shortcut I always used heavily in windows was the win-e to open a explorer windows.
In Mac OS this shortcut does not exist globally.
Searching on google you get many suggestions, but all of them are in the form:
Select Finder and choose "New window". DUHHH!!
I don't like this solution because is a 2 step thing that is something I want to avoid.
Finnaly I found in this this site http://contented.qolc.net/articles/osx-global-shortcut-key-new-finder-window a good solution using the services that will allow for a global, single shortcut to open a new finder window (plus: you can tune the script to open the window in a selected location)

The service I created can be found here.

Some of the 2 step solution are interesting, so I leave here some notable solutions:
  1. Use of option-command-space that will open a search window, that is, in itself a finder window.
  2. Use ctrl-f3, this will move the focus to the Dock, pressing return will sellect the finder, because this is always the first application in the Dock.

Saturday, January 08, 2011

Remapping keys in linux

My problem:

I got a very crappy PS2 to USB cable, and when I use the mouse scroll, from time to time a extra mouse key press was sent (key 9). This was not a problem in most of the places, except in firefox where it would trigger a back in history when I scrolled up (very annoying).
I've changed all the firefox preferences in about:config in mousewheel.* to only scroll (action=0), but I was always getting the back in scroll up. (about:config information here.)

Diagnosis:

To figure out what was the problem I used xev That will print to the terminal the events occurred in the small x window created by the program. Here is the problem I was having, the log is from me scrolling down, you can see at some point the keys sent are 9 and 8:
ButtonPress event, serial 40, synthetic NO, window 0x3800001,
    root 0xb6, subw 0x0, time 747353, (40,101), root:(1358,514),
    state 0x10, button 4, same_screen YES
ButtonRelease event, serial 40, synthetic NO, window 0x3800001,
    root 0xb6, subw 0x0, time 747353, (40,101), root:(1358,514),
    state 0x810, button 4, same_screen YES
MotionNotify event, serial 40, synthetic NO, window 0x3800001,
    root 0xb6, subw 0x0, time 747449, (40,102), root:(1358,515),
    state 0x10, is_hint 0, same_screen YES
ButtonRelease event, serial 40, synthetic NO, window 0x3800001,
    root 0xb6, subw 0x0, time 747449, (40,102), root:(1358,515),
    state 0x10, button 8, same_screen YES
ButtonRelease event, serial 40, synthetic NO, window 0x3800001,
    root 0xb6, subw 0x0, time 747449, (40,102), root:(1358,515),
    state 0x10, button 9, same_screen YES
MotionNotify event, serial 40, synthetic NO, window 0x3800001,
    root 0xb6, subw 0x0, time 747553, (40,102), root:(1358,515),
    state 0x10, is_hint 0, same_screen YES
ButtonPress event, serial 40, synthetic NO, window 0x3800001,
    root 0xb6, subw 0x0, time 747553, (40,102), root:(1358,515),
    state 0x10, button 8, same_screen YES
ButtonPress event, serial 40, synthetic NO, window 0x3800001,
    root 0xb6, subw 0x0, time 747553, (40,102), root:(1358,515),
    state 0x10, button 9, same_screen YES
ButtonPress event, serial 40, synthetic NO, window 0x3800001,
    root 0xb6, subw 0x0, time 747553, (40,102), root:(1358,515),
    state 0x10, button 4, same_screen YES
As my mouse only has 2 buttons and a scroll wheel, I changed the mouse mapping to disable all the other buttons (buttons above 5 are set to button 0). The command is:
xmodmap -e "pointer = 1 2 3 4 5 0 0 0 0 0 0 0 0 0 "
You can check what mapping you are using by doing: xmodmap -pp In my case, after changing the mapping I get:
# xmodmap -pp
There are 14 pointer buttons defined.

Physical        Button
 Button          Code
    1              1
    2              2
    3              3
    4              4
    5              5
    6              0
    7              0
    8              0
    9              0
   10              0
   11              0
   12              0
   13              0
   14              0
To return to the default mapping you can do : # xmodmap -e "pointer = default" And check:
# xmodmap -pp
There are 14 pointer buttons defined.

Physical        Button
 Button          Code
    1              1
    2              2
    3              3
    4              4
    5              5
    6              6
    7              7
    8              8
    9              9
   10             10
   11             11
   12             12
   13             13
   14             14
To make this change permanent you just need to create a file ~/.Xmodmap with the content:
pointer = 1 2 3 4 5 0 0 0 0 0 0 0 0 0
You can check the correctness of your file by doing xmodmap ~/.Xmodmap and check if the mapping was changed correctly.

Sunday, September 26, 2010

Rotate pictures in Mac OS X

Apparently rotate picture was not deemed to be a default action... Fortunately there are 3 ways of Mac OS X to rotate your pictures:
First solution (Stupid)
  • Create a folder and associate the rotate action desire to it... When you drop images inside this folder they will be automatically converted and placed inside yet another folder!
Second solution(Too much work)
  • Open file in preview, rotate image and save.
Third (even more work but you only have to do it once)
  1. Create a service to rotate images:
  2. Open Automator
  3. Chose service
  4. Search for rotate image action and drag it to the action list.
  5. Automator will ask if you want to also add the action of create a copy. Sounds good, but I did not find the option to create copy in current folder, so I ditched the copy action
  6. Chose which side you want to rotate to: left, right or 180º.
  7. Save and you're done, now you will have rotate image in the services menu.
You can find the here Rotate Right and Rotate Left. Just extract the files into $HOME/Library/Services/ and the service will be available when you select an image.

Bonus: Resize images

Sunday, April 25, 2010

Ikea is great

1. Meat balls, french fries and jam.
2. Daim tart.
3. Other swedish delicacies.
What else?

Sunday, April 11, 2010

Recipe for Tarte Tatin

Here is my recipe for tarte Tatin:

Ingredients:
  • 110g of Sugar
  • 80g of Salty butter
  • 1 packet of Vanilla sugar
  • Orange zest (0.5 to 1 orange)
  • Cinnamon
  • 4 or 5 Apples (sour apples work better)
  • Puffy pastry
Process:
Put the sugar and butter on the tray, take to low fire, mix the sugar and the butter to create toffee.
Add the cinnamon and the orange zest to the toffee, mix.
Place the apple over the toffee.
Cover with the puffy pastry, fold all around to create a crust.
Take to hot oven for ~20min.
Flip, or not.

Sunday, March 02, 2008

B&Bs by the see on the North of france

http://ns3196.ovh.net/~goelette/index.php
http://www.booking.com/hotel/fr/hoteldelamatelote.html
http://www.booking.com/hotel/fr/la-villa-marine.html
http://www.hotelmaxim.be/eng/default.htm
http://www.durecu.com/
http://www.cathome.fr/anglais/index.htm

HCDV - Heavenly Chocolate Delivery Vehicle














nigella's cupcakes:
http://www.nigella.com/recipes/recipe.asp?article=225

"o remo é lindo"

http://club-nautique-divonne.chez-alice.fr/indexav.html

Sunday, February 24, 2008

heating sand to extract oil

Certain things only make sense when you are looking at them through a spreadsheet in some obscure office.

http://en.wikipedia.org/wiki/Tar_sands