Skip navigation

YNAB category check workflow for Alfred 2

  • July 20, 2013 – 10:29
  • Posted in alfred, Coding, Mac OS X
  • Comments (3)

This is a workflow which lets you look up how much you have left in a You Need a Budget (www.youneedabudget.com) category for the current month.

It looks for your budget file in ~/Dropbox/YNAB and ~/Documents/YNAB. If you have a single budget in one of those folders, it will use that and needs no configuration. If you have multiple budgets, or a budget somewhere else, you can use a File Action on it to select it as the budget to use.

Fuzzy/substring matching, tries to use the currency symbol/format based on the budget’s configuration.

Hacked up the code to parse the YNAB data myself, so please make sure that it’s reporting accurately for you :)

spacer

spacer

Download here: cloud.jamesoff.net/2C04451d3R3Q

(Updated 2014-08-27 to fix 0.00 values being shown as “overspent”, and to add caching to speed up results.)

VMware Fusion keyboard layout

  • November 9, 2012 – 15:36
  • Posted in Uncategorized
  • Leave a Comment

If you’re using VMware Fusion and can’t get the keyboard layout right in your VM (especially if you can’t get backslash to show up), try my Happy Hacking UK layout. This gives me the correct layout on my MBP at least :)

My MBP has the \ key (shift-\ is |) above the return key and to the right of the ] key. Note that because this is the UK layout, it makes shift-2 generate double-quote ", and shift-single-quote generate @. For personal reasons, shift-3 generates hash #. To obtain the GBP Sterling currency symbol £, use right alt-3.

Alfred script to toggle AirPort

  • July 13, 2011 – 08:25
  • Posted in Mac OS X
  • Tagged airport, alfred, script
  • Leave a Comment

Please see my Alfred Extensions page for updates!

A quick and easy one for Alfred: a command which toggles AirPort on/off.

If you are using Alfred 0.9.9 (or better), you should be able to download this ZIP file and import it!

If you are using an earlier version of Alfred, follow these instructions:

AIRPORT=`networksetup -getairportpower AirPort | grep Off`; if [ "$?" = "0" ]; then networksetup -setairportpower AirPort on; MSG="AirPort enabled"; else networksetup -setairportpower Airport off; MSG="AirPort disabled"; fi; /usr/local/bin/growlnotify -m "$MSG" -a "/Applications/Utilities/Airport Utility.app" AirPort status

Create as a terminal script and configure it to be silent. I also borrowed the icon from AirPort utility for the script (Alfred for “airport” and then use Reveal in Finder on it; Get Info; click Icon and ⌘C; click the icon area in Alfred and ⌘V).

spacer

Alfred script to change network location in OS X

  • June 9, 2011 – 18:43
  • Posted in Coding, Mac OS X
  • Tagged alfred, script, useful
  • Comments (13)

Please see my Alfred Extensions page for updates!

I wrote this little scriptlet to change network location in OS X using Alfred, but you could trigger it using whatever method you wanted.

If you’re using Alfred 0.9.9 or later, you should be able to download this ZIP file and import it!

if you using an earlier version, follow the instructions below:

/usr/sbin/scselect 2>&1 | /usr/bin/grep -i {query} | /usr/bin/cut -c 4-39 | /usr/bin/xargs /usr/sbin/scselect

UPDATE 2011-06-11: I have significantly improved the script to work around a bug caused by the 3Connect profile (3Connect is pants FYI), as well as use growlnotify to tell you if the change worked or not. It also allows substring matches (anchored at the start) so you can use “auto” for “Automatic”. If you have more than one profile that starts with a matching substring, the behaviour is currently undefined.

spacer

MSG=`/usr/sbin/scselect 2>&1 | /usr/bin/egrep -i "\({query}" | /usr/bin/cut -c 4- | /usr/bin/cut -f 1 | /usr/bin/head -n 1 | /usr/bin/xargs /usr/sbin/scselect | /usr/bin/sed -E 's/.+ \((.+)\)/Location changed to \1/'`; if [ "$MSG" = "" ]; then /usr/local/bin/growlnotify -a /System/Library/PreferencePanes/Network.prefPane -m "Unable to change location" Error; else /usr/local/bin/growlnotify -a /System/Library/PreferencePanes/Network.prefPane -m "$MSG" Location changed; fi;

If you want it without Growl notifications, use this version:

usr/sbin/scselect 2>&1 | /usr/bin/egrep -i "\({query}" | /usr/bin/cut -c 4- | /usr/bin/cut -f 1 | /usr/bin/head -n 1 | /usr/bin/xargs /usr/sbin/scselect

It’s slightly convoluted as it’s case-insensitive. To use it, create a Terminal/Shell script entry like this:

spacer

Now you can just type “location work” or similar into Alfred to change network location. I’ll add Growl-confirmation support when the next version of Alfred is released :)

iPhone apps, Xcode and Dropbox

  • January 10, 2011 – 12:33
  • Posted in Coding, Mac OS X, my stuff
  • Tagged apple, dropbox, iphone, xcode
  • Leave a Comment

A while back I put some of my Xcode bits (i.e. the Random Recipe Generator) into my Dropbox to make it easier to stay up to date on my laptop and my desktop. (Yes, I know, source control blah blah blah :)

However, building the Distribution version of the app gave me this warning:

“The CodeResources file must be a symbolic link to _CodeSignature/CodeResources”

which I duly ignored. However, the Application Loader (used to push the new binary to the App Store) also complained about that and wouldn’t upload it.

It looks like Dropbox’s replication may have been to blame for the symlink stopping being a symlink, so the solution is to use the handy new selective sync option in Dropbox and not sync the build/ directory between my machines (which is pretty much pointless anyway and certainly generates a lot of network overhead when you build). Having done that and built a clean copy it worked fine.

Mac OS X Service to use b.oooom.net

  • December 31, 2010 – 11:03
  • Posted in Coding, internets, my stuff
  • Tagged apple scripting boooom
  • Leave a Comment

Use this Mac OS X Hints tip and use the following URL for the “download” line:

b.oooom.net/shrink.php?api=1&url=

VMware Fusion upgrade error messages

  • December 3, 2010 – 09:18
  • Posted in VMware
  • Tagged error, fix, fusion, vmware
  • Leave a Comment
CDS Internal Error (3014)

Means: Can’t reach the HTTP proxy you have configured. Maybe you should turn it off.

tarsnap under cygwin

  • September 10, 2009 – 10:36
  • Posted in Microsoft, Sysadmin
  • Tagged backup, compile, cygwin, tarsnap, windows
  • Comments (1)

To get tarsnap working under cygwin, here’s what you need to do:

  1. Install the following packages using the cygwin setup tool:
    • gcc4
    • make
    • openssl (needed for runtime, not for building)
    • openssl-devel
    • zlib-devel
  2. Download and extract the tarsnap code.
  3. Run ./configure (this seems to be much slower on cygwin than on other more UNIXy platforms)
  4. Run make all install clean

Tarsnap should now be installed and you can use it in the normal fashion – create a host key with tarsnap-keygen and then get backing up!

Edit 2009-12-16: checkers from #tarsnap on EFnet has written a post with scripts for Linux and Cygwin tarsnapping at www.bluebottle.net.au/blog/2009/tarsnap-backups-on-windows-and-linux

You may also wish at add --prefix=/ to the configure command line, as /usr/local isn’t in the default path.

Using gvim to edit mail in Outlook

  • April 3, 2009 – 16:43
  • Posted in Exim and email, vim
  • Tagged email, outlook, scripts, vim
  • Leave a Comment

Before you go any further, this isn’t about having gvim embedded in Outlook, or using it automatically as an external editor.

This method lets you use one keystroke to edit a mail in gvim and when you close gvim, it’s put back into the Outlook compose mail window.

Read More »

Risk Disk and Squid

  • September 10, 2008 – 15:06
  • Posted in FreeBSD, Sysadmin, Work
  • Tagged http, riskdisk, squid
  • Comments (2)

We use RiskDisk at work to see if a company we’re going to do business with is trustworthy, but recently it was complaining HTTP Error 417: Expectation Failed when it tried to do any online lookups.

I tracked this down to it sending Expect: 100-continue in the headers of the request it sent to its server. However, it was going via our web proxy at work, which is Squid. Recently I upgraded Squid to 2.7, and this seems to be the cause of the problems. Squid 2.7 is less forgiving about that particular header (which is apparently an RFC violation on the part of the client).

It’s easily fixed by adding ignore_expect_100 on to your Squid configuration.

gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.