<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Avanim Tech Articles</title>
    <link>http://avanim.org/tech//tech-rss/</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Tech RSS feed for articles on avanim.org</description>
    
      
        <item>
          <title>My git config</title>
          <description>&lt;pre&gt;
[user]
  email = avonderluft at avlux dot net
  name = Andrew vonderLuft
[alias]
  a = add
  ai = add -i
  b = branch
  br = branch
  co = checkout
  c = commit
  ca = commit -a
  cp = cherry-pick
  count = count-objects
  f = fetch
  h = help
  lf = ls-files
  l = log
  logs = log --oneline --graph --decorate --all
  ls = log --oneline --graph --decorate --all
  m = merge
  plam = pull avonderluft master
  psam = push avonderluft master
  plom = pull origin master
  psom = push origin master
  rem = remote
  rh = reset --hard
  shbr = show-branch
  s = status
  st = status
# Just for fun
  down = pull origin master # so I can type: 'git down' now and then
  back = reset --hard # 'to where you once belonged...'  
[apply]
  whitespace = nowarn
[github]
  user = avonderluft
  token = xxxxxxxxxxxxxxxxxxxxxxxxxxxx
[color]
  status = auto
  branch = auto
  ui = true
&lt;/pre&gt;</description>
          <pubDate>Mon, 09 Aug 2010 16:41:00 GMT</pubDate>
          <guid>http://avanim.org/tech/my-git-config/</guid>
          <link>http://avanim.org/tech/my-git-config/</link>
        </item>
      
        <item>
          <title>Radiant and conflicting versions of Rspec</title>
          <description>&lt;p&gt;If you are developing sites for more than one version of Radiant, you may run into version incompatibility issues with Rspec.  For example, Radiant 0.7.1 requires Rspec 1.1.12, and Radiant 0.9 requires later versions.  In order to use the appropriate version for each of your projects, you need to unpack the gems into the proper location of your project.&lt;/p&gt;
&lt;p&gt;The following example assumes that your project is Radiant 0.7.1; that you have frozen radiant into your project; and that you have installed the 1.1.12 versions of rspec and rspec-rails.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cd RAILS_ROOT/vendor/radiant/vendor/plugins
gem unpack rspec -v 1.1.12
mv rspec-1.1.12 rspec
gem unpack rspec-rails -v 1.1.12
mv rspec-rails-1.1.12 rspec-rails&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now your specs will run in your 0.7.1 project, and your projects with later versions of Radiant will use the most recent version of the rspec and rspec-rails gems which you have installed.&lt;/p&gt;
&lt;p&gt;Q.E.D.&lt;/p&gt;
&lt;h3&gt;Notes for other Rails apps&lt;/h3&gt;
&lt;ul&gt;
	&lt;li&gt;The same thing applies for a standard Rails app, you just unpack the gems into /vendor/plugins&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Notes for TextMate users&lt;/h3&gt;
&lt;p&gt;If you want to use the TextMate RSpec Bundle to run your specs:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;the RSpec bundle will look in vendor/plugins for your unpacked gems, so create symlinks:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;cd RAILS_ROOT/vendor/plugins
ln -s ../../vendor/radiant/vendor/plugins/rspec
ln -s ../../vendor/radiant/vendor/plugins/rspec-rails
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
	&lt;li&gt;Make sure your version of RSpec.tmbundle is compatible with the version of RSpec you are running, e.g. I&amp;#8217;m using this git commit on my Radiant 0.7.1 projects, which require RSpec 1.1.12 &amp;#8211; 5d2551c0265b709bd13e7731e7f36cc5b8ecc57f&lt;/li&gt;
&lt;/ul&gt;</description>
          <pubDate>Fri, 02 Jul 2010 20:20:00 GMT</pubDate>
          <guid>http://avanim.org/tech/radiant-and-conflicting-versions-of-rspec/</guid>
          <link>http://avanim.org/tech/radiant-and-conflicting-versions-of-rspec/</link>
        </item>
      
        <item>
          <title>Installing mysql gem on OSX Snow Leopard</title>
          <description>With Rails 2.2, the bundled mysql.rb driver has been removed, so if you haven't installed the mysql gem before, you will have to do so now.  To save yourself a lot of trial and error, try this first:

&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;sudo env ARCHFLAGS=&lt;span class=&quot;string&quot;&gt;&lt;span class=&quot;delimiter&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;content&quot;&gt;-arch x86_64&lt;/span&gt;&lt;span class=&quot;delimiter&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; gem install --no-rdoc --no-ri mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
</description>
          <pubDate>Thu, 13 May 2010 16:55:28 GMT</pubDate>
          <guid>http://avanim.org/tech/installing-mysql-gem-on-osx-snow-leopard/</guid>
          <link>http://avanim.org/tech/installing-mysql-gem-on-osx-snow-leopard/</link>
        </item>
      
        <item>
          <title>Set TextMate's default file type</title>
          <description>&lt;p&gt;Let&amp;#8217;s say you want all new files to open as Textile, you would follow this sequence of shell commands:&lt;/p&gt;
&lt;pre&gt;
$ cd /Applications/TextMate.app/Contents/SharedSupport/Bundles/Textile.tmbundle/Syntaxes
$ plutil -convert xml1 Textile.plist
$ grep -A1 uuid Textile.plist

&amp;lt;key&amp;gt;uuid&amp;lt;/key&amp;gt;
&amp;lt;string&amp;gt;68F0B1A5-3274-4E85-8B3A-A481C5F5B194&amp;lt;/string&amp;gt;
&lt;/pre&gt;
&lt;p&gt;This is just an example.  If you wanted all your new files to open as Ruby, then you would use Ruby.tmbundle/Syntaxes on the first command, and Ruby.plist on the 2nd and 3rd.&lt;/p&gt;
&lt;p&gt;But here‚ or the Textile example, 68F0B1A5-3274-4E85-8B3A-A481C5F5B194 is the &lt;span class=&quot;caps&quot;&gt;UUID&lt;/span&gt;. Now we tell Textmate to use that as default by altering its defaults database.&lt;/p&gt;
&lt;p&gt;Quit TextMate, then from terminal run:&lt;/p&gt;
&lt;pre&gt;
$ defaults write com.macromates.textmate OakDefaultLanguage 68F0B1A5-3274-4E85-8B3A-A481C5F5B194
&lt;/pre&gt;
&lt;p&gt;Start TextMate, and notice how all new documents are set to be Textile by default.&lt;/p&gt;</description>
          <pubDate>Tue, 06 Apr 2010 22:21:00 GMT</pubDate>
          <guid>http://avanim.org/tech/set-textmates-default-file-type/</guid>
          <link>http://avanim.org/tech/set-textmates-default-file-type/</link>
        </item>
      
        <item>
          <title>MySQL backups on your Mac</title>
          <description>&lt;p&gt;Time Machine is truly a slick and useful tool for maintaining regular backups on your Mac.  However if you ever need to restore a MySQL database, trying to do it with Time Machine alone involves a fair bit of ugly hackery, like overriding default MySQL permissions as root on your backup drive, and attempting to restore with raw files rather than cleanly with a mysql load.  To make this better, simply create a dbdumps directory which will be backed up by Time Machine, and set up the following script to run daily MySQL dumps on your databases.  Then if you need to restore, use Time Machine to restore the dumpfile you want, and execute the dumpfile with mysql.  Of course you can do this from the shell with something like:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;mysql -u &amp;lt;user&amp;gt; --password=&amp;lt;pass&amp;gt; -h localhost -D &amp;lt;database&amp;gt; &amp;lt; &amp;lt;path_to_dbdumps&amp;gt;/dumpfile.sql&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;But if you prefer &lt;span class=&quot;caps&quot;&gt;GUI&lt;/span&gt;-ness, &lt;a href=&quot;http://www.sequelpro.com/&quot;&gt;Sequel Pro&lt;/a&gt; has a very nice import command.&lt;/p&gt;
&lt;p&gt;Here is the bash script:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;#!/bin/bash
#--------------------------------------------------------------------------
# Daily MySQL dump on OSX to use in conjuction with Time Machine
#
# 1) Save this file in some appropriate location like /usr/sbin/dbbackup.sh
# 2) Make sure it is executable:  sudo chmod +x /usr/sbin/dbbackup.sh
# 3) Create the backup directory:  mkdir ~/dbdumps
# 4) Create the cron entry to run it daily by executing the following:
#    sudo echo &amp;quot;47 5 * * * /usr/sbin/dbbackup.sh&amp;quot; &amp;gt;&amp;gt; /usr/lib/cron/tabs/root
#    (This will run the script at 05:47 am each day)
#
# December 2009, Andrew vonderLuft.  http://avlux.net
#--------------------------------------------------------------------------

# Edit these values for your local configuration
CMD_DUMP=/usr/local/mysql/bin/mysqldump
MYSQLDIR=/usr/local/mysql/data
BACKUPDIR=/Users/avonderluft/dbdumps
MYSQLUSER=&amp;quot;admin&amp;quot;
MYSQLPASS=&amp;quot;********&amp;quot;

ls -1 $MYSQLDIR | while read db;
do
  if [ -d $MYSQLDIR/$db ]; then
    echo -n dumping MySQL database $db ...
    $CMD_DUMP -u $MYSQLUSER --password=$MYSQLPASS $db &amp;gt; $BACKUPDIR/$db.sql;
    echo done.
  fi
done&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;</description>
          <pubDate>Thu, 17 Dec 2009 18:46:00 GMT</pubDate>
          <guid>http://avanim.org/tech/mysql-backups-on-your-mac/</guid>
          <link>http://avanim.org/tech/mysql-backups-on-your-mac/</link>
        </item>
      
        <item>
          <title>View Rails log in script/console</title>
          <description>&lt;p&gt;This is very helpful, especially for things like debugging generated &lt;span class=&quot;caps&quot;&gt;SQL&lt;/span&gt; statements, and it is simple to enable.&lt;/p&gt;
&lt;p&gt;Simply find (or create) the .irbrc file in your home directory, and add the following:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;comment&quot;&gt;# Log to STDOUT if in Rails&lt;/span&gt;
&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;predefined-constant&quot;&gt;ENV&lt;/span&gt;.include?(&lt;span class=&quot;string&quot;&gt;&lt;span class=&quot;delimiter&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;content&quot;&gt;RAILS_ENV&lt;/span&gt;&lt;span class=&quot;delimiter&quot;&gt;'&lt;/span&gt;&lt;/span&gt;) &amp;amp;&amp;amp; !&lt;span class=&quot;constant&quot;&gt;Object&lt;/span&gt;.const_defined?(&lt;span class=&quot;string&quot;&gt;&lt;span class=&quot;delimiter&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;content&quot;&gt;RAILS_DEFAULT_LOGGER&lt;/span&gt;&lt;span class=&quot;delimiter&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)
   require &lt;span class=&quot;string&quot;&gt;&lt;span class=&quot;delimiter&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;content&quot;&gt;logger&lt;/span&gt;&lt;span class=&quot;delimiter&quot;&gt;'&lt;/span&gt;&lt;/span&gt;
   &lt;span class=&quot;constant&quot;&gt;RAILS_DEFAULT_LOGGER&lt;/span&gt; = &lt;span class=&quot;constant&quot;&gt;Logger&lt;/span&gt;.new(&lt;span class=&quot;predefined-constant&quot;&gt;STDOUT&lt;/span&gt;)
&lt;span class=&quot;keyword&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;</description>
          <pubDate>Thu, 08 Oct 2009 17:46:00 GMT</pubDate>
          <guid>http://avanim.org/tech/view-rails-log-in-scriptconsole/</guid>
          <link>http://avanim.org/tech/view-rails-log-in-scriptconsole/</link>
        </item>
      
        <item>
          <title>Watch on OSX</title>
          <description>&lt;p&gt;&amp;#8216;watch&amp;#8217; is a great command-line utility that Linux SysAdmins have come to know and love.  It allows you to monitor the output from any command, like &amp;#8216;top&amp;#8217; does for processes, refreshing every -n seconds (2 seconds by default).  For example, if you wanted to watch pages being cached on a rails site, you could:&lt;/p&gt;
&lt;pre&gt;
$ cd &amp;lt;RAILS_ROOT&amp;gt;
$ watch ls -R cache/
&lt;/pre&gt;
&lt;p&gt;which would show you something like:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
Every 2.0s: ls -R cache/                                                    Mon Feb 16 14:18:18 2009&lt;/p&gt;
&lt;p&gt;cache/:&lt;br /&gt;
about.data&lt;br /&gt;
about.yml&lt;br /&gt;
styles.css.data&lt;br /&gt;
styles.css.yml&lt;br /&gt;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;So, you want to do this on your mac as you develop rails sites?&lt;/p&gt;</description>
          <pubDate>Mon, 16 Feb 2009 22:28:00 GMT</pubDate>
          <guid>http://avanim.org/tech/watch-on-osx/</guid>
          <link>http://avanim.org/tech/watch-on-osx/</link>
        </item>
      
        <item>
          <title>AVLUX is now hosting Radiant</title>
          <description>&lt;p&gt;It is indeed a pleasure to support John, Sean and the rest of of the team of committers to &lt;a href=&quot;http://radiantcms.org&quot;&gt;Radiant&lt;/a&gt; by hosting their site.  For those who don&amp;#8217;t know, Radiant is the fast and elegant &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt; built with Ruby on Rails, which is used by the &lt;a href=&quot;http://ruby-lang.org&quot;&gt;Ruby site&lt;/a&gt; itself.&lt;/p&gt;
&lt;p&gt;You can read John&amp;#8217;s announcment &lt;a href=&quot;http://radiantcms.org/blog/archives/2008/02/28/avlux-is-now-hosting-the-main-radiant-site/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;</description>
          <pubDate>Fri, 29 Feb 2008 00:13:00 GMT</pubDate>
          <guid>http://avanim.org/tech/avlux-is-now-hosting-radiant/</guid>
          <link>http://avanim.org/tech/avlux-is-now-hosting-radiant/</link>
        </item>
      
        <item>
          <title>Lithp Thycles</title>
          <description>&lt;p&gt;&lt;img src=&quot;http://imgs.xkcd.com/comics/lisp_cycles.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;from &lt;a href=&quot;http://xkcd.com&quot;&gt;xkcd.com&lt;/a&gt;&lt;/p&gt;</description>
          <pubDate>Thu, 02 Aug 2007 17:53:00 GMT</pubDate>
          <guid>http://avanim.org/tech/lithp-thycles/</guid>
          <link>http://avanim.org/tech/lithp-thycles/</link>
        </item>
      
        <item>
          <title>Hi, I'm Ruby on Rails...</title>
          <description>&lt;div&gt;
&lt;p&gt;&lt;object width=&quot;425&quot; height=&quot;350&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/PQbuyKUaKFo&quot;&gt;&lt;/param&gt;&lt;param name=&quot;wmode&quot; value=&quot;transparent&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/PQbuyKUaKFo&quot; type=&quot;application/x-shockwave-flash&quot; wmode=&quot;transparent&quot; width=&quot;425&quot; height=&quot;350&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;
&lt;/div&gt;</description>
          <pubDate>Mon, 14 May 2007 23:39:00 GMT</pubDate>
          <guid>http://avanim.org/tech/hi-im-ruby-on-rails/</guid>
          <link>http://avanim.org/tech/hi-im-ruby-on-rails/</link>
        </item>
      
    
  </channel>
</rss>


