/dev/trouble
Eric Roller's blog

Thursday, April 20, 2017

Open Xcode from the Terminal

Quite often I find myself in the Terminal and want to open Xcode with the project in the current directory:

> open CurrentProject.xcodeproj

This works just fine, of course, but with the following alias (added to ~/.cshrc), I don’t need to know the name of the project, assuming there is always only one project in the current directory:

> alias xcode '\ls | grep xcodeproj | xargs open'
> xcode

N.B. The use of ‘\ls’ ignores the alias that I have for ‘ls’. Instead of “ls *.xcodeproj”, the pipe via grep avoids errors like “ls: No match.”.

P.S. Knowing the name of the project is actually not the problem; since there are multiple items named “Current*” or “CurrentProject*” in the same folder, the issue is that I can’t just type “open SHIFT+C<TAB><CR>” (where pressing TAB autocompletes the name); instead, I have to type: “open SHIFT+C<TAB>SHIFT+P<TAB>.x<TAB><CR>”.

Wednesday, August 10, 2016

Weekly / Monthly Git Backups

Similar to what I have been doing with subversion, I now also create backups for my git repositories.

[Read More…]

Thursday, December 25, 2014

Blog Reboot: First Post

I have decided to switch my blog to a different backend; one that is easier to maintain and doesn’t rely on MySQL (which I always found overkill and difficult to backup). Now I only need to extract my old blog posts from that last database dump file…

Update: Having worked through the dump file in a text editor, I found hundreds of duplicate entries marked as ‘inherit’ and ‘nnn-revision-m‘. These entries may be the result of multiple edits of a post. This is exactly the kind of data bloat that I strive to avoid. The current solution stores all entries in simple text files. Easy to back up. Easy to index. No duplication.

Friday, January 17, 2014

Weekly / Monthly Subversion Dump Backups

Just added a new section to /etc/periodic/monthly/mine.monthly in the attempt to create monthly backups of my subversion repositories, using compressed dump files:

[Read More…]

Wednesday, March 28, 2012

System Preferences hangs with RSS screen savers

Here are the symptoms: open System Preferences, select Desktop & Screen Saver and click on the Screen Saver tab. In the list of the screen savers, I had an RSS feed which turned out just to be too slow for my aging machine.

However, selecting the feed to delete it just gave me the beach ball, rendering System Preferences totally unresponsive. I gave up after a few minutes. To close System Preferences, click long on its icon in the dock and select “Force Quit”.

To delete the RSS feed, I resolved to tracking down the corresponding preferences file and I found this one:

~/Library/Preferences/com.apple.desktopscreensaver.rsspictures.plist

While System Preferences is closed, open the file in a text editor (I like TextWrangler) and delete the feed entry from the dictionary. My resulting file looked like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
  "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>rssPicSubscriptions</key>
        <dict>
            <key>com.apple.screensaver.rsspics</key>
            <dict/>
        </dict>
    </dict>
</plist>

Save the file and reopen System Preferences to verify that the RSS screen save is no longer in the list. Done!

Update: I hear that you also can simply delete the file and you may need to restart or at least logout and login again.