Just a quick hack update

I just posted a quick update to my Hackintosh setup page. In short, I found a bug today with the way I patched my DSDT that was causing me to lose the ability to use my front-panel audio jacks. I’ve corrected the error and verified that I have working front panel audio again. Accordingly I’ve updated my pre-patched dsdt and 4790k config.plist downloads, and added a howto/explanation about the necessary patch edit.

You can find everything on the main hackintosh page here.

Stupid cables…

Since I had to take apart my computer again today to swap the 450w SFX power supply back in, I remembered to take pictures of the custom power cables I made.

Instead of cutting up the original cables (or going the full custom/from scratch route) I bought the Silverstone PP05-E flexible/short cable set and used the following:

  • 1 x 20+4pin ATX connector (350mm)
  • 1 x EPS/ATX12V 8pin(4+4) connector (350mm)
  • 1 x two (2) SATA 90˚connectors (350+50mm)
  • 1 x three (3) SATA 180˚ +1 x Slimline SATA connectors (300+150+150+150mm)

The 24-pin ATX and 8-pin EPS cables were both fine as is with a little bending and tucking them out of the way of the NF-F12/”pull” fan. The SATA/peripheral cables though were a nightmare.

I took one cable and cut it down to a 2x SATA, around 90mm in length. This runs straight from the PSU to my two SSD’s, which are stuck together with double sided tape 😦

The second cable I cut off two of the full-size SATA connectors, and spliced the slimline connector straight into the PSU end.

One tip for anyone looking to crimp two wires into the same Female ATX terminal, buy terminals one size larger than your wire, e.g. for dual 18AWG, buy 16AWG terminals like these: http://www.digikey.com/product-detail/en/0039000090/WM3115-ND/1643445

And of course I’ll likely need to shorten the PCIE cables too, but there’s no real point in starting that until I actually have a GPU.

macvim doc icons redux & howto

So I had some questions on how I generated the MacVim document/file type icons since the included script has been broken for a lot of people.

To use the /src/macvim/icons/ script, you need to make a few changes:

  1. You need a 512px version of the apple “GenericDocumentIcon.icns”
    • I took the 1024px version from Mavericks, exported all the png files, and created a new icns with 512px max size.
    • I placed the 512px icon in the “icons” directory and modified the docerator.py and make_icns.py files

  2. Copy or export a 512px version of the icon you want to use, rename it ‘vim-noshadow-512.png’, and place it in the /icons folder.
  3. Download a pre-compiled version of “makeicns” and place it in the /icons/makeicns folder, then comment out the relevant portion of the makefile.
  4. Modify the make_icns.py script to generate 512px for all sizes (alternatively you could just change every icon type to the ‘large’ preset instead of ‘small’, I just found it was fewer changes to add 512px to the small preset.)

  5. ‘cd’ into the /icons directory and run: ‘make getevny’ followed by ‘make all’
    (Note: this will generate an error at the end because we’re no longer using the ‘link’ option for any icons, you could always comment out the call to ‘link’ but I just haven’t bothered.)

whitespace in vim


So one thing that’s annoyed me about my recent switch to vim, is the lack of any easy way to show all whitespace/invisible characters. “set list” is a great start, but I really want to see ALL invisibles, even spaces, which seems pretty much impossible in vim.

So for now I’ve settled on just showing tabs, eol, etc. at least this makes it so if something looks like a space, it is almost certainly just a plain space.

If you want to mimick this setup, add the following two lines to your .vimrc

au BufNewFile,BufRead *.* set list listchars=eol:¬,tab:\▸\ ,trail:~,extends:>,precedes:<

OSX – Disconnect/Disassociate wifi on boot

So I don’t really expect very many people to care about this, but I finally solved an OSX annoyance that’s been bugging me for a while.

My scenario is this, I use OSX on a desktop with both ethernet and wifi. I prefer to use my ethernet connection, but OSX automatically connects to wifi on boot/wake if I have any saved networks. This causes some problems with my computer being assigned multiple IP’s, trying to register multiple hostnames, etc.

Now the simplest solution would be to simply turn off wifi, and only turn it on when I need it, but that just seems kludgy to me. I want to leave the physical wifi card enabled, but just not connect to wifi on startup.

And it turns out that isn’t possible, but you can force airport/wifi to disconnect from the command line, provided you enter your admin/sudo password. Every. Single. Time.

sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -z

If you try to run that without “sudo” it will tell you:

root required to disassociate

At first, I just set up and alias to this, but it’s still not perfect, since typing a password every time the computer boots, or wakes from sleep is a bit annoying.

This morning I finally found a workaround.

This is a two part fix, first we need to add an entry to our /etc/sudoers file to allow the airport-z command to run as root, without a password.

sudo visudo

And under the line:

%admin ALL=(ALL) ALL

Add the following:

%admin ALL=(root) NOPASSWD: /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -z

This line allows users in the admin group to run the airport command to disassociate, without a password. You can further refine this by replacing “%admin” with your username, so only your user account can run the command without a password.

And a natural extension of this, is that we can now use launchd to automate this at boot.

Donwload this plist file and place it in /Library/LaunchDaemons, repair permissions, and reboot. Whenever you login, this will run, and automatically disconnect wifi. You can further automate this with a tool like sleepwatcher to automatically disconnect on wake from sleep too.