<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8001168223646975539</id><updated>2011-12-24T04:06:10.259-08:00</updated><category term='linux'/><category term='VMware Fusion'/><category term='snow leopard'/><category term='psycopg2'/><title type='text'>Contest Clash is an Anagram</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://contestclash.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8001168223646975539/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://contestclash.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Scott</name><uri>http://www.blogger.com/profile/15979653958648881988</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8001168223646975539.post-5586763618471865649</id><published>2009-10-01T10:00:00.000-07:00</published><updated>2009-10-01T10:36:06.251-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='snow leopard'/><category scheme='http://www.blogger.com/atom/ns#' term='VMware Fusion'/><title type='text'>Setup a virtual linux server in VMware Fusion</title><content type='html'>Instead of worrying about getting my environment setup exactly right in Snow Leopard, I kind of gave up and decided to try and set up a linux server as a virtual machine in VMware fusion.  The first time I tried to do this, it didn't work at all - I could install the system, but as far as I could tell there were no VMware tools for linux. (Or were there?)  Well there are now.&lt;br /&gt;&lt;br /&gt;First download ubuntu 9.04 desktop 32-bit as an .img. Create a new vm in Fusion, pick linux/ubuntu/etc. Point the install to your .img file.  Install and wait.   Once it is running, choose "Install VMware Tools" from the menu. Stuff will start happening, all of it good.  At this point, you might want to get updates.  One of those updates is an updated kernel.  Get 'em.  Once the system restarts, all the VMware Tools are broken. No problem - choose Install VMware Tools again.  It will show up as a drive on the ubuntu desktop, but you'll have to install from the .tar.  Open up a terminal and follow &lt;a href="http://www.vmware.com/support/ws5/doc/ws_newguest_tools_linux.html#wp1118025"&gt;these instructions.&lt;/a&gt;  New stuff will compile against the new headers for the new kernel - things are happening and all of it is good.&lt;br /&gt;&lt;br /&gt;Your linux guest networking is setup as NAT by default.  Leave it like this.  But to access it like another machine on the network, it would be nice if it weren't DHCP and the IP address didn't change all the time.  No problem.  Go to System/Preferences/Network Connections.  Select "Auto eth0" and click Edit.  Authenticate.  Go to IPv4 Settings.  Change from Automatic (DHCP) to Manual.  Add an Address and enter in: Address: 192.168.177.100, Netmask: 255.255.255.0, Gateway: 192.168.177.2.  For DNS Servers type in 192.168.177.2.  OK.  You might have to disconnect and reconnect networking on the guest.  You are done.  The subnet 192.168.177 looks like the default for Fusion.  You can check your defaults in the file (on the Mac) /Library/Application Support/VMware Fusion/vmnet8/dhcpd.conf.&lt;br /&gt;&lt;br /&gt;To give your new 192.168.177.100 a name, edit the /etc/hosts file on your mac.  Then you can ssh into it easily from the terminal on the Mac.  Make sure you install sshd in the linux guest.&lt;br /&gt;&lt;br /&gt;For an extra bonus, you can enable "headless" mode in Fusion.  In a terminal (on the host mac):&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;defaults write com.&lt;/span&gt;&lt;em style="font-family: courier new;"&gt;vmware&lt;/em&gt;&lt;span style="font-family: courier new;"&gt;.&lt;/span&gt;&lt;em style="font-family: courier new;"&gt;fusion&lt;/em&gt;&lt;span style="font-family: courier new;"&gt; fluxCapacitor -bool YES&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The next time your run fusion, the menu item "Enter Headless" will appear in the view menu.  Look &lt;a href="http://communities.vmware.com/docs/DOC-1201"&gt;here&lt;/a&gt; for the full details.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8001168223646975539-5586763618471865649?l=contestclash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://contestclash.blogspot.com/feeds/5586763618471865649/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://contestclash.blogspot.com/2009/10/setup-virtual-linux-server-in-vmware.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8001168223646975539/posts/default/5586763618471865649'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8001168223646975539/posts/default/5586763618471865649'/><link rel='alternate' type='text/html' href='http://contestclash.blogspot.com/2009/10/setup-virtual-linux-server-in-vmware.html' title='Setup a virtual linux server in VMware Fusion'/><author><name>Scott</name><uri>http://www.blogger.com/profile/15979653958648881988</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8001168223646975539.post-6150473096950640263</id><published>2009-09-25T09:58:00.000-07:00</published><updated>2009-09-25T18:47:42.391-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='snow leopard'/><category scheme='http://www.blogger.com/atom/ns#' term='psycopg2'/><title type='text'>Building psycopg2 on Snow Leopard</title><content type='html'>After installing snow leopard, my development environment seemed to continue to run without fuss - postgresql8.4, postgis, geos, proj - all built from source using the standard ./configure make sudo make install sequence.  Then I decided to update postgis and rebuild.  OK, now we have some problems - under snow leopard, everything is built as x86_64 instead of i386.  No big deal, shouldn't be a problem -  just rebuild everything, right?  Sure, all is still well.  But now psycopg2 doesn't work at all, even after rebuilding.    The problem is this - psycopg2 builds an .so file that references libpq.dylib, the interface to postgres.  That .dylib file, after rebuilding postgres in snow leopard is now an x86_64 library.  You can check this using the "file" command.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;$ file /usr/local/pgsql/lib/libpq.5.2.dylib&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;libpq.5.2.dylib: Mach-O 64-bit dynamically linked shared library x86_64&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When you build psycopg2 using setup.py, that .so file is built for ppc and i386, but not for x86_64.  There's a warning at the end of the build telling you that architectures don't match, but you might not notice the first time around.  You'll find out when trying to run django, or just importing psycopg2 from the python prompt.  You'll get a stack trace for an exception and at the end it will say:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Symbol not found: _PQbackendPID.  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;_PQbackendPID is most certainly there in the .dylib.  No really, it is, it's just that the architectures don't match up, so loading the library failed.&lt;br /&gt;&lt;br /&gt;I found &lt;a href="http://swag.dk/blog/2009/09/03/building-postgresql8x-x86_64-i386-snow-leopard/"&gt;another solution&lt;/a&gt; for this that used a patch to the macports Portfile to create a universal binary of postgresql, but you know what?  I don't want to start mucking up my system with macports when installing from source is so easy.  I wanna keep it simple.&lt;br /&gt;&lt;br /&gt;Here's how to do it:&lt;br /&gt;&lt;br /&gt;Go to your postgresql source directory (I'm assuming you've built it once already).&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;$ make clean&lt;br /&gt;$ CFLAGS="-arch i386" LDFLAGS="-arch i386" ./configure&lt;br /&gt;$ make&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Copy the libpq dylib to some temporary location and rename it:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;$ cp src/interfaces/libpq/libpq.5.2.dylib ~/libpq_i386.dylib&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now go back and make the x86_64 version again:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;$ make clean&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;$ ./configure&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;$ make&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now use lipo to make a dylib that has multiple architectures:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;$ lipo libpq_i386.dylib src/interfaces/libpq/libpq.5.2.dylib -create -output ~/libpq.5.2.dylib&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Now check it:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;$ file ~/libpq.5.2.dylib&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It should say:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;libpq.5.2.dylib: Mach-O universal binary with 2 architectures&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;libpq.5.2.dylib (for architecture i386):    Mach-O dynamically linked shared library i386&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;libpq.5.2.dylib (for architecture x86_64):    Mach-O 64-bit dynamically linked shared library x86_64&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now copy the file to the pgsql installation.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;$ sudo cp ~/libpq.5.2.dylib /usr/local/pgsql/lib/&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You are done.  You can now run python and import psycopg2, or run django, or whatever.  It works.  And you don't have to use macports.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8001168223646975539-6150473096950640263?l=contestclash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://contestclash.blogspot.com/feeds/6150473096950640263/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://contestclash.blogspot.com/2009/09/building-psycopg2-on-snow-leopard.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8001168223646975539/posts/default/6150473096950640263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8001168223646975539/posts/default/6150473096950640263'/><link rel='alternate' type='text/html' href='http://contestclash.blogspot.com/2009/09/building-psycopg2-on-snow-leopard.html' title='Building psycopg2 on Snow Leopard'/><author><name>Scott</name><uri>http://www.blogger.com/profile/15979653958648881988</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8001168223646975539.post-8317178173759440390</id><published>2009-08-29T16:08:00.000-07:00</published><updated>2009-08-29T20:49:12.028-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='snow leopard'/><title type='text'>Snow Leopard all good so far</title><content type='html'>I upgraded my MacBook Pro this morning to 10.6 "snow leopard" and so far all is well.  The most important feature for me was the MS Exchange support in Mail.  No, I didn't want to have to install Entourage.  So finally I have all my email accounts in one place.  I'd say that was worth the $29.&lt;br /&gt;&lt;br /&gt;The other pleasant thing I noticed is that I suddenly have a lot more hard drive space.  I *think* I have another 10 GB now, but it might be more, like 20.  I don't know for sure because I didn't check before installing.  All I know is that I have more space, and that's the opposite of what everyone has come to expect from an upgrade - I assume though that a lot of it is ejecting all the code that supported the G4/G5, etc.  (Is that it?)&lt;br /&gt;&lt;br /&gt;Not so good is the built-in VPN support, which doesn't support IPSec over UDP.  Needed to reinstall the CiscoVPN Client, and everything was back to normal.   VMWare Fusion is working perfectly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8001168223646975539-8317178173759440390?l=contestclash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://contestclash.blogspot.com/feeds/8317178173759440390/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://contestclash.blogspot.com/2009/08/snow-leopard-all-good-so-far.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8001168223646975539/posts/default/8317178173759440390'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8001168223646975539/posts/default/8317178173759440390'/><link rel='alternate' type='text/html' href='http://contestclash.blogspot.com/2009/08/snow-leopard-all-good-so-far.html' title='Snow Leopard all good so far'/><author><name>Scott</name><uri>http://www.blogger.com/profile/15979653958648881988</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
