Author: farhan

PostgreSQL not starting after Yosemite upgrade?

You had brewed PostgreSQL and can’t get it to start after the Yosemite upgrade? Check the logs and see if you get the following error.

1
FATAL:  could not open directory "pg_tblspc": No such file or directory

If so, then you need to create a few directories that went missing as part of the upgrade.

1
2
cd /usr/local/var/postgres
mkdir pg_tblspc pg_twophase pg_stat_tmp

After running the above commands try starting PostgreSQL and it should start. Thanks to this Stack Overflow post for the details.

The most unknown iphone feature: Undo!

The Undo dialog

There is a 90% chance that you don’t know about this. The iPhone has an undo feature! If you accidentally make a change that you would like to undo (e.g. deleting some text) then you can get it back by literally shaking the phone!

See this post for an animation.

iPhone 6

Upgrading an End of Life Ubuntu Release

I had a Ubuntu on an older end-of-life (EOL) release that I hadn’t had a chance to upgrade. I finally took the time tonight to upgrade it, but starting out I start getting 404 errors because of the EOL status. Here are my notes for upgrading an EOL Ubuntu from 12.10 to 14.04.1.

  1. Update all references in /etc/apt/sources.lst and replace http://archive.ubuntu.com or http://us.archive.ubuntu.com with http://old-releases.ubuntu.com
  2. apt-get update
  3. apt-get upgrade
  4. do-release-upgrade
  5. Rinse and repeat for 13.10 to 14.04.1

Spark Core

Spark Core

I just bought a Spark Core for a personal project to monitor some devices around the house. This thing is awesome as it makes it really easy to interface with hardware based devices. I went for the Maker Kit because it comes with a few common sensors and motors known to easily work with the Spark Core. Time to start brushing up on my electronics skills.

OS X 10.9.3 update resets Play Button iTunes Patch

Apple released the 10.9.3 update recently and I noticed that it installed a new version of rcd, breaking the Play Button iTunes Patch. If you experience this, please delete the backup first and then run the patch so it uses the most recent file. To delete the previous backup use the following command.

rm /System/Library/CoreServices/rcd.app/Contents/MacOS/rcd_backup*

And then run the patch.

Wow, a swelled MacBook Pro battery

The batter after I disconnected it.

A few days ago I noticed that the trackpad on my older (mid-2010 model) MacBook Pro was a little “raised.” Not making a big deal of it I started using it, but after using it for half an hour I noticed it actually started rising. At that point I knew that something was not right. So I quickly unplugged it, turned it off and opened the bottom plate to see what may be going on. I was really surprised to see that the battery had bloated and was almost twice the size that it should have been.

Read full post...

Lol, “A Conference Call in Real Life”

I thought this was a hilarious video that depicted conference calls very well. Enjoy! 🙂

Setting baud rate in Cisco Catalyst 3750 switch

I recently accidentally messed up a Cisco 3750 switch while upgrading the firmware on it. I ended up with a non-booting switch with the typical fast flashing SYST light. After finding a computer old enough with a serial port I got to uploading the .bin image, but the at the default baud rate of 9600 the 12M or so bin file would have take quite some time. After searching on google I found out that the following IOS command would set a higher baud rate.

1
set BAUD 115200

Still not fast enough, but an improvement. Some people have suggested using tftpdnld in rommon mode, but this was fast enough that I didn’t want to deal with rommon.

Remember to reset the baud rate after you are done.

1
set BAUD 9600

Updated Play Button iTunes Patch

I have published an updated version of the Play Button iTunes Patch that now correctly kills the remote control daemon after patching it. Thanks to @quicksnap for helping troubleshoot. Here is a link to the issue on github.

tmux and Example Config

I am a big fan of the tmux terminal multiplexer when SSH’ing into any hosts. Definitely check it out if you don’t know about it. By default tmux is pretty bare, but you can use my current .tmux.conf as a reference. The configuration file below will essentially create labels for each terminal showing the currently running program.

Example output produced by my .tmux.conf

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
set-option -g default-terminal "xterm-256color"
#set-option -g default-terminal "screen-256color"

set-option -g status-fg white
set-option -g status-bg black
#set-option -g status-bg white

set-option -g prefix C-a
bind-key C-a last-window

#set-window-option -g mode-mouse on

setw -g window-status-current-attr underscore

set -g status-keys vi
setw -g mode-keys vi