Monday, February 20, 2012

Installing PostgreSQL on Lion with Brew

I had some issues with Python when trying to upgrade PostgreSQL install on OSX Lion.

Basically the configure script is saying that my system version of Python doesn't have 64-bit support.

Warning: Detected a framework Python that does not have 64-bit support in:
/Library/Frameworks/Python.framework/Versions/Current/Python

To fix this issue, you may need to either delete the version of Python shown above, or move it out of the way before brewing PostgreSQL.


I don't like those solutions very much, and I don't need Python support in Postgres anyway. To get around the problem and build Postgres without Python support at all, just...

brew upgrade --no-python postgresql

Muskets at dawn!

Wednesday, January 25, 2012

Bundler invalid byte sequence

Running "bundle install" today gave me...

ArgumentError: invalid byte sequence in US-ASCII

Normally I use Terminal.app but I recently switched to iTerm as I'm finding it is quite a bit faster, so this little issue caught me out. iTerm doesn't enable UTF-8 by default.


Adding this to ~/.bash_profile will set it no matter what terminal app you're using.

export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8

Thursday, July 8, 2010

Rolling Back iPhone iOS4 to iPhone iOS3

Installing iPhone iOS4 on my iPhone 3G and it was a big mistake for me. My iPhone instantly changed from a lovely, responsive device, to one that was taking 15-20 seconds to start up the SMS or Mail applications.


The list of issues I had with iOS4 was long and uncomfortable enough to force me into deciding to rollback to iOS3.


  • Slow to start applications
  • Applications are generally slow and unresponsive
  • Camera app was slow to start, and slow to take a picture
  • 3G network access became unreliable
  • Lockups and freezing requiring restarts

It was slow and buggy enough that I hated using my phone at all. I didn't get this phone to become the owner of a useless brick.


Waiting for the first update to iOS4 seemed like a lame idea. Who knows how many of the issues would be addressed anyway?


iTunes won't directly allow you to rollback to a previous OS just by choosing a backup that was on that OS version. It doesn't downgrade the operating system, it only restores the data.


Trying to restore an earlier firmware explicitly in iTunes got close, but also failed.


It turns out there is one more step needed to make the rollback work... RecBoot. @pjammer sent me a link to a YouTube video showing how to rollback to iOS3, which worked a treat.


After restoring the earlier firmware you will receive an error message telling you the OS could not be restored and you should choose one of your backups to restore from. Running RecBoot at this point in time allows you to take you phone out of recovery mode.... to find the firmware of your choice running.


You can then restore your data or setup for a new phone.


Victory!


Guess what? My iPhone 3G is fast again. I'll be researching very cautiously before attempting another upgrade to iOS4.

Wednesday, June 30, 2010

Installing Postgres gem on Snow Leopard

I had to jump through a small hoop to install the postgres gem on Snow Leopard so I'm putting it here to help others out. Hopefully it saves you some time.


Basic System


  • Ruby 1.8.7
  • Macports
  • OSX 10.6 (Snow Leopard)

Install Postgresql


# sudo port install postgresql84-server

Install the Postgres Gem


# sudo env ARCHFLAGS="-arch x86_64" gem install postgres -- --with-pgsql-lib=/opt/local/lib/postgresql84 --with-pgsql-include=/opt/local/include/postgresql84

Monday, April 26, 2010

Mishca's Mothers En Vogue Photoshoot

Mishca had a photoshoot for Mothers En Vogue on Nov 25th 2009.

She went really well considering she was such a shy little girl just a few months ago :)

Well done Mishca!

Sunday, April 25, 2010

Facebook Makes More Of Your Data Available Again

Facebook is once again making more of your data available without your permission.

I was very disappointed to see that I was suddenly opt-ed in to basically sharing everything about me, and allowing my friends to also share this information about me. I never gave my explicit permission to do this. I'm sure it is entirely covered by their Terms and Conditions.

At a minimum, Facebook should have asked users what their preference was, but chose not to do so. This is an extremely deceptive practice, somewhat similar to lying by omission.

Yes, I am aware I can change the settings. I also know most people won't because they don't care, are too lazy, or just do not understand how much they are "sharing".

I also love how giving away your personal information is called "sharing" now. How very, "double-speak" of Facebook. To be fair Facebook aren't the only social networks that shares you information to their partners.

As an individual that still has dreams of privacy I simply do not like where this is going. I was hesitant about joining Facebook to begin with because I could see the depth the data that would allow information seekers to build very detailed profiles on each of us. I even deactivated my Facebook account once before giving in and re-activating it.

So, I'll announce it to the world...

I will be deleting my account on or before 25 May 2010, using Facebook's Delete my Account page.

Deep down I am not at all surprised by the direction Facebook is going with this. My lack of surprise also reminds me that although I was quite sure it would get to this point it was a stupid decision ever choosing to believe it could would have been any different.

Bye bye Facebook. It has been... educational.

Links

Monday, January 18, 2010

Howto Install Ruby 1.8 and RubyGems from source on Debian

In the latest addition to the, "Howto Install stuff from Source on Debian", series, this post shows how to install Ruby 1.8 and RubyGems from source on Debian.

This installation has been tested out successfully on Debian Lenny, and Debian Etch. It should also work on Ubuntu.

Permissions

As noted in my last post, my user has write permissions to /usr/local/src so I don'thave to run everything under sudo. This was accomplished by allowing the staff group to write to /usr/local/src , giving write access to the staff group, and adding my user to the "staff" group.

If you would like to set this up...

# sudo chown root:staff /usr/local/src
# sudo chmod 775 /usr/local/src
# sudo usermod -a -G staff your_username

If you were not previously a member of the staff group you will need to logout and login again, or just open a new shell, for the changes to take effect.

Install

A browser friendly version of the script can be seen at http://gist.github.com/271029.

Once again, I've leveraged gist as a tool to store my installation scripts.

The script is just a wrapper to install the necessary Debian packages. This script then downloads a second script which actually downloads, configures, and install Ruby 1.8 and RubGems.

Not only is gist a very useful tool, but I've also found GitHub to be an excellent online git repository.

The scripts use the "Raw" versions of the gists.

To install, run these commands...

# wget http://gist.github.com/raw/271029/d16c8acf620047b88e509ccab205959681fd443d/install_ruby18_on_debian.sh
# chmod a+x ./install_ruby18_on_debian.sh
# ./install_ruby18_on_debian.sh

If all goes well, Ruby and RubyGems will have been installed.

# which ruby
/usr/local/bin/ruby

# ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [i686-linux]

# which gem
/usr/local/bin/gem

# gem -v
1.3.5

Enjoy Ruby!

Other Posts in this Series

Friday, January 15, 2010

Install Nginx from source on Debian

I thought it was time to write a followup post to, Install Memcached from source on Debian Lenny.

At this moment, Debian provides Nginx 0.6.39 and I was wanting to run Nginx 0.7. The latest stable version is 0.7.64, so I thought I would put together a script to automate the download and installation for me.

Some devoted Debian users will want to string me up for installing a source package, and some others will no doubt say that I'm hating Debian for not using aptitude. These people are entitled to their opinion of course, but I don't feel that there is anything wrong with installing a source package on Debian.

If you feel like installing a package from source makes Debian cry, leave now :)


Monday, December 14, 2009

Install Memcached from source on Debian Lenny

Debian is quite simply excellent, and I wouldn't even consider running any other distro in production anymore.

Occasionally though, there are packages that become a bit outdated, and a source install is needed.

For me, Memcached is one of those packages. The latest in the Debian Lenny Apt repositories is 1.2.2, but the latest stable build is actually 1.4.4. Good luck seeing that in the stable apt repositories anytime soon :)

So, to make life easy, I've put together a fairly simple bash script that downloads and installs Memcached, and libevent, for you.

The script is a blunt instrument, and assumes...

  1. You haven't installed memcached from apt repositories on this machine
  2. You won't be sad when it puts config and startup files at
    • /etc/memcached.conf
    • /etc/init.d/memcached
    • /usr/share/memcached/scripts/start-memcached

Thursday, December 10, 2009

Fix POST for Ruby 1.9.1 and Passenger

How exciting! A new Ruby release to play with.

I figured it was time to migrate this particular app to 1.9.1 on the integration server. We've been developing this app with 1.9 and all looks good.

So I...

  • Upgraded Nginx to version 0.7.64
  • Installed Ruby 1.9.1-p376
  • Installed Passenger 2.2.7
  • Configured Nginx to use the new versions of Ruby and Passenger
  • ... and restarted Nginx

I hit the home page of the app.... Sweet, it works! Yay!

At this point I did a minor happy dance. Nothing over the top, you know... just a little wiggle :)

Then I tried to login to the app... "500 Internal Server Error"

Oh. :(

I stopped dancing right there.

It turns out that POST requests fail for Ruby 1.9.1 and Passenger.

Fortunately, there is a patch.

Patching tempfile.rb did the trick. On that particular machine, tempfile.rb was located at /usr/local/lib/ruby19/1.9.1/tempfile.rb

Thanks to Ryan Bigg for confirming the fix is good.