Tech Diary
screen as a ssh-oops prevention tool
  • screen starts a new virtual screen session
  • screen -list lists virtual screens
  • ^A, D disconnects the current screen
  • screen -d -r <screen name> reattaches (-r) to a screen after disconnecting it from its current terminal, if one exists (-d)

Screen supports logging, but on multiple machines it can get weird. Might be better to use > redirection from inside screen. Advantage is that the output file can be tail -f'd from outside screen.

'Responsible disclosure' discussion in the comments
How to install SublimeLinter3-pyyaml

This one is proven to be quite a challenge.

Installed Ubuntu on a MacBookPro5,3

Important notes:

  • need to install Nvidia driver and need to modify ~/.xinitrc to start Unity [link]
  • don’t install all the closed-source things because oh no the display just died again
  • apt-get logs all installs so I can roll back bad deeds
  • to not have the video driver crash before boot finishes, give kernel argument nomodeset in bootloader
  • installing rEFIt/rEFInd was a good choice
  • prolly could’ve just downloaded the mac livecd here to save lots of trouble
  • Ubuntu is really really fast
  • I probably won’t ever use Ubuntu as my primary OS
  • looks like I can add raw disks to VirtualBox, so maybe a OS can be both directly booted and loaded as a VM

http://hints.macworld.com/article.php?story=20071030151739791:

/sbin/fsck -fy
/sbin/mount -uw /
# launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist
launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plist
dscl . -list /groups GroupMembership | grep username
for group in usergroups:
    dscl . delete /groups/group GroupMembership username
dscl . delete /users/username
rm  /var/db/.AppleSetupDone

Also not really related:

scutil --get|set LocalHostName|HostName|ComputerName

Warning: unloading DirectoryServices makes it impossible to sudo and thus prevents it from ever being loaded again unless there’s a root session open.

Why won’t /etc/gemrc work?

Because here’s how you find the actual config file

> require 'rubygems'
> Gem::ConfigFile::SYSTEM_WIDE_CONFIG_FILE
=> "/Library/Ruby/Site/gemrc"

source: http://stackoverflow.com/questions/6219668

for new Mac users

Lesson learned

Dev-mode Dashboard widgets weren’t showing up in all my Spaces so I tried to be smart and do this:

It wasn’t until a week later that I noticed a weird bug:

Unfortunately, by that time I had already forgotten about the first event. It took me about 2 hours of deleting and recreating the Library folder to various degrees of completeness (and doing binary search on the files in Preferences) to figure out that com.apple.spaces.plist was the culprit. Why in the world did it specify that Dock was supposed to show in all Spaces?

I’m stupid.