Thursday, September 23, 2010

Remove duplicate entries in Finders Open With menu

After seeing my list of entries in the Finder's "Open With" menu grow and containing an increasing number of duplicate entries, I figured it was time to try and fix this. Googling the matter revealed a number of outdated solutions. The problem was that the utility used had moved to another location on the disk.

The correct way of doing this on Snow Leopard is to use the following command:


/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user


This will regenerate the list, and for me, all the extra entries disappeared.


Saturday, August 28, 2010

While Waiting for the Kindle to Arrive

A few week a go, my lovely wife bought me an Kindle (version 3) as a birthday gift. The word has now come that the Kindle is shipped, and I am eagerly awaiting its arrival, scheduled for Tuesday, here are a few links that I have found concerning the new Kindle 3. Some are reviews, some are other peaces, but they all talk about the Kindle. Enjoy.

And P.S. If you have any links not in my list, please share them in the comments.
Search Amazon.com for kindle

    Friday, July 9, 2010

    Using URLs as references with LaTeX and BibTex

    Recently, while writing a paper using LaTeX, I needed to reference some URLs. Sometimes footnotes might be used for this, but here I felt it would be better to put it in the list of references using BibTeX. There are, however, no obvious way of referencing URLs with BibTeX. After searching a little and playing with the results, the the following seems to be a good way to write up URL references in BibTeX.

    @misc{example_com,
        Howpublished = {\url{http://www.example.com/}},
        Key = {example},
        Title = {The example.com Web Site},
        month = jul,
        year = {2010}

    }

    Howpublished is where you put the URL that should be displayed in the list of references. I also use the URL-package to make sure that the URL is formated properly. It is possible to use the hyperref-package to make the URLs clickable. Month and year are used to denote when the site was last visited.

    When the list of references is created, this should create a reasonably nice display of the URL. An even better approach would probably be to use biber or BibLatex, but that was not really an option in this case.

    Tuesday, June 8, 2010

    Inserting todays date in Apple Keynote

    Inserting today's date in Apple's Keynote application should be as easy as selecting "Insert date" from the insert menu. It is, however, not an available option. This always surprises me, but I have not been able to find this seemingly obvious feature anywhere.

    Luckily, there is a way to do it. It involves inserting a table, and putting a formula into the table cell. Start by inserting a table (press the "table" button on the button bar, or select table from the insert menu). Select the table inspector, and set both body rows and body columns to 1 (one).

    You should now have a fairly large square on your slide. This is OK for now. Select this square and type "=TODAY()" or "=NOW()" into the square. The text will be shown in a small pop-up window for typing in formulas. The first command (today) will display today's date only, and the second (now) will display both the date and the current time.

    Depending on your use, it might be a good idea to customize the visual appearance of the table, for instance remove the table border by selecting "none" in the cell border drop down box in the inspector. You should be able to change the colors and fonts using the normal keynote manipulation techniques.

    Saturday, March 20, 2010

    Using alt (meta) in bash on OS X

    The bash shell has a few very useful commands that, at first glance, do not work on OS X. Commands like Alt-D (delete word) and Alt-B (backwards one word) does not work. This has annoyed me for a while, so I finally set out to do something about it. The solution turned out to be fairly simple.

    Terminal.app has a setting that turns the option key as the meta key. Just open Terminal.app preferences and select the settings tab, and select "use option as meta" check box. You are now good to go for using the Alt-B, Alt-D (and similar) keyboard shortcuts.

    Friday, February 26, 2010

    24-hour clock in iCal

    Living in Norway, I am used to working with a 24-hour clock. I never liked this am/pm thing. I do, however, like my operating system language to be English. By default, iCal will use the settings for the current selected language for deciding what type of time it will display (12-hour or 24-hour).

    The way to change how iCal display its time, go to System Preferences, and select Language & Text. One of the tabs showing in this preference pane is Formats. Press the "Customize..." button, and change the format to whatever you would like it to be by dragging and dropping elements into the different boxes. Delete elements by selecting it and typing the back-space button.

    That is it. You will have to restart iCal for the changes to take affect.


    Monday, January 18, 2010

    Restoring hidden files with Time HMachine

    I recently, after a 4 month wait for my company to get the discs, upgraded to Snow Leopard. I trusted Time Machine for my backup of the Leopard install, and did a wipe and install. I like to start with a clean system whenever I can.

    After having installed Snow Leopard, I needed to restore some files, including my .profile. The only trouble is that, as far as I was able to figure out, there is no way of displaying hidden files when you are in Time Machine mode, and as a consequence, no way of restoring them unless you restore the whole directory. 

    There is a way of displaying hidden files in Finder when not in Time Machine, and it turns out that if this mode is enabled when you start Time Machine, hidden files are displayed also within Time Machine.

    You need to do the following two commands in order to turn on the display of hidden files

    $ defaults write com.apple.finder AppleShowAllFiles TRUE
    $ killall Finder

    You may now restore your files. When you have restored the files and want to turn off display of hidden files (they clutter things up in the display), just do the same two commands again, but replace "TRUE" in the first command with "FALSE"