Tag Archives: OS X

SHA512 hashes in OS X

While messing about with my new Raspberry Pi the other day, I realized I didn’t know how to generate SHA512 hashes on my Mac to validate the integrity of my FreeBSD images.

As suspected it’s not that much more work than what I’m used to on FreeBSD (just “sha512 file“).

In OS X just run
shasum -a 512 file
and it gives you the hash of the file.

I’ll just leave this here as a note for the next time when I forget this in the future.

I validated that the shasum perl wrapper exists on both OS X El Capitan (10.11.1) and OS X Yosemite (10.10.5), still YMMV.

Share

Accessing the OS X clipbord in VIM

I’m a vi kind of guy and uses various flavors of it a lot. One thing that took me all too long before I got around to set up was proper access to the OS X clipboard from vim.

There are all kinds of howtos on this out there, so I will just cut to the chase but one thing to point out is that depending on compile options you might have good access to the clipboard already. One way to check is by running :echo has('clipboard') in vim. If it returns 0, you don’t have it compiled with the clipboard. This is the case for the all the vim’s I have checked that ships with OS X. If yours is different please leave a comment with some details about OS X and vim versions.

In your .vimrc add the following lines
" paste on new line (after current) from OS X clipboard
map pbp o<Esc>:.!pbpaste<CR><CR>

" copy visual selection to OS X clipboard
vmap pbc :w !pbcopy<CR>

It’s probably obvious to anyone who has used vi what these lines do, but they map pbp to run the external commands pbpaste (paste from OS X clipboard) and the visual selection alias pbc to run pbcopy.

Pbpaste and pbcopy are available by default as a part of OS X.

Share

Removing widgets in OS X

I was in a cleaning mood the other day and while scanning through my hard drive I saw a ton of files that I realized belonged to old Dashboard widgets that I no longer use.

Scrollback was gone along with the path and surprisingly there is no “remove widget” feature available in Dashboard, only one to get more of them.

So for future reference, widgets get installed either in /Library/Widgets or in ~/Library/Widgets. (~ is the unix shorthand for the current users home directory, so in my case /Users/henrik)

Removing just six old widgets I got rid of 9772 files occupying 76MB in total so in my opinion it was well worth the few seconds it took me to delete them, YMMV though.

Share

Upgrading to SSD in the Mac

MacBook Pro open

MacBook Pro open with new SSD installed

I finally took the step to ditch the old spinner in my MBP since the prices of SSDs have gotten very compelling. I got a 256GB Samsung 830-Series for just less than 1200 SEK and that let me avoid the hassle of moving to a smaller drive.

The switch itself was a series of simple steps as follows.
First I ran a manual time machine backup (I backup my entire system to ease a full restore in case of crash or theft). Then I rebooted and did another manual backup just to be sure.
Continue reading

Share

Keyboard shortcuts for screenshots in OS X

I love keyboard shortcuts and are always amazed at just how many useful ones I don’t have the slightest idea about. So I have to share these tips I got from a colleague.

For a quick screenshot from selection in OS X just press
shift+cmd+4
and your pointer turns to a crosshair for the selection. (press esc to abort)

Or for a quick full screen screenshot press
shift+cmd+3
The screenshots are by default labeled with the time and date and saved to your desktop.

Hopefully this enlightened someone else too.

Share

Standard agreement

I was home sick today and being a bit bored I decided to actually skim through the EULA for the App Store before agreeing. It’s nice to see they still keep the part about not being allowed to use the software to create or design nuclear or biological weapons in there..

app store license snippet

app store license snippet

Example in english here.
If I ever get to draft an agreement I must remember to include a clause like this!

Share