<?xml version="1.0" encoding="UTF-8"?>




<rss version="2.0"> <channel> <title>Evernote Openbook: lstoll&#039;s public notebook</title>
<link>http://www.evernote.com/pub/lstoll/public</link>
<description>Notes from lstoll&#039;s  Evernote Openbook: lstoll&#039;s public notebook</description> 

  
  <lastBuildDate>Mon, 10 Nov 2008 05:57:29 GMT</lastBuildDate>
 
  
  <item> <title>mirroring rubygems</title> <link>http://www.evernote.com/pub/lstoll/public#bddf86a8-c664-4667-b224-641c417d2514</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote">#!/bin/bash<br clear="none"/>#rsync -av rsync://rubyforge.rubyuser.de/gems/ /mirror/rubygems/gems/<br clear="none"/>#rsync -av rsync://rubyforge.rubyuser.de/files/ /mirror/rubygems/files/<br clear="none"/>/usr/local/bin/gem mirror<br clear="none"/>/usr/local/bin/gem generate_index -d /mirror/rubygems/rubyforge<br clear="none"/>/usr/local/bin/gem generate_index -d /mirror/rubygems/github<div><br clear="none"/></div><div><br clear="none"/></div><div>config in ~/.gemmirrorrc</div><div><br clear="none"/></div><div>root@bigguns:/mirror/rubygems# cat /var/www/.gemmirrorrc<br clear="none"/>---<br clear="none"/>- from: http://gems.github.com<br clear="none"/>  to: /mirror/rubygems/github/<br clear="none"/>- from: http://gems.rubyforge.org<br clear="none"/>  to: /mirror/rubygems/rubyforge/</div><div><br clear="none"/></div><div>You can specify the config file on the command line, but doesnt seem to work (as of 1.3.1 at least)<br clear="none"/><div><br clear="none"/></div><div><br clear="none"/></div><div><br clear="none"/></div><div>apache configs:</div><div><br clear="none"/></div><div>root@bigguns:/mirror/rubygems# cat /etc/apache2/sites-available/gems.rubyforge.org <br clear="none"/>&lt;VirtualHost *:80&gt;<br clear="none"/><br clear="none"/>ServerName gems.rubyforge.org<br clear="none"/><br clear="none"/>&lt;Directory /mirror/apt/mirror&gt;<br clear="none"/>Options Indexes FollowSymLinks MultiViews<br clear="none"/>AllowOverride None<br clear="none"/>Order allow,deny<br clear="none"/>allow from all<br clear="none"/>&lt;/Directory&gt;<br clear="none"/><br clear="none"/>DocumentRoot /mirror/rubygems/gems<br clear="none"/>&lt;/VirtualHost&gt;<br clear="none"/></div><div><br clear="none"/></div><div>&lt;VirtualHost *:80&gt;<br clear="none"/><br clear="none"/>ServerName gems.github.com<br clear="none"/><br clear="none"/>&lt;Directory /mirror/rubygems&gt;<br clear="none"/>Options Indexes FollowSymLinks MultiViews<br clear="none"/>AllowOverride None<br clear="none"/>Order allow,deny<br clear="none"/>allow from all<br clear="none"/>&lt;/Directory&gt;<br clear="none"/><br clear="none"/>DocumentRoot /mirror/rubygems/github<br clear="none"/>&lt;/VirtualHost&gt;<br clear="none"/></div><div><br clear="none"/></div><div><br clear="none"/></div><div><br clear="none"/></div><div><br clear="none"/></div><div>http://jonathan.tron.name/2008/05/23/creating-your-own-rubygem-mirror<br clear="none"/></div><div><br clear="none"/></div><div><br clear="none"/></div><div><br clear="none"/></div></div></div>
    
    ]]></description> <pubDate>Mon, 10 Nov 2008 05:57:29 GMT</pubDate> <guid>http://www.evernote.com/pub/lstoll/public#bddf86a8-c664-4667-b224-641c417d2514</guid> 
  
  </item>

  
  <item> <title>Passenger/Ruby Enterprise on 8.04</title> <link>http://www.evernote.com/pub/lstoll/public#45400ade-37d3-42ce-8cac-26b8c068c0b5</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote">App user: appuser<br clear="none"/><br clear="none"/>Gems required on client: capistrano, capistrano-ext, tinder<br clear="none"/><br clear="none"/>Deploy Environments:<br clear="none"/>        edge: master branch. (DEFAULT)<br clear="none"/>                - <br clear="none"/>        staging: production branch - for qa before going to prod. DB pull from prod, the migrate<br clear="none"/>                 - <br clear="none"/>        production: production branch. main site.<div><br clear="none"/></div><div>Using viget_deploy plugin for rsync strategy http://github.com/vigetlabs/viget_deployment</div><div><br clear="none"/></div><div>script/plugin install git://github.com/vigetlabs/viget_deployment.git</div><div><br clear="none"/></div><div>see page for config. Multistage stuff here: http://weblog.jamisbuck.org/2007/7/23/capistrano-multistage<br clear="none"/>                - <br clear="none"/>        <br clear="none"/>Server Software: Apache 2, Phusion Passenger 2.0RC2, MySQL, Ruby Enterprise, Ruby 1.8.6-p231, Rubygems 1.2.0<br clear="none"/><br clear="none"/>Notes: If you want to add gems to the rails app's environment, use /opt/<br clear="none"/><br clear="none"/>Cool things TODO: Some kind of CI magic. Sinatra app on Passenger Rack, called by github, pulls code, runs tests, emails results.<br clear="none"/><br clear="none"/>Commands run for setup:<br clear="none"/><br clear="none"/>apt-get update<br clear="none"/>apt-get upgrade<br clear="none"/><br clear="none"/>- Install firewall<br clear="none"/>apt-get install shorewall<br clear="none"/>cd /etc/shorewall<br clear="none"/>cp /usr/share/doc/shorewall-common/default-config/interfaces .<br clear="none"/>cp /usr/share/doc/shorewall-common/default-config/policy .<br clear="none"/>cp /usr/share/doc/shorewall-common/default-config/rules .<br clear="none"/>cp /usr/share/doc/shorewall-common/default-config/zones .<br clear="none"/>edit /etc/shorewall/interfaces<br clear="none"/>add &quot;net eth0 detect&quot;<br clear="none"/>edit nano /etc/shorewall/zones<br clear="none"/>add &quot;net ipv4&quot;<br clear="none"/>edit /etc/shorewall/policy<br clear="none"/>add &quot;fw net ACCEPT<br clear="none"/>net all DROP info<br clear="none"/>all all REJECT info&quot;<br clear="none"/>edit /etc/shorewall/rules<br clear="none"/>add &quot;ACCEPT net fw tcp 22<br clear="none"/>ACCEPT net fw tcp 80<br clear="none"/>Ping/ACCEPT net $FW&quot;<br clear="none"/>edit /etc/default/shorewall<br clear="none"/>change startup=0 to startup=1<br clear="none"/>/etc/init.d/shorewall start<br clear="none"/><br clear="none"/>- Install ruby<br clear="none"/></div><div>wget <a href="http://rubyforge.org/frs/download.php/41040/ruby-enterprise-1.8.6-20080810.tar.gz" shape="rect">http://rubyforge.org/frs/download.php/41040/ruby-enterprise-1.8.6-20080810.tar.gz</a><br clear="none"/>tar -zxvf ruby-enterprise-&lt;tab&gt;.tar.gz<br clear="none"/>cd ruby-enter&lt;tab&gt;</div><div>./installer</div><div><br clear="none"/></div><div>gem install passenger</div><div><br clear="none"/></div><div>passenger-install-apache2-module<br clear="none"/></div><div><br clear="none"/></div><div><b>update to match what is output:</b></div><div>echo &quot;LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-2.0.3/ext/apache2/mod_passenger.so&quot; &gt; /etc/apache2/mods-available/passenger.load<br clear="none"/>cat &gt;&gt; /etc/apache2/mods-availab...</div></div>
    
    ]]></description> <pubDate>Fri, 20 Feb 2009 04:14:19 GMT</pubDate> <guid>http://www.evernote.com/pub/lstoll/public#45400ade-37d3-42ce-8cac-26b8c068c0b5</guid> 
  
  </item>

  
  <item> <title>Clone a xen vm</title> <link>http://www.evernote.com/pub/lstoll/public#037e0af9-758d-4d2e-ae66-6ec639317874</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote">lvcreate -L5G -n tweedledone.railscamp.net-disk percvg0<br clear="none"/>dd bs=128M if=/dev/percvg0/base.railscamp.net-disk of=/dev/percvg0/tweedledone.railscamp.net-disk1<div>lvcreate -L1G -n tweedledone.railscamp.net-swap percvg0</div><div>mkswap /dev/percvg0/tweedledone.railscamp.net-swap</div><div>mount /dev/percvg0/tweedledone.railscamp.net-disk1 /mnt</div><div>nano /mnt/etc/hostname</div><div>nano /mnt/etc/network/interfaces<br clear="none"/></div><div>nano /mnt/etc/hosts</div><div>cp /etc/xen/base.railscamp.net.cfg /etc/xen/tweedledone.railscamp.net.cfg</div><div>nano /etc/xen/tweedledone.railscamp.net.cfg<br clear="none"/><div><br clear="none"/></div></div></div>
    
    ]]></description> <pubDate>Sun, 22 Jun 2008 04:20:02 GMT</pubDate> <guid>http://www.evernote.com/pub/lstoll/public#037e0af9-758d-4d2e-ae66-6ec639317874</guid> 
  
  </item>

  
  <item> <title>Rails deployment recipe (fixed)</title> <link>http://www.evernote.com/pub/lstoll/public#e32e3150-12a8-487b-a031-4a8d5e7227a3</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote"><br clear="none"/>This is the start of a 'new' rails deployment recipe on a server, using mod_rails/apache2.2/ubuntu - using a set user for the application, keys to deploy, deploying as your own user (i.e not the app user), and code on github.<br clear="none"/><br clear="none"/>Also using postgresql for the database, so let's get that gem working too.<br clear="none"/><br clear="none"/>Install pre-requisites (For Ubuntu 7.10):<br clear="none"/><br clear="none"/># Start a root shell<br clear="none"/>sudo -s<br clear="none"/><br clear="none"/># Apt install basic stuff<br clear="none"/>apt-get install apache2-mpm-prefork apache2 apache2-prefork-dev libapr1-dev zlib1g-dev libssl-dev libncurses5-dev libreadline5-dev build-essential git-core wget nano<br clear="none"/><br clear="none"/># Download and compile ruby and gems - sub in later versions if desired<br clear="none"/>mkdir -p /usr/local/src<br clear="none"/>cd /usr/local/src<br clear="none"/>wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6-p114.tar.gz<br clear="none"/>wget http://rubyforge.org/frs/download.php/35283/rubygems-1.1.1.tgz<br clear="none"/>tar -zxvf ruby-1.8.6-p114.tar.gz<div>cd ruby-1.8.6-p114</div><div>./configure --with-readline</div><div>make</div><div>make install</div><div>cd ..</div><div>tar -zxvf rubygems-1.1.1.tgz</div><div>cd rubygems-1.1.1</div><div>ruby setup.rb</div><div><br clear="none"/></div><div># ruby enterprise</div><div>cd ..<br clear="none"/>wget http://rubyforge.org/frs/download.php/38084/ruby-enterprise-1.8.6-20080507.tar.gz<br clear="none"/>tar -zxvf ruby-enterprise-1.8.6-20080507.tar.gz<br clear="none"/>./ruby-enterprise-1.8.6-20080507/installer<br clear="none"/></div><div><br clear="none"/></div><div># Install a few useful gems</div><div>gem install rake postgres daemons rails passenger</div><div>/opt/ruby-enterprise-1.8.6-20080507/bin/gem install rake postgres daemons rails passenger<br clear="none"/></div><div><br clear="none"/></div><div>### NOTE - this now leaves us with two ruby interpreters - a default system one at </div><div>/usr/local/bin/ruby</div><div><br clear="none"/></div><div>and the ruby enterprise one at</div><div>/opt/ruby-enterprise-1.8.6-20080507/bin/ruby<br clear="none"/></div><div><br clear="none"/></div><div># same for gems. remember this - and use the appropriate one. TODO - investigate making ruby enterprise the default system interpreter</div><div><br clear="none"/></div><div># MySQL (optional)</div><div>sudo apt-get install mysql-server libmysqlclient15-dev<br clear="none"/></div><div>/opt/ruby-enterprise-1.8.6-20080507/bin/gem install mysql<br clear="none"/></div><div><br clear="none"/></div><div># Install mod_railsgem install passenger</div><div>passenger-install-apache2-module</div><div><br clear="none"/></div><div># Setup a 'debian' scheme compatible module config</div><div>echo &quot;LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-1.0.5/ext/apache2/mod_passenger.so&quot; &gt; /etc/apache2/mods-available/rails.load<br clear="none"/><br clear="none"/>cat &gt;&gt; /etc/apac...</div></div>
    
    ]]></description> <pubDate>Sun, 22 Jun 2008 11:09:47 GMT</pubDate> <guid>http://www.evernote.com/pub/lstoll/public#e32e3150-12a8-487b-a031-4a8d5e7227a3</guid> 
  
  </item>

  
  <item> <title>Local macports setup</title> <link>http://www.evernote.com/pub/lstoll/public#8e1c0e42-bee7-4088-9c3e-1bbd7671b15f</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote">Install from download<br clear="none"/><br clear="none"/>sudo port sync &amp;&amp; sudo port selfupdate<br clear="none"/><br clear="none"/>sudo port install apache2 mysql5 +server php5 +apache2 +mysql5 ruby rb-rubygems rb-mysql subversion +tools wget<br clear="none"/><br clear="none"/>make my.cnf in /opt/local/etc/mysql5 look like this:<br clear="none"/><br clear="none"/>[mysqld]<br clear="none"/>default_storage_engine =  InnoDB<br clear="none"/>bind-address            = 127.0.0.1<br clear="none"/>datadir = /Users/databases/mysql<br clear="none"/><br clear="none"/>sudo mkdir -p /Users/databases/mysql <br clear="none"/>sudo chown -R mysql:mysql /Users/databases/mysql<br clear="none"/><br clear="none"/>sudo -u mysql mysql_install_db5<br clear="none"/><br clear="none"/>sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist<br clear="none"/><br clear="none"/>/opt/local/lib/mysql5/bin/mysqladmin -u root password 'new-password'<br clear="none"/># will not work, because we are only listening on 127.0.0.1 - here in case i change that<br clear="none"/>/opt/local/lib/mysql5/bin/mysqladmin -u root -h linc.local password 'new-password'<br clear="none"/><br clear="none"/>linc:/opt/local/etc/mysql5 lstoll$ mysql -u root -p<br clear="none"/>Enter password: <br clear="none"/>Welcome to the MySQL monitor.  Commands end with ; or \g.<br clear="none"/>Your MySQL connection id is 4<br clear="none"/>Server version: 5.0.45 Source distribution<br clear="none"/><br clear="none"/>Type 'help;' or '\h' for help. Type '\c' to clear the buffer.<br clear="none"/><br clear="none"/>mysql&gt; grant all on *.* to lstoll@'%' identified by 'password' with grant option;<br clear="none"/>Query OK, 0 rows affected (0.00 sec)<br clear="none"/><br clear="none"/>mysql&gt; flush privileges;<br clear="none"/>Query OK, 0 rows affected (0.00 sec)<br clear="none"/><br clear="none"/>cd /opt/local/apache2/modules<br clear="none"/>sudo cp /opt/local/etc/php.ini-dist /opt/local/etc/php.ini<br clear="none"/>sudo cp /opt/local/apache2/conf/httpd.conf.sample /opt/local/apache2/conf/httpd.conf<br clear="none"/>sudo /opt/local/apache2/bin/apxs -a -e -n &quot;php5&quot; libphp5.so<br clear="none"/>sudo launchctl load -w /Library/LaunchDaemons/org.macports.apache2.plist<br clear="none"/><br clear="none"/>Include conf/extras-conf/*.conf <br clear="none"/>Include /Users/lstoll/sw/etc/apache2/*.conf<br clear="none"/><br clear="none"/>in httpd.conf<br clear="none"/><br clear="none"/>sudo ln -s /opt/local/apache2/bin/apachectl /opt/local/bin/<br clear="none"/>sudo apachectl graceful<br clear="none"/><br clear="none"/><br clear="none"/>Install gems:<br clear="none"/><br clear="none"/>sudo gem install -y rake<br clear="none"/>sudo gem install -y rails<br clear="none"/>sudo gem install -y capistrano<br clear="none"/>sudo gem install -y mongrel<br clear="none"/>sudo gem install -y mongrel_cluster<br clear="none"/>sudo gem install -y ruby-debug-ide   # allows fast debug support in netbeans<br clear="none"/><br clear="none"/><br clear="none"/>sudo port install postgresql83 postgresql83-server<br clear="none"/>To create a database instance, after install do<br clear="none"/> sudo mkdir -p /Users/databases/postgres83/defaultdb<br clear="none"/> sudo chow...</div>
    
    ]]></description> <pubDate>Sun, 04 May 2008 08:31:59 GMT</pubDate> <guid>http://www.evernote.com/pub/lstoll/public#8e1c0e42-bee7-4088-9c3e-1bbd7671b15f</guid> 
  
  </item>

  
  <item> <title>UNIX Command Snippets</title> <link>http://www.evernote.com/pub/lstoll/public#00abac52-5a4a-4eee-9278-cd7800556704</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote">Each file:<br clear="none"/>for f in test/*tar*rb; do rbx -Ilib:test $f; done<br clear="none"/><br clear="none"/>ctrl-r - search previous commands</div>
    
    ]]></description> <pubDate>Sun, 04 May 2008 08:31:47 GMT</pubDate> <guid>http://www.evernote.com/pub/lstoll/public#00abac52-5a4a-4eee-9278-cd7800556704</guid> 
  
  </item>

  
  <item> <title>Rubinius Sprint Note</title> <link>http://www.evernote.com/pub/lstoll/public#5bb626c9-ad0d-41c6-82fc-136083e76998</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote">bin/mspec -t ruby will run under MRI<br clear="none"/><br clear="none"/>shotgun/ is the VM - C code.<br clear="none"/><br clear="none"/>kernel/ has the ruby code<br clear="none"/>In 'load' order:<br clear="none"/>kernel/bootstrap is the core functionality, <br clear="none"/>kernel/platform is the platform specific stuff - has a bunch for FFI calls to C<br clear="none"/>kernel/core/ is the rest of the ruby platform<br clear="none"/><br clear="none"/>benchmark/ has benchmarks<br clear="none"/><br clear="none"/>bin/ has scripts<br clear="none"/><br clear="none"/>stdlib/ is the ruby std lib imported from 1.8. when working, moved into<br clear="none"/>lib/ rubinius std lib<br clear="none"/><br clear="none"/>spec/ - rubinius specific specs<br clear="none"/>spec/ruby/1.8 - location for specs to test 1.8 behavior <br clear="none"/><br clear="none"/>READ README-DEVELOPERS!!<br clear="none"/><br clear="none"/>Backtrace color coding -<br clear="none"/>RED - Top - The error (where the raise was called)<br clear="none"/>BLUE - Kernel methods (i.e in kernel/)<br clear="none"/>NORMAL - User code<br clear="none"/><br clear="none"/>Object(Proc::Function)#should - the first item is the class where the method that was called comes from, in parentheses is the instance type<br clear="none"/>{} - says its in a block - __script__ is anonymous code (i.e method body)<br clear="none"/># - class method, . - instance method<br clear="none"/>A#dothing (blowup) - #dothing is the original method, (blowup) is the alias (I think.. confirm this)<br clear="none"/><br clear="none"/>Describe block must start with class.method<br clear="none"/><br clear="none"/>Example for file.umask<br clear="none"/><br clear="none"/>it &quot;invokes to_int on non-integer argument&quot; do<br clear="none"/>  (obj = mock(022)).should_receive(:to_int).any_number_of_times.and_return(022)<br clear="none"/>  File.umask(obj)<br clear="none"/>  File.umask(obj).should == 022<br clear="none"/>end<br clear="none"/><br clear="none"/>POSIX.umask(mask) changed to POSIX.umask(Integer(mask)) to ensure integer is passed it<br clear="none"/><br clear="none"/>run 'rake' to re-compile before running<br clear="none"/><br clear="none"/>git commit:<br clear="none"/>Commit messsage - first line, 70 chars, short explanation of the change<br clear="none"/>Empty line<br clear="none"/>(OPTIONAL - not for short/simple changes) - bulleted list of changes<br clear="none"/><br clear="none"/>git format-patch HEAD^  (makes a patch for the current location -1 rev - more carets is further back, or ~&lt;int&gt; for that many back)<br clear="none"/><br clear="none"/><br clear="none"/><br clear="none"/></div>
    
    ]]></description> <pubDate>Sun, 04 May 2008 08:31:27 GMT</pubDate> <guid>http://www.evernote.com/pub/lstoll/public#5bb626c9-ad0d-41c6-82fc-136083e76998</guid> 
  
  </item>

  
  <item> <title>Route-Based VPN From SSG to Billion Modem</title> <link>http://www.evernote.com/pub/lstoll/public#cfd56f3b-90e3-414b-9173-c5590c9d7157</link>
  <description><![CDATA[
    
    
    
        <a href="http://www.evernote.com/pub/lstoll/public#cfd56f3b-90e3-414b-9173-c5590c9d7157"><img align="right" src="http://www.evernote.com/shard/s1/thumb/cfd56f3b-90e3-414b-9173-c5590c9d7157"/></a>
        <div class="ennote"><p>SSG SIDE:
</p><p><br clear="none"/></p><p>NOTE: Looks like the tunnel interface must be seperate for any hub&amp;spoke links. Need to validate this.
</p><p><br clear="none"/></p><p>- Create a new zone on the SSG (need to have one for each vpn/gateway - i.e office is in office zone, lincs place is in lincs zone)</p><p><a class="en-ignore" href="http://www.evernote.com/shard/s1/res/fce5ede0-5476-4d05-9766-9ae9533f4cb3.tif" style="text-decoration: none; color:black;"></a></p><p><br clear="none"/></p><p>- Create a new tunnel interface for this vpn, bind it to the external interface
</p><p><a class="en-ignore" href="http://www.evernote.com/shard/s1/res/25781cfe-4f7b-459d-908a-20175f175e31.tif" style="text-decoration: none; color:black;"></a></p><p><br clear="none"/></p><p>- Create a new gateway
</p><p><a class="en-ignore" href="http://www.evernote.com/shard/s1/res/7d17abf4-bc3e-41fa-aa23-17b0e0bb0b35.tif" style="text-decoration: none; color:black;"></a></p><p>ADVANCED:
</p><p><a class="en-ignore" href="http://www.evernote.com/shard/s1/res/90525229-c8da-41c1-9797-b7bd33d3d010.tif" style="text-decoration: none; color:black;"></a></p><p>(Rest doesnt matter.. may want to enable NAT-T if the remote endpoint requires it)
</p><p><br clear="none"/></p><p>- Create a new IKE Auto-Key VPN
</p><p><a class="en-ignore" href="http://www.evernote.com/shard/s1/res/0519ecc3-e617-426b-ba19-b51b4bdadb35.tif" style="text-decoration: none; color:black;"></a></p><p><br clear="none"/></p><p>- In advanced, set a proxy ID for the local and remote networks, bind to the tunnel
</p><p><a class="en-ignore" href="http://www.evernote.com/shard/s1/res/d6e9f243-e21f-4b4b-8ca9-d54ae480a3e1.tif" style="text-decoration: none; color:black;"></a></p><p><br clear="none"/></p><p>- Create a policy to permit traffic down the VPN
</p><p>(Same as normal policy's, only for traffic required)
</p><p><br clear="none"/></p><p>- Network/Routing/Destination
</p><p>Create a new route down the tunnel interface for the remote network
</p><p><a class="en-ignore" href="http://www.evernote.com/shard/s1/res/95d88a1a-b9a4-4cdc-9af1-c1229ae10d08.tif" style="text-decoration: none; color:black;"></a></p><p><br clear="none"/></p><p><br clear="none"/></p><p>BILLION SIDE: Create a new IPSec VPN Entry:
</p><p><a class="en-ignore" href="http://www.evernote.com/shard/s1/res/0eef91a0-e03c-4b23-9e5d-963cd71156fc.tif" style="text-decoration: none; color:black;"></a></p></div>
    
    ]]></description> <pubDate>Sun, 04 May 2008 08:30:45 GMT</pubDate> <guid>http://www.evernote.com/pub/lstoll/public#cfd56f3b-90e3-414b-9173-c5590c9d7157</guid> 
  
    <enclosure url="http://www.evernote.com/shard/s1/thumb/cfd56f3b-90e3-414b-9173-c5590c9d7157"
               length="0" type="image/jpeg"/>
  
  </item>

  
  <item> <title>xen-create-image examples</title> <link>http://www.evernote.com/pub/lstoll/public#c04fcb82-9331-40ff-8784-2e859d741806</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote">sudo xen-create-image --hostname=gutsy32.dev.stripe.com --lvm=percvg0 --size=20Gb --swap=1gb --ip=172.16.104.244 --netmask=255.255.255.0 --gateway=172.16.104.1 --memory=512Mb --arch=i386 --kernel=/boot/vmlinuz-2.6.22-14-xen --initrd=/boot/initrd.img-2.6.22-14-xen --dist=gutsy --mirror=http://mirror.internode.on.net/pub/ubuntu/ubuntu/ --passwd --force <br clear="none"/><br clear="none"/><br clear="none"/>Unknown option: debootstrap  &lt;--- i.e don't need it in the command????<br clear="none"/>--force  &lt;-- be careful with this!<br clear="none"/><br clear="none"/><br clear="none"/><br clear="none"/>REF:<br clear="none"/><br clear="none"/>sudo xen-create-image --hostname=gutsy32.dev.stripe.com --lvm=percvg0 --size=20Gb --swap=1gb --ip=172.16.104.244 --netmask=255.255.255.0 --gateway=172.16.104.1 --force --memory=512Mb --arch=amd64 --kernel=/boot/vmlinuz-2.6.22-14-xen --initrd=/boot/initrd.img-2.6.22-14-xen --debootstrap --dist=dapper --mirror=http://mirror.internode.on.net/pub/ubuntu/ubuntu/ --passwd<div><br clear="none"/></div><div>sudo xen-create-image --hostname=enrico.railscamp.net --lvm=percvg0 --size=5G --swap=1gb --ip=172.16.104.201 --netmask=255.255.255.0 --gateway=172.16.104.1 --memory=256mb --arch=amd64 --kernel=/boot/vmlinuz-2.6.24-18-xen --initrd=/boot/initrd.img-2.6.24-18-xen --dist=hardy --mirror=http://172.16.104.251/ubuntu/main --passwd</div><div><br clear="none"/></div><div>sudo xen-create-image --hostname=railscamp.<a href="http://lstoll.net" shape="rect">lstoll.net</a> --dir=/xen-store --size=20Gb --swap=1gb --ip=172.16.2.3 --netmask=255.255.255.0 --gateway=172.16.2.1 --memory=512mb --arch=i386 --kernel=/boot/vmlinuz-2.6.24-19-xen --initrd=/boot/initrd.img-2.6.24-19-xen --dist=hardy --mirror=http://172.16.2.2:9999/ubuntu --passwd </div></div>
    
    ]]></description> <pubDate>Tue, 11 Nov 2008 07:18:40 GMT</pubDate> <guid>http://www.evernote.com/pub/lstoll/public#c04fcb82-9331-40ff-8784-2e859d741806</guid> 
  
  </item>

  
  <item> <title>Ubuntu network config</title> <link>http://www.evernote.com/pub/lstoll/public#bdee615d-6bfe-4940-b0c7-d4622792221e</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote"><a href="http://www.cyberciti.biz/tips/howto-ubuntu-linux-convert-dhcp-network-configuration-to-static-ip-configuration.html" shape="rect">Howto: Ubuntu Linux convert DHCP network configuration to static IP configuration</a><br clear="none"/><br clear="none"/>My friend wanted to know how to change or convert DHCP network configuration to static configuration. After initial installation, he wanted to change network settings. Further, his system is w/o GUI system aka X Windows. Here is quick way to accomplish the same:<br clear="none"/>Your main network configuration file is /etc/network/interfaces<br clear="none"/>Desired new sample settings:<br clear="none"/>=&gt; Host IP address 192.168.1.100<br clear="none"/>=&gt; Netmask: 255.255.255.0<br clear="none"/>=&gt; Network ID: 192.168.1.0<br clear="none"/>=&gt; Broadcast IP: 192.168.1.255<br clear="none"/>=&gt; Gateway/Router IP: 192.168.1.254<br clear="none"/>=&gt; DNS Server: 192.168.1.254<br clear="none"/>Open network configuration file<br clear="none"/>$ sudo vi /etc/network/interfaces<br clear="none"/>OR<br clear="none"/>$ sudo nano /etc/network/interfaces<br clear="none"/>Find and remove dhcp entry:<br clear="none"/>iface eth0 inet dhcp<br clear="none"/>Append new network settings:<br clear="none"/>iface eth0 inet static<br clear="none"/>address 192.168.1.100<br clear="none"/>netmask 255.255.255.0<br clear="none"/>network 192.168.1.0<br clear="none"/>broadcast 192.168.1.255<br clear="none"/>gateway 192.168.1.254<br clear="none"/><br clear="none"/>Save and close the file. Restart the network:<br clear="none"/>$ sudo /etc/init.d/networking restart<br clear="none"/><b>Task: Define new DNS servers</b><br clear="none"/>Open /etc/resolv.conf file<br clear="none"/>$ sudo vi /etc/resolv.conf<br clear="none"/>You need to remove old DNS server assigned by DHCP server:<br clear="none"/>search myisp.com<br clear="none"/>nameserver 192.168.1.254<br clear="none"/>nameserver 202.54.1.20<br clear="none"/>nameserver 202.54.1.30<br clear="none"/><br clear="none"/>Save and close the file.<br clear="none"/><b>Task: Test DNS server</b><br clear="none"/>$ host cyberciti.biz<br clear="none"/><b>Network command line cheat sheet</b><br clear="none"/>You can also use commands to change settings. Please note that these settings are temporary and not the permanent. Use above method to make network changes permanent or GUI tool as described below.<br clear="none"/><b>Task: Display network interface information</b><br clear="none"/>$ ifconfig<br clear="none"/><b>Task: Take down network interface eth0 / take a network interface down</b><br clear="none"/>$ sudo ifconfig eth0 down<br clear="none"/>OR<br clear="none"/>$ sudo ifdown eth0<br clear="none"/><b>Task: Bring a network interface eth0 up</b><br clear="none"/>$ sudo ifconfig eth0 up<br clear="none"/>OR<br clear="none"/>$ sudo ifup eth0<br clear="none"/><b>Task: Change IP address and netmask from command line</b><br clear="none"/>Activate network interface eth0 with a new IP (192.168.1.50) / netmask:<br clear="none"/>$ sudo ifconfig eth0 192.168.1.50 netmask 255.255.255.0 up<br clear="none"/><b>Task: Display the routing table</b><br clear="none"/>$ /sbin/route<br clear="none"/>OR<br clear="none"/>$ /sbin/route -n<br clear="none"/><br clear="none"/>Output:<br clear="none"/>Kernel IP routing table<br clear="none"/>Destination    ...</div>
    
    ]]></description> <pubDate>Sun, 04 May 2008 08:29:10 GMT</pubDate> <guid>http://www.evernote.com/pub/lstoll/public#bdee615d-6bfe-4940-b0c7-d4622792221e</guid> 
  
  </item>

  
  <item> <title>XEN HVM Clock issues (gutsy)</title> <link>http://www.evernote.com/pub/lstoll/public#d4f7ec7d-5f52-4bef-a978-910a87f12bdf</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote">VM's die under HVM XEN (esp. Windows)<br clear="none"/><br clear="none"/>the vm will die or hard lock on a feisty xen server because of clock issues<br clear="none"/><br clear="none"/>On the dom0, run the following:<br clear="none"/><br clear="none"/>sudo echo &quot;jiffies&quot; &gt; /sys/devices/system/clocksource/clocksource0/current_clocksource<br clear="none"/><br clear="none"/>May want to add to /etc/rc.local so it is fixed on boot.</div>
    
    ]]></description> <pubDate>Sun, 04 May 2008 08:28:52 GMT</pubDate> <guid>http://www.evernote.com/pub/lstoll/public#d4f7ec7d-5f52-4bef-a978-910a87f12bdf</guid> 
  
  </item>

  
  <item> <title>Create a windows XEN vm</title> <link>http://www.evernote.com/pub/lstoll/public#b5422943-9949-4a69-8953-dcdf5a33bd21</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote">Create a volume:<br clear="none"/><br clear="none"/>lvcreate -L40G -n dc1.prod.stripe.com_disk1 vg0<br clear="none"/><br clear="none"/>Create a new config file like this in /etc/xen/&lt;hostname&gt;.cfg<br clear="none"/><br clear="none"/>#  -*- mode: python; -*- <br clear="none"/>#============================================================================ <br clear="none"/># Python configuration setup for 'xm create'. <br clear="none"/># This script sets the parameters used when a domain is created using 'xm create'<br clear="none"/># You use a separate script for each domain you want to create, or <br clear="none"/># you can set the parameters for the domain on the xm command line. <br clear="none"/>#============================================================================ <br clear="none"/><br clear="none"/>## Do we really need this on ubuntu? its all lib, no lib64.<br clear="none"/>#import os, re <br clear="none"/>#arch = os.uname()[4] <br clear="none"/>#if re.search('64', arch): <br clear="none"/>#    arch_libdir = 'lib64' <br clear="none"/>#else: <br clear="none"/><br clear="none"/>#arch_libdir = 'lib' <br clear="none"/><br clear="none"/>#---------------------------------------------------------------------------- <br clear="none"/><br clear="none"/># Kernel image file. <br clear="none"/>kernel = &quot;/usr/lib/xen-ioemu-3.1/boot/hvmloader&quot; <br clear="none"/><br clear="none"/># The domain build function. HVM domain uses 'hvm'. <br clear="none"/>builder='hvm' <br clear="none"/><br clear="none"/># Initial memory allocation (in megabytes) for the new domain. <br clear="none"/>memory = 1024 <br clear="none"/><br clear="none"/># A name for your domain. All domains must have different names. <br clear="none"/>name = &quot;dc1.prod.stripe.com&quot; <br clear="none"/><br clear="none"/>#----------------------------------------------------------------------------- <br clear="none"/><br clear="none"/># the number of cpus guest platform has, default=1 <br clear="none"/>#vcpus=1 <br clear="none"/># enable/disable HVM guest ACPI, default=0 (disabled) <br clear="none"/>#acpi=1 <br clear="none"/># enable/disable HVM guest APIC, default=0 (disabled) <br clear="none"/>#apic=0 <br clear="none"/># Pae <br clear="none"/>#pae=1 <br clear="none"/># List of which CPUS this domain is allowed to use, default Xen picks <br clear="none"/>#cpus = &quot;&quot;         # leave to Xen to pick <br clear="none"/>#cpus = &quot;0&quot;        # all vcpus run on CPU0 <br clear="none"/>#cpus = &quot;0-3,5,^1&quot; # run on cpus 0,2,3,5 <br clear="none"/><br clear="none"/># Optionally define mac and/or bridge for the network interfaces. <br clear="none"/># Random MACs are assigned if not given. <br clear="none"/>vif = [ 'type=ioemu, bridge=xenbr0' ] <br clear="none"/><br clear="none"/># type=ioemu specify the NIC is an ioemu device not netfront <br clear="none"/>#vif = [ 'type=ioemu, mac=aa:00:b0:00:00:11, bridge=xenbr0' ] <br clear="none"/><br clear="none"/>#---------------------------------------------------------------------------- <br clear="none"/># Define the disk devices you want the domain to have access to, and <br clear="none"/># what you want them accessible...</div>
    
    ]]></description> <pubDate>Sun, 04 May 2008 08:28:33 GMT</pubDate> <guid>http://www.evernote.com/pub/lstoll/public#b5422943-9949-4a69-8953-dcdf5a33bd21</guid> 
  
  </item>

  
  <item> <title>Building a basic dev server/slice</title> <link>http://www.evernote.com/pub/lstoll/public#121361a2-6409-4161-8415-c784aaf101da</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote">Starting with a base Feisty machine.<br clear="none"/><br clear="none"/>h3. Getting base up and running, with remote access<br clear="none"/><br clear="none"/>su / login as root<br clear="none"/><br clear="none"/># bring up to date<br clear="none"/>bq. &lt;code&gt;apt-get update<br clear="none"/>&lt;code&gt;apt-get upgrade<br clear="none"/><br clear="none"/># set timezone, if not prompted above<br clear="none"/>tzconfig <br clear="none"/><br clear="none"/>install nano(use whatever editor you like), ssh, debian config stuff, screen, and locale/language info<br clear="none"/>bq. &lt;code&gt;apt-get install ssh openssh-server language-pack-en-base nano configure-debian screen<br clear="none"/><br clear="none"/>configure the system<br clear="none"/>bq. &lt;code&gt;configure-debian<br clear="none"/>in base, adduser set system wide readable home directories to no<br clear="none"/><br clear="none"/>add a user<br clear="none"/>bq. adduser lstoll<br clear="none"/>set their details here<br clear="none"/><br clear="none"/>set the user to have sudo rights<br clear="none"/>bq. visudo<br clear="none"/>add a line at the bottom like this:<br clear="none"/>bq. lstoll  ALL=(ALL) ALL<br clear="none"/><br clear="none"/># SSH in from a remote machine, and copy your ssh keys up<br clear="none"/>TODO - describe/link to this<br clear="none"/><br clear="none"/>back to the console of the machine you are setting up, edit the sshd config file<br clear="none"/>bq. nano /etc/ssh/sshd_config<br clear="none"/>change the &lt;code&gt;Port 22 entry to an alternate port (e.g &lt;code&gt;Port 1352&lt;/code&gt;)<br clear="none"/>change &lt;code&gt;PermitRootLogin yes to &lt;code&gt;PermitRootLogin no&lt;/code&gt;<br clear="none"/>change &lt;code&gt;PasswordAuthentication yes to &lt;code&gt;PasswordAuthentication no&lt;/code&gt; . THIS MEANS ONLY KEYS WILL GET YOU IN<br clear="none"/><br clear="none"/># restart ssh server<br clear="none"/>/etc/init.d/ssh restart<br clear="none"/><br clear="none"/>h3. Getting your session ready<br clear="none"/><br clear="none"/># End your terminal session. Log back in via ssh, with the user you created above<br clear="none"/><br clear="none"/># Start screen. that way, if you get disconnected, you can get back in<br clear="none"/>screen<br clear="none"/><br clear="none"/># If your ssh session drops out, just log back in, and run<br clear="none"/>screen -r<br clear="none"/><br clear="none"/># Start a root shell<br clear="none"/>sudo -s<br clear="none"/><br clear="none"/>h3. Setting up the postgresql database server<br clear="none"/><br clear="none"/>Install the database server app<br clear="none"/>&lt;code&gt;apt-get install postgresql-8.2 postgresql-client-8.2 libpq-dev&lt;/code&gt;<br clear="none"/><br clear="none"/>Configure some basic params<br clear="none"/><br clear="none"/>Edit /etc/postgresql/8.2/main/pg_hba.conf and change<br clear="none"/>&lt;code&gt;<br clear="none"/>local   all         all                               ident sameuser<br clear="none"/>&lt;/code&gt;<br clear="none"/>to<br clear="none"/>&lt;code&gt;<br clear="none"/>local   all         all                               md5<br clear="none"/>&lt;/code&gt;<br clear="none"/>(i.e force all non-postgres user logins to be via a md5'd password, rather than auto login)<br clear="none"/><br clear="none"/>Edit /etc/postgresql/8.2/main/postgresql.conf and change<br clear="none"/>&lt;code&gt;#password_encryption = on&lt;/code&gt;<br clear="none"/>to<br clear="none"/>&lt;code&gt;password_encry...</div>
    
    ]]></description> <pubDate>Mon, 26 Oct 2009 10:51:23 GMT</pubDate> <guid>http://www.evernote.com/pub/lstoll/public#121361a2-6409-4161-8415-c784aaf101da</guid> 
  
  </item>

  
  <item> <title>Ditch KVM and install XEN on hardy</title> <link>http://www.evernote.com/pub/lstoll/public#6e15aebf-7ce5-441a-82f7-5bab18cd9ff2</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote">After much debate, decided that KVM on ubuntu is too complex, and just doesn't feel reliable enough to use as a primary virtualization technology - things like not being able to switch a cdrom on a image is kinda sucky, and the libvirt tools don't feel finished. So maybe soon, but for now it's XEN - especially as it's more widely used. (The main driver for KVM was the fact that it's 'official' ubuntu).<div>Also moving back to LVM based VM's as opposed to image, so they can be snapshot'd individually, and not as a whole.</div><div><br clear="none"/></div><div># Kill the network bridge</div><div>edit /etc/network/interfaces, change back to this:</div><div>auto lo<br clear="none"/>iface lo inet loopback<br clear="none"/><br clear="none"/>auto eth0<br clear="none"/>iface eth0 inet static<br clear="none"/>        address 172.16.104.251<br clear="none"/>        network 172.16.104.0<br clear="none"/>        netmask 255.255.255.0<br clear="none"/>        broadcast 172.16.104.255<br clear="none"/>        gateway 172.16.104.1<br clear="none"/>        dns-nameservers 172.16.104.1<br clear="none"/></div><div><br clear="none"/></div><div>then /etc/init.d/networking restart</div><div><br clear="none"/></div><div><br clear="none"/></div><div># Remove kvm</div><div>sudo apt-get remove kvm libvirt-bin qemu python-virtinst bridge-utils uml-utilities</div><div>sudo apt-get autoremove</div><div><br clear="none"/></div><div>I had to reboot here. network stuff screwed up</div><div><br clear="none"/></div><div># Install xen</div><div>sudo apt-get update</div><div>sudo apt-get install ubuntu-xen-server xen-tools # N.B this install should work on a install upgraded to hardy - by default it will have 3.1, this should install 3.2<br clear="none"/></div><div><br clear="none"/></div><div>If this is an upgrade, you will get hit up to merge/keep/replace config files - I'm choosing to replace.</div><div><br clear="none"/></div><div>sudo nano /boot/grub/menu.lst - make sure the default is set to 'Xen 3.2 / Ubuntu 8.04, kernel 2.6.24-16-xen'</div><div><br clear="none"/></div><div>I needed two reboots after this for networking to come up correctly....</div><div><br clear="none"/></div><div># Fix old VMs</div><div>Mount the lvm root to /mnt/xxx</div><div>chroot to the mounted dir</div><div>apt-get install update-manager-core</div><div>do-release-upgrade # this failed for me - apt-get update &amp;&amp; apt-get upgrade finished the update</div><div><br clear="none"/></div><div>This is all bad - the update starts various things. Had to reboot to fix, so avoid this. If you update the kernel entries in the VM's config, it will boot - then do the upgrade. However, not booting - need to get the modules update. this is on the gutsy32 vm, which has a patch-job upgrade, and is 32 on 64.</div><div><br clear="none"/></div><div>Ok, further on - switchin...</div></div>
    
    ]]></description> <pubDate>Wed, 21 May 2008 07:40:36 GMT</pubDate> <guid>http://www.evernote.com/pub/lstoll/public#6e15aebf-7ce5-441a-82f7-5bab18cd9ff2</guid> 
  
  </item>

  
  <item> <title>Exchange certificates</title> <link>http://www.evernote.com/pub/lstoll/public#aa281e38-0692-4fa8-afaa-dea089caeb57</link>
  <description><![CDATA[
    
    
    
        <a href="http://www.evernote.com/pub/lstoll/public#aa281e38-0692-4fa8-afaa-dea089caeb57"><img align="right" src="http://www.evernote.com/shard/s1/thumb/aa281e38-0692-4fa8-afaa-dea089caeb57"/></a>
        <div class="ennote">with cacert. need to import cacert root into mmc/certificates/computer/personal and root<div><br clear="none"/></div><div>Need to use xchange to generate the request, the sign with cacert, and instal:</div><div><br clear="none"/></div><div>New-ExchangeCertificate -generaterequest -subjectname &quot;dc=net,dc=lstoll,o=lstoll.net,cn=exch.lstoll.net&quot; -domainname exch,exch.ad.lstoll.net,exch.lstoll.net,autodiscover.lstoll.net -PrivateKeyExportable $true -path c:\certrequest.txt<br clear="none"/><br clear="none"/><br clear="none"/>Import-ExchangeCertificate -Path c:\cert.txt -friendlyname &quot;exch.lstoll.net cert&quot;</div><div><br clear="none"/></div><div>then apply:</div><div><br clear="none"/></div></div>
    
    ]]></description> <pubDate>Sat, 26 Apr 2008 15:22:43 GMT</pubDate> <guid>http://www.evernote.com/pub/lstoll/public#aa281e38-0692-4fa8-afaa-dea089caeb57</guid> 
  
    <enclosure url="http://www.evernote.com/shard/s1/thumb/aa281e38-0692-4fa8-afaa-dea089caeb57"
               length="0" type="image/jpeg"/>
  
  </item>

  
  <item> <title>kvm on hardy</title> <link>http://www.evernote.com/pub/lstoll/public#17016568-5b9d-4b72-b0fe-0478923e1862</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote">sudo apt-get install libvirt-bin kvm qemu python-virtinst bridge-utils uml-utilitiessudo -s## BRIDGED NETWORKINGcp /etc/network/interfaces /etc/network/interfaces.baknano /etc/network/interfacesmake it look like this:auto lo<br clear="none"/>iface lo inet loopback<br clear="none"/><br clear="none"/>auto br0<br clear="none"/>iface br0 inet static<br clear="none"/>        address 172.16.104.251<br clear="none"/>        network 172.16.104.0<br clear="none"/>        netmask 255.255.255.0<br clear="none"/>        broadcast 172.16.104.255<br clear="none"/>        gateway 172.16.104.1<br clear="none"/>        dns-nameservers 172.16.104.1<br clear="none"/>        bridge_ports eth0<br clear="none"/>        bridge_fd 9<br clear="none"/>        bridge_hello 2<br clear="none"/>        bridge_maxage 12<br clear="none"/>        bridge_stp off<br clear="none"/><br clear="none"/><br clear="none"/>/etc/init.d/networking restart<br clear="none"/>#Create the VM (windows_virt-install --name=exch.lstoll.net --ram=1024 --file=/vm/exch.lstoll.net_root.img --file-size=40 --nonsparse --network=bridge:br0 --vnc --connect=qemu:///system --accelerate -c Windows_Server_2003_Standard_x64.iso --os-type=windows --os-variant=win2k3 --vcpus=2 --check-cpu<br clear="none"/>and you'll get an error like this:Sat, 26 Apr 2008 12:42:16 ERROR    'virtio_blk'<br clear="none"/>Traceback (most recent call last):<br clear="none"/>  File &quot;/usr/bin/virt-install&quot;, line 519, in &lt;module&gt;<br clear="none"/>    main()<br clear="none"/>  File &quot;/usr/bin/virt-install&quot;, line 438, in main<br clear="none"/>    guest, hvm, conn)<br clear="none"/>  File &quot;/usr/bin/virt-install&quot;, line 134, in get_disks<br clear="none"/>    disk, size)<br clear="none"/>  File &quot;/usr/bin/virt-install&quot;, line 133, in &lt;lambda&gt;<br clear="none"/>    map(lambda d, s: get_disk(d, s, sparse, guest, hvm, conn),<br clear="none"/>  File &quot;/usr/bin/virt-install&quot;, line 108, in get_disk<br clear="none"/>    d.virtio = guest.get_virtio_blk()<br clear="none"/>  File &quot;/usr/lib/python2.5/site-packages/virtinst/FullVirtGuest.py&quot;, line 206, in get_virtio_blk<br clear="none"/>    return FullVirtGuest.OS_TYPES[self.os_type][&quot;virtio_blk&quot;]<br clear="none"/>KeyError: 'virtio_blk'<br clear="none"/>so:apt-get install build-essential debhelper cdbs python-all-dev fakerootexit root shellcd ~ ; mkdir src ; cd srcapt-get source python-virtinstwget http://launchpadlibrarian.net/13887057/221746.diffcd virtinst-0.300.2/patch -p1 &lt; ../221746.diffsudo dpkg-buildpackage -rfakeroot -uc -bsudo dpkg -i ../python-virtinst_0.300.2-0ubuntu6_all.deb## NOTE - the previous should be obsolete soon, update will hit the repositores.virt-install --name=exch.lsto...</div>
    
    ]]></description> <pubDate>Sat, 26 Apr 2008 08:37:02 GMT</pubDate> <guid>http://www.evernote.com/pub/lstoll/public#17016568-5b9d-4b72-b0fe-0478923e1862</guid> 
  
  </item>

  
  <item> <title>Move a rails app to jruby (postgres, glassfish v3)</title> <link>http://www.evernote.com/pub/lstoll/public#65e22a66-6577-468a-9143-76e437391ba1</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote">Have an existing rails app. want to move to jruby, for the 'fastest' runtime possible. means jndi/jdbc for db. want to use glassfish gem for dev (to be close to prod), and glassfish v3 for prod.<div><br clear="none"/></div><div>Install gems:</div><div>jruby -S gem install <b>jdbc</b>-postgres <b>activerecord</b>-<b>jdbcpostgresql</b>-<b>adapter rails rake </b>glassfish<br clear="none"/></div><div><br clear="none"/></div><div><br clear="none"/></div><div>Update database.yml:</div><div><br clear="none"/></div><div>from:</div><div>development:<br clear="none"/>  adapter: postgresql <br clear="none"/>  encoding: unicode<br clear="none"/>  database: services_dev<br clear="none"/>  username: xxx<br clear="none"/>  password: xxx<br clear="none"/>  host: localhost<br clear="none"/>  port: 5432</div><div><br clear="none"/></div><div>to:</div><div><br clear="none"/></div><div>development:<br clear="none"/>  adapter: jdbcpostgresql<br clear="none"/>  encoding: unicode<br clear="none"/>  database: services_dev<br clear="none"/>  username: xxxx<br clear="none"/>  password: xxxx<br clear="none"/>  host: localhost<br clear="none"/>  port: 5432</div><div><br clear="none"/></div><div>try:  </div><div><br clear="none"/></div><div>jruby -S glassfish_rails .</div><div><br clear="none"/></div><div>and your app should be up on 3000. that was easy.</div><div><br clear="none"/></div><div>Now we need to </div><div><br clear="none"/></div></div>
    
    ]]></description> <pubDate>Tue, 22 Apr 2008 04:50:19 GMT</pubDate> <guid>http://www.evernote.com/pub/lstoll/public#65e22a66-6577-468a-9143-76e437391ba1</guid> 
  
  </item>

  
  <item> <title>Kill a process after a certain amount of time.</title> <link>http://www.evernote.com/pub/lstoll/public#c6cc792c-9b28-4bc2-afd0-3a49b760a6af</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote">Good way to run a process for a certain amount of time, like killing a rsync before peak download time kicks in.<div><br clear="none"/></div><div>rake sync_rubygems &amp; sleep 20 ; kill $!</div></div>
    
    ]]></description> <pubDate>Thu, 17 Apr 2008 15:10:26 GMT</pubDate> <guid>http://www.evernote.com/pub/lstoll/public#c6cc792c-9b28-4bc2-afd0-3a49b760a6af</guid> 
  
  </item>

  
  <item> <title>Rails deployment recipe</title> <link>http://www.evernote.com/pub/lstoll/public#92bcac1c-c087-441b-b3f3-f01d4afa6e9d</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote">This page contains the following errors:<div>error on line 1 at column 130: Entity 'nbsp' not defined
</div>Below is a rendering of the page up to the first error.<br clear="none"/>Rails deployment recipe<br clear="none"/>4/16/2008, 9:32 PM Tags:  rails,   deployment   Permalink   <br clear="none"/>This is the start of a 'new' rails deployment recipe on a server, using mod_rails/apache2.2/ubuntu - using a set user for the application, keys to deploy, deploying as your own user (i.e not the app user), and code on github.<br clear="none"/><br clear="none"/>Also using postgresql for the database, so let's get that gem working too.<br clear="none"/><br clear="none"/>Install pre-requisites (For Ubuntu 7.10):<br clear="none"/><br clear="none"/># Start a root shell<br clear="none"/>sudo -s<br clear="none"/><br clear="none"/># Apt install basic stuff<br clear="none"/>apt-get install apache2-mpm-prefork apache2 apache2-prefork-dev libapr1-dev zlib1g-dev libssl-dev libncurses5-dev libreadline5-dev build-essential git-core<br clear="none"/><br clear="none"/># Download and compile ruby and gems - sub in later versions if desired<br clear="none"/>mkdir -p /usr/local/src<br clear="none"/>cd /usr/local/src<br clear="none"/>wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6-p114.tar.gz<br clear="none"/>wget http://rubyforge.org/frs/download.php/35283/rubygems-1.1.1.tgz<br clear="none"/>tar -zxvf ruby-1.8.6-p114.tar.gzcd ruby-1.8.6-p114./configure --with-readlinemakemake installcd ..tar -zxvf rubygems-1.1.1.tgzcd rubygems-1.1.1ruby setup.rb# Install a few useful gemsgem install rake postgres daemons# Install mod_railsgem install passengerpassenger-install-apache2-module# Setup a 'debian' scheme compatible module configecho &quot;LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-1.0.1/ext/apache2/mod_passenger.so&quot; &gt; /etc/apache2/mods-available/rails.load<br clear="none"/><br clear="none"/>cat &gt;&gt; /etc/apache2/mods-available/rails.conf &lt;&lt; EOF<br clear="none"/>RailsSpawnServer /usr/local/lib/ruby/gems/1.8/gems/passenger-1.0.1/bin/passenger-spawn-server<br clear="none"/>RailsRuby /usr/local/bin/ruby<br clear="none"/>EOF# enable the modulea2enmod rails# create a directory for the applicationmkdir -p /srv/rails/services# Create the apache log dir for the appmkdir -p /srv/rails/services/apachelog# Create a deployment groupaddgroup appdeploy# change the services dir group and set permschgrp appdeploy /srv/rails/serviceschmod g+rw /srv/rails/services# create a user and gro...</div>
    
    ]]></description> <pubDate>Thu, 12 Jun 2008 07:39:24 GMT</pubDate> <guid>http://www.evernote.com/pub/lstoll/public#92bcac1c-c087-441b-b3f3-f01d4afa6e9d</guid> 
  
  </item>

  
  <item> <title>Welcome</title> <link>http://www.evernote.com/pub/lstoll/public#3e429e74-ef7b-4243-91f4-4beef37a7d33</link>
  <description><![CDATA[
    
    
    
        
        <div class="ennote">This is my public evernote notebook. Think of it as a unformatted, always draft blog.</div>
    
    ]]></description> <pubDate>Wed, 16 Apr 2008 11:25:37 GMT</pubDate> <guid>http://www.evernote.com/pub/lstoll/public#3e429e74-ef7b-4243-91f4-4beef37a7d33</guid> 
  
  </item>
 </channel> </rss>