<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blog.ubrious &#187; Nix</title>
	<atom:link href="http://blog.ubrio.us/category/nix/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ubrio.us</link>
	<description>An Ordinary Web Developer's Blog</description>
	<lastBuildDate>Thu, 19 Jan 2012 00:44:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>OSX, RubyGems and cross-thread violations in rb_gc</title>
		<link>http://blog.ubrio.us/nix/osx-rubygems-and-cross-thread-violations-in-rb_gc/</link>
		<comments>http://blog.ubrio.us/nix/osx-rubygems-and-cross-thread-violations-in-rb_gc/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 15:37:40 +0000</pubDate>
		<dc:creator>Rob Hurring</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Nix]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[gems]]></category>

		<guid isPermaLink="false">http://blog.ubrio.us/?p=104</guid>
		<description><![CDATA[I recently decided to migrate away from OSX&#8217;s default ruby install yesterday and noticed a few quirky hangups. Firstly, for some reason, and I&#8217;m not sure if it is just me or not, OSX&#8217;s default $PATH variable is putting /usr/local/bin AFTER /bin making your local installs not enabled by default. (Editing the /etc/paths didn&#8217;t do [...]]]></description>
			<content:encoded><![CDATA[<p>I recently decided to migrate away from OSX&#8217;s default ruby install yesterday and noticed a few quirky hangups. Firstly, for some reason, and I&#8217;m not sure if it is just me or not, OSX&#8217;s default $PATH variable is putting /usr/local/bin AFTER /bin making your local installs not enabled by default. (Editing the /etc/paths didn&#8217;t do the trick so I manually added it to PATH).</p>
<p>The installation went easily for both ruby gems and ruby, but I decided to take a &#8217;short cut&#8217; and copy all my gems from /Library/Ruby/Gems into my /usr/local/lib directory which started raising all kinds of errors &#8212; this one, in particular was obnoxious.</p>
<p><code>[BUG] cross-thread violation on rb_gc()</code></p>
<p>Luckily, all that means is that I copied over gems which were compiled against the standard OSX ruby version and not the new one. This was a little script I wrote which will show you which gems need to be re-compiled. Just <tt>cd</tt> over to your /usr/local/lib/ruby/gems/1.8/gems directory and run:</p>
<p><code><span>gems $></span>ls -1 **/**/*.bundle|ruby -pe '$_.gsub! /\-.*/, ""'|uniq</code></p>
<p>to get a list, or pipe that into <code><span>$></span> sudo gem install</code> and that should clear up those gc issues.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ubrio.us/nix/osx-rubygems-and-cross-thread-violations-in-rb_gc/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Subversion Info in Ruby / Rails</title>
		<link>http://blog.ubrio.us/code/subversion-info-in-ruby-rails/</link>
		<comments>http://blog.ubrio.us/code/subversion-info-in-ruby-rails/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 15:34:51 +0000</pubDate>
		<dc:creator>Rob Hurring</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Nix]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://blog.ubrio.us/?p=98</guid>
		<description><![CDATA[I was trying to tag a few of my internal apps with a subversion revision number just for personal reference. Since running the command svn info yields YAML-ish output the ruby YAML library can load it. Sweet. The next step was just wrapping it in a class and creating some instance variables and methods for [...]]]></description>
			<content:encoded><![CDATA[<p>I was trying to tag a few of my internal apps with a subversion revision number just for personal reference. Since running the command <code>svn info</code> yields YAML-ish output the ruby YAML library can load it. Sweet. The next step was just wrapping it in a class and creating some instance variables and methods for them.</p>
<h3>The default YAML output</h3>
<p>This is what you will get if you simply throw the YAML.load result to an array or something. Nice, but I&#8217;m not a big fan of &#8220;Keys Like This&#8221; so&#8230;</p>
<pre class="brush: ruby;">
irb(main):011:0&gt; pp YAML.load(`svn info`)
{&quot;Node Kind&quot;=&gt;&quot;directory&quot;,
 &quot;Last Changed Author&quot;=&gt;&quot;rob&quot;,
 &quot;URL&quot;=&gt;&quot;http://example.com/share/lib&quot;,
 &quot;Schedule&quot;=&gt;&quot;normal&quot;,
 &quot;Last Changed Rev&quot;=&gt;441,
 &quot;Repository UUID&quot;=&gt;&quot;0afc494f-e74d-0410-99f2-b94b27995134&quot;,
 &quot;Repository Root&quot;=&gt;&quot;http://example.com&quot;,
 &quot;Last Changed Date&quot;=&gt;&quot;2008-07-15 15:55:54 -0400 (Tue, 15 Jul 2008)&quot;,
 &quot;Revision&quot;=&gt;446,
 &quot;Path&quot;=&gt;&quot;.&quot;}
=&gt; nil
</pre>
<h3>A nice class wrapper for the SVN Info</h3>
<p>Heres what I ended up with. Nothing fancy, just a simple wrapper around the subversion info dump.</p>
<pre class="brush: ruby;">
require 'yaml'
class SVNInfo
  def initialize
      YAML.load(`svn info`).each do |k,v|
          key = k.gsub(/\s/, '_').downcase
          instance_variable_set &quot;@#{key}&quot;, v
          instance_eval %{ def #{key}; @#{key}; end }
      end
  end
end
</pre>
<p><strong>Here is the end result:</strong></p>
<pre class="brush: ruby;">
irb(main):013:0&gt; svn_info = SVNInfo.new
# ... snip ...
irb(main):014:0&gt; pp svn_info
&lt;SVNInfo:0x57f378
 @last_changed_author=&quot;rob&quot;,
 @last_changed_date=&quot;2008-07-15 15:55:54 -0400 (Tue, 15 Jul 2008)&quot;,
 @last_changed_rev=441,
 @node_kind=&quot;directory&quot;,
 @path=&quot;.&quot;,
 @repository_root=&quot;http://example.com&quot;,
 @repository_uuid=&quot;0afc494f-e74d-0410-99f2-b94b27995134&quot;,
 @revision=446,
 @schedule=&quot;normal&quot;,
 @url=&quot;http://example.com/share/lib&quot;&gt;
=&gt; nil
irb(main):015:0&gt;
</pre>
<p><strong>Messing Around</strong></p>
<pre class="brush: ruby;">
irb(main):018:0&gt; pp svn_info.methods - Object.methods
[&quot;last_changed_author&quot;,
 &quot;revision&quot;,
 &quot;repository_root&quot;,
 &quot;last_changed_rev&quot;,
 &quot;path&quot;,
 &quot;url&quot;,
 &quot;node_kind&quot;,
 &quot;last_changed_date&quot;,
 &quot;repository_uuid&quot;,
 &quot;schedule&quot;]
=&gt; nil
irb(main):019:0&gt; svn_info.revision
=&gt; 446
irb(main):020:0&gt; svn_info.last_changed_author
=&gt; &quot;rob&quot;
irb(main):021:0&gt;
</pre>
<p>Hope that comes in handy <img src='http://blog.ubrio.us/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ubrio.us/code/subversion-info-in-ruby-rails/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>History Meme</title>
		<link>http://blog.ubrio.us/code/history-meme/</link>
		<comments>http://blog.ubrio.us/code/history-meme/#comments</comments>
		<pubDate>Tue, 13 May 2008 00:40:20 +0000</pubDate>
		<dc:creator>Rob Hurring</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Nix]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[bored]]></category>

		<guid isPermaLink="false">http://blog.ubrio.us/?p=97</guid>
		<description><![CDATA[Took the idea from Dive Into Mark because I&#8217;m bored.   
If you&#8217;re curious to see which commands you use the most just run:
$>history &#124; awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' &#124; sort -rn &#124; head

# local server
133 l
70 cd
47 svn
38 ..
29 e
26 mv
20 ll
10 rm
10 cp
8 ror

# remote server
123 l
74 cd
35 [...]]]></description>
			<content:encoded><![CDATA[<p>Took the idea from <a href='http://diveintomark.org/archives/2008/04/15/history-meme' onclick="pageTracker._trackPageview('/outgoing/diveintomark.org/archives/2008/04/15/history-meme?referer=');">Dive Into Mark</a> because I&#8217;m bored. <img src='http://blog.ubrio.us/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p>If you&#8217;re curious to see which commands you use the most just run:</p>
<p><code><span>$></span>history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head</code></p>
<pre>
# local server
133 l
70 cd
47 svn
38 ..
29 e
26 mv
20 ll
10 rm
10 cp
8 ror

# remote server
123 l
74 cd
35 svn
31 touch
26 ..
23 exit
23 cat
20 ll
18 rm
16 rake
</pre>
<h4>A few notes</h4>
<p>here are those goofy aliases that you see:</p>
<pre>
alias ll='ls -lah'
alias la='ls -a'
alias l='ls -lh'
alias ..='cd ..'
alias ~='cd ~'
alias e='mate '

alias ss='./script/server'
alias console='./script/console'
alias migration='./script/migration'

alias ror='/var/rubydev'
alias www='/var/www'
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.ubrio.us/code/history-meme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Best Bash Prompt</title>
		<link>http://blog.ubrio.us/nix/best-bash-prompt/</link>
		<comments>http://blog.ubrio.us/nix/best-bash-prompt/#comments</comments>
		<pubDate>Thu, 15 Nov 2007 05:25:20 +0000</pubDate>
		<dc:creator>Rob Hurring</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Nix]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[prompt]]></category>
		<category><![CDATA[ps1]]></category>

		<guid isPermaLink="false">http://blog.ubrio.us/osx/bash-prompt-madness/</guid>
		<description><![CDATA[Okay &#8212; so after that last post I decided it was time for a change. I&#8217;ve had the same bash prompt for years and was starting to get tired of it. Over the past 30 or so minutes I&#8217;ve been hating life learning way more than I wanted to about PS1, colors and embedded IF [...]]]></description>
			<content:encoded><![CDATA[<p>Okay &#8212; so after that last post I decided it was time for a change. I&#8217;ve had the same bash prompt for years and was starting to get tired of it. Over the past 30 or so minutes I&#8217;ve been <del>hating life</del> learning way more than I wanted to about PS1, colors and embedded IF statements.</p>
<p>And yes, this needs it own post simply for the fact that this is an insane prompt. Heres what it is/can do:</p>
<ol>
<li>Automatically shortens itself if the path is longer than 18 charachters<br/><small>This is what I&#8217;ve always wanted since I usually name my folders after the website URL &#8212; and I <em>HATE</em> 2 line prompts.</small></li>
<li>Changes to red if the last command didn&#8217;t have a return code of 0</li>
<li>Includes your bash history # for easy <a href="http://linux.deadgod.net/2007/01/01/Special_Bash_Variables_I" onclick="pageTracker._trackPageview('/outgoing/linux.deadgod.net/2007/01/01/Special_Bash_Variables_I?referer=');">history command repeating</a></li>
<li>Is pretty neat and trim</li>
</ol>
<h5>Why is this rad?</h5>
<div class='wp-caption alignleft'>
<img src="http://file.ubrio.us/misc/best_bash_prompt_ever.png" /></p>
<p class='wp-caption-text'>Prompt Madness!</p>
</div>
<p>I&#8217;ll let this image explain what it does and how it looks&#8230;</p>
<p><br clear='left' /></p>
<p>I&#8217;m tossing up a text file here -> <a href="http://file.ubrio.us/misc/best_bash_prompt_ever.txt" onclick="pageTracker._trackPageview('/outgoing/file.ubrio.us/misc/best_bash_prompt_ever.txt?referer=');">best_bash_prompt_ever.txt</a> &#8212; since the escaping will probably be messed up.</p>
<pre>
export PROMPT_COMMAND='PS1="\[\033[0;33m\][\!]\`if [[ \$? = "0" ]]; then echo "\\[\\033[32m\\]"; else echo "\\[\\033[31m\\]"; fi\`[\u.\h: \`if [[ `pwd|wc -c|tr -d " "` > 18 ]]; then echo "\\W"; else echo "\\w"; fi\`]\$\[\033[0m\] "; echo -ne "\033]0;`hostname -s`:`pwd`\007"'
</pre>
<div class='help'>The second half (from &#8220;echo -ne&#8230;&#8221; on) is for the Terminal&#8217;s title.</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.ubrio.us/nix/best-bash-prompt/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>OSX Terminal Niceties for Remote Servers</title>
		<link>http://blog.ubrio.us/nix/osx-terminal-niceties-for-remote-servers/</link>
		<comments>http://blog.ubrio.us/nix/osx-terminal-niceties-for-remote-servers/#comments</comments>
		<pubDate>Wed, 14 Nov 2007 20:46:56 +0000</pubDate>
		<dc:creator>Rob Hurring</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Nix]]></category>
		<category><![CDATA[bashrc]]></category>
		<category><![CDATA[nano]]></category>
		<category><![CDATA[prompt]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://blog.ubrio.us/osx/osx-terminal-niceties-for-remote-servers/</guid>
		<description><![CDATA[I have absolutely no idea what to title this as &#8212; and frankly, its more for me than anyone else. I need a place to store this before I forget and go racking my brain 2 years from now on how to do this.
If you think you&#8217;re interested &#8212; this post is about the following:

How [...]]]></description>
			<content:encoded><![CDATA[<p>I have absolutely no idea what to title this as &#8212; and frankly, its more for me than anyone else. I need a place to store this before I forget and go racking my brain 2 years from now on how to do this.</p>
<h5>If you think you&#8217;re interested &#8212; this post is about the following:</h5>
<ol>
<li>How to get your current user/directory in the title of terminal (iTerm.app for this post &#8212; same applies for Terminal.app though)</li>
<li>How to make the backspace/delete keys work properly in nano/pico on local and remote servers</li>
<li>Update your current user/path in the title when you SSH into a remote machine</li>
<li>And how to setup password-less SSH, just because its on topic</li>
</ol>
<h3>.bashrc modifications</h3>
<p>Making Terminal.app&#8217;s title update to the current user &#038; path for both local and remote servers while letting the backspace and delete key work properly &#8212; all in one solution! <img src='http://blog.ubrio.us/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class='tip'>Get yourself a nifty shell prompt over here -><a href="http://blog.ubrio.us/osx/best-bash-prompt/">Bash Prompt Madness</a></div>
<h5>Add the following lines to both your local &#038; remote .bashrc</h5>
<pre class="brush: ruby;">
# this is what updates your Terminal's title -- you can of course modify this
# but im not explaining how -- google it
export PROMPT_COMMAND='echo -ne &quot;\\033]0;${USER}:${PWD}\\007&quot;'

# this will make OSXs backspace &amp; delete keys work properly
# in nano &amp; pico
export TERM=xterm
stty erase ^H

# fancy prompt you say?
# again -- google for more info on this
export PS1=&quot;\\[\\033[0;34m\\][\\!]\[\\033[0;32m\\][\\u.\\h: \\w]\[\\033[0;32m\\]\\$\\[\\033[0m\\] &quot;

#gives you something like:
# [0][rob.hades: ~]$ echo 'hello world!'
</pre>
<h5>Now lets bind our servers for SSH so we don&#8217;t need passwords</h5>
<p>Passwords are annoying &#8212; especially when you are using <a href="http://en.wikipedia.org/wiki/Secure_copy" onclick="pageTracker._trackPageview('/outgoing/en.wikipedia.org/wiki/Secure_copy?referer=');">scp</a> and <a href="http://en.wikipedia.org/wiki/Rsync" onclick="pageTracker._trackPageview('/outgoing/en.wikipedia.org/wiki/Rsync?referer=');">rsync</a> a lot.</p>
<p>Here is a very simple way to drop those passwords and have SSH do all the work.</p>
<h6>In your terminal app (Locally)</h6>
<p>Make your .ssh directory<br />
<code><span>$></span>mkdir -p ~/.ssh &#038;&#038; cd ~/.ssh</code></p>
<p>Generate yourself some keys<br />
<code><span>~/.ssh $></span>ssh-keygen -t dsa -f ~/.ssh/id_dsa</code></p>
<p>Copy your public key to your remote server (Make sure the remote server has a ~/.ssh directory as well!)<br />
<code><span>~/.ssh $></span>scp id_dsa.pub {user}@{remoteserver}:.ssh</code></p>
<h6>In the remote computer</h6>
<p>Add that public key to your authorized_keys file for SSH<br />
<code><span>$></span>cd .ssh &#038;&#038; cat id_dsa.pub >> authorized_keys2</code></p>
<p>Cleanup those files and make sure the authorized_keys file is set to the right perms.<br />
<code><span>~/.ssh $></span>chmod 640 authorized_keys2 &#038;&#038; rm id_dsa.pub</code></p>
<p>That should make your life a bit more convenient <img src='http://blog.ubrio.us/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ubrio.us/nix/osx-terminal-niceties-for-remote-servers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Prepend files in OS X using the Command Line</title>
		<link>http://blog.ubrio.us/code/prepend-files-in-os-x-using-the-command-line/</link>
		<comments>http://blog.ubrio.us/code/prepend-files-in-os-x-using-the-command-line/#comments</comments>
		<pubDate>Mon, 12 Nov 2007 05:16:46 +0000</pubDate>
		<dc:creator>Rob Hurring</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Nix]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://blog.ubrio.us/osx/prepend-files-in-os-x-using-the-command-line/</guid>
		<description><![CDATA[This is a neat little &#8220;trick&#8221; to prepend something simple to the beginning of a file. Linux is funny in the way that you can easily append to a file by using echo "append me to the file" >> FILE but theres no real simple way to prepend. Most snippets I&#8217;ve seen use a tmp [...]]]></description>
			<content:encoded><![CDATA[<p>This is a neat little &#8220;trick&#8221; to prepend something simple to the beginning of a file. Linux is funny in the way that you can easily append to a file by using <code>echo "append me to the file" >> FILE</code> but theres no real simple way to prepend. Most snippets I&#8217;ve seen use a tmp file but thats silly when OS X gives you some amazing programs. </p>
<p>Using <code>pbcopy</code> and <code>pbpaste</code> can save your life sometimes and are probably one programs I miss the most when using Linux. Anyway, heres just a simple &#8220;1 liner&#8221; for prepending.</p>
<p><code class='prettyprint'>cat FILE | pbcopy &#038;&#038; echo "Prepend Text" > FILE &#038;&#038; pbpaste >> FILE</code></p>
<p>Pretty simple, but it can be useful at times &#8212; like when you have a script that would be better off with a shebang line than being run by hand and you&#8217;re too lazy to open an editor.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ubrio.us/code/prepend-files-in-os-x-using-the-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making find and tar play nicely</title>
		<link>http://blog.ubrio.us/nix/making-find-and-tar-play-nicely/</link>
		<comments>http://blog.ubrio.us/nix/making-find-and-tar-play-nicely/#comments</comments>
		<pubDate>Thu, 27 Sep 2007 21:45:35 +0000</pubDate>
		<dc:creator>Rob Hurring</dc:creator>
				<category><![CDATA[Because I'll Forget]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Nix]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[tar]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://blog.ubrio.us/because-ill-forget/because-ill-forget-1023/</guid>
		<description><![CDATA[Because I&#8217;ll forget #1023
Problem
Use Linux&#8217;s &#8220;find&#8221; command to hunt recursively through the current directory tree and find all matching files. While this is simple enough, I&#8217;m an idiot and tend to delete important files when drinking working too much &#8212; which we all know sucks. It would be nice to have it take all found [...]]]></description>
			<content:encoded><![CDATA[<h3>Because I&#8217;ll forget #1023</h3>
<p><strong>Problem</strong></p>
<p>Use Linux&#8217;s &#8220;find&#8221; command to hunt recursively through the current directory tree and find all matching files. While this is simple enough, I&#8217;m an idiot and tend to delete important files when <del>drinking</del> working too much &#8212; which we all know sucks. It would be nice to have it take all found files, tar them up and move it to the trash.</p>
<p><strong>Solution</strong></p>
<p>The evil, but oh-so-useful <code>xargs</code> command is your saving grace. While I hate using xargs its damn useful. If you take the output of find and pipe it into <code>tar</code> then pipe THAT into <code>rm</code> you get the job done. </p>
<p><strong>Example</strong></p>
<p>This is just a simple hack I&#8217;ve put together which seems to work and is relatively simple. (done as a bash function)</p>
<pre class='prettyprint'>
frm(){
	find . -name "$1" | xargs tar rvf "$1.tar" | xargs rm -rfv &#038;&#038; mv $1.tar ~/.trash
}
</pre>
<p>I just needed this because I had to wipe all <code>./.svn</code> directories so i just typed <code>frm .svn</code> and it created a .svn.tar and moved that to ~/.trash. Good stuff <img src='http://blog.ubrio.us/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ubrio.us/nix/making-find-and-tar-play-nicely/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom Global Keybindings in Gnome / Ubuntu</title>
		<link>http://blog.ubrio.us/nix/custom-global-keybindings-in-gnome-ubuntu/</link>
		<comments>http://blog.ubrio.us/nix/custom-global-keybindings-in-gnome-ubuntu/#comments</comments>
		<pubDate>Sat, 14 Jul 2007 00:22:09 +0000</pubDate>
		<dc:creator>Rob Hurring</dc:creator>
				<category><![CDATA[Gnome]]></category>
		<category><![CDATA[Nix]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.ubrio.us/gnome/custom-global-keybindings-in-gnome-ubuntu/</guid>
		<description><![CDATA[Simple custom keybindings in Gnome/Ubuntu
Gnome&#8217;s default keybinding app sucks (maybe Linus was right and Gnome treats its users like idiots? sucks for me I guess). Here is a way to bind anything you&#8217;d like to any key you&#8217;d like, globally. I found this useful because I naturally use WIN-E for an explorer or WIN-R for [...]]]></description>
			<content:encoded><![CDATA[<h3>Simple custom keybindings in Gnome/Ubuntu</h3>
<p>Gnome&#8217;s default keybinding app sucks (maybe Linus was right and Gnome treats its users like idiots? sucks for me I guess). Here is a way to bind anything you&#8217;d like to any key you&#8217;d like, globally. I found this useful because I naturally use WIN-E for an explorer or WIN-R for a run dialog and I couldn&#8217;t get that working the right way through Gnome&#8217;s default shortcut app (/System/Preferences/Keyboard Shortcuts).</p>
<p>Anyway, doing this is really simple. Open up a terminal and type <code>gconf-editor</code>. Browse the /app/Metacity/global_keybindings and keybinding_commands. Edit the corresponding global_keybinding command_# to the keybinding_command command_# and you&#8217;re golden.</p>
<p><em>Click for larger view</em><br />
<a href="http://pic.ubrio.us/blog_images/gconf-editor-keybindings.png" rel="gallery[a]" title="Your keybindings 1-12. You can use the windows key, hooray! :)"  class='lightview' onclick="pageTracker._trackPageview('/outgoing/pic.ubrio.us/blog_images/gconf-editor-keybindings.png?referer=');"><img src="http://pic.ubrio.us/blog_images/gconf-editor-keybindings-sm.png" /></a></p>
<p><em>Click for larger view</em><br />
<a href="http://pic.ubrio.us/blog_images/gconf-editor-commands.png" rel="gallery[a]" title="Custom Commands 1-12 :: Corresponds to your keybindings 1-12"  class='lightview' onclick="pageTracker._trackPageview('/outgoing/pic.ubrio.us/blog_images/gconf-editor-commands.png?referer=');"><img src="http://pic.ubrio.us/blog_images/gconf-editor-commands-sm.png" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ubrio.us/nix/custom-global-keybindings-in-gnome-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Subdomain Localhost &#8212; Ubuntu / OSX</title>
		<link>http://blog.ubrio.us/web/how-to-subdomain-localhost-ubuntu-osx/</link>
		<comments>http://blog.ubrio.us/web/how-to-subdomain-localhost-ubuntu-osx/#comments</comments>
		<pubDate>Fri, 13 Jul 2007 23:48:48 +0000</pubDate>
		<dc:creator>Rob Hurring</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Gnome]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Nix]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://blog.ubrio.us/gnome/how-to-subdomain-localhost-ubuntu-osx/</guid>
		<description><![CDATA[Using Gnome + Ubuntu (7.04 Feisty Fawn) + Apache 2
Step 1:
In gnome goto System -> Administration -> Network and click on the &#8216;Hosts&#8217; tab
Step 2:
For your normal localhost (127.0.0.1) double-click or hit &#8216;properties&#8217; to edit it. Add your list of subdomains under localhost.
*Ignore the text in this pic, I overlooked that you had to include [...]]]></description>
			<content:encoded><![CDATA[<h3>Using <a href="http://www.gnome.org/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.gnome.org/?referer=');">Gnome</a> + <a href="http://www.ubuntu.com/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.ubuntu.com/?referer=');">Ubuntu (7.04 Feisty Fawn)</a> + Apache 2</h3>
<p><strong>Step 1:</strong><br />
In gnome goto System -> Administration -> Network and click on the &#8216;Hosts&#8217; tab</p>
<p><strong>Step 2:</strong><br />
For your normal localhost (127.0.0.1) double-click or hit &#8216;properties&#8217; to edit it. Add your list of subdomains under localhost.</p>
<p><em>*<strong>Ignore the text in this pic, I overlooked that you had to include _all_ aliases in the same box. Whoops</strong></em><br />
<img src="http://pic.ubrio.us/blog_images/subdomain/host-alias-settings.png" /></p>
<p><strong>Step 3:</strong><br />
<small>The fun step</small><br />
Open a terminal and type <code>sudo gedit /etc/apache2/sites-available/default</code> &#8212; assuming you&#8217;re using the &#8220;default&#8221; httpd.conf. Chances are that you will be, and if you aren&#8217;t you should know what file I&#8217;m talking about anyway. (If you don&#8217;t, just load one of the enabled apache configuration files)</p>
<p>Change these lines:</p>
<pre>
NameVirtualHost *
&lt;VirtualHost *>
</pre>
<p><em>to</em></p>
<pre>
NameVirtualHost 127.0.0.1
&lt;VirtualHost 127.0.0.1>
</pre>
<p><strong>Step 4:</strong><br />
Add the following (for each subdomain you made) &#8212; changing the ServerName to whatever you aliased in the network host dialogue and DocumentRoot to wherever you want the subdomain to point.</p>
<pre>
&lt;VirtualHost 127.0.0.1>
	ServerName mysql.localhost
	DocumentRoot /var/www/phpmyadmin
&lt;/VirtualHost>
</pre>
<p><strong>Step 5:</strong><br />
In a terminal type: <code>sudo apache2ctl restart</code><br />
When that finishes, browse to http://mysql.localhost and you should see phpMyAdmin (going by my example)</p>
<h3>On OSX + Apache 1.33</h3>
<p><strong>Step 1:</strong><br />
Open /Applications/Utilities/NetInfo Manager and click on &#8220;machines&#8221;<br />
I usually just duplicate the localhost settings, or just create a new record below localhost that is something like:</p>
<p>ip_address: 127.0.0.1<br />
name: mysql.localhost<br />
serves: ./local</p>
<p><em>Click for bigger version</em><br />
<a href="http://pic.ubrio.us/blog_images/subdomain/osx-host-dialog.png" rel="gallery[a]" title="This is how my hosts dialog looks on OSX"  class='lightview' onclick="pageTracker._trackPageview('/outgoing/pic.ubrio.us/blog_images/subdomain/osx-host-dialog.png?referer=');"><img src="http://pic.ubrio.us/blog_images/subdomain/osx-host-dialog-sm.png" /></a></p>
<p><strong>Step 2:</strong><br />
Repeat Steps 3-5 above only editing &#8220;/etc/httpd/users/{yourname}.conf&#8221; instead.</p>
<p><em>Click for bigger version</em><br />
<a href="http://pic.ubrio.us/blog_images/subdomain/config-changes.png" rel="gallery[a]" class='lightview' title="This is how my httpd.conf file looks on OSX" onclick="pageTracker._trackPageview('/outgoing/pic.ubrio.us/blog_images/subdomain/config-changes.png?referer=');"><img src="http://pic.ubrio.us/blog_images/subdomain/config-changes-sm.png" /></a></p>
<p>Restart Apache and hopefully all went well. I found this useful because I hate typing unnecessary paths <img src='http://blog.ubrio.us/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ubrio.us/web/how-to-subdomain-localhost-ubuntu-osx/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Ubuntu Error: Hal failed to initialize &amp; udev address already in use &#8211; Solution</title>
		<link>http://blog.ubrio.us/nix/ubuntu-error-hal-failed-to-initialize-udev-address-already-in-use-solution/</link>
		<comments>http://blog.ubrio.us/nix/ubuntu-error-hal-failed-to-initialize-udev-address-already-in-use-solution/#comments</comments>
		<pubDate>Tue, 26 Jun 2007 04:06:51 +0000</pubDate>
		<dc:creator>Rob Hurring</dc:creator>
				<category><![CDATA[Gnome]]></category>
		<category><![CDATA[Nix]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.ubrio.us/gnome/ubuntu-error-hal-failed-to-initialize-udev-address-already-in-use-solution/</guid>
		<description><![CDATA[This is more for me in case it ever happens again. My system froze up while doing some stupid stuff (namely pressing keys I shouldn&#8217;t be pressing) so i force-rebooted it (aka: kicked the surge protector). When I re-booted I got the &#8220;Hal failed to initialize&#8221; message which is apparently pretty common and was supposed [...]]]></description>
			<content:encoded><![CDATA[<p>This is more for me in case it ever happens again. My system froze up while doing some stupid stuff (namely pressing keys I shouldn&#8217;t be pressing) so i force-rebooted it (aka: kicked the surge protector). When I re-booted I got the &#8220;Hal failed to initialize&#8221; message which is apparently pretty common and was supposed to be a pain in the ass to fix.</p>
<p>Theres a few common solutions:</p>
<p><strong><a href="http://beans.seartipy.com/2006/11/25/ubuntu-610-annoyance-failed-to-initialize-hal-error" target="_blank" onclick="pageTracker._trackPageview('/outgoing/beans.seartipy.com/2006/11/25/ubuntu-610-annoyance-failed-to-initialize-hal-error?referer=');">Every Flavour Beans</a></strong> mentions its either a login timing (GDM) issue, or a samba auto-mount issue. The solution there was to either: a) disable all samba shares (I&#8217;m not 100% if they meant temporarily or forever &#8212; either way, this was a last resort since I hate this kind of stuff) and b) disabling automatic logins through gnome&#8217;s GDM.</p>
<p>I didn&#8217;t have auto-login enabled, so I figured &#8220;what the hell&#8221; and set it to auto-login with a 10 second timer. When I re-logged I didn&#8217;t get the HAL error, but I also didn&#8217;t get my auto mounted drives back. Shit. Next.</p>
<p>I decided to poke around a bit more to see what the bigger picture is. I knew it couldn&#8217;t be a big issue since I wasn&#8217;t installing/configuring/etc. at the time of the crash &#8212; something just got &#8220;stuck.&#8221; I stumbled upon another site which mentioned running <code>sudo /usr/sbin/hald --daemon=no --verbose=yes</code> to view the output.</p>
<p>After running that I got a suspicious message pointing to the real issue: <code>Error binding udev_event socket: Address already in use</code>. Damn udev. Anyways, I tossed up a <code>sudo /etc/init.d/udev restart</code> and re-booted. Lo and behold &#8211; all is well.</p>
<p>(Again, this post is more for my future reference in case I get this error again)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ubrio.us/nix/ubuntu-error-hal-failed-to-initialize-udev-address-already-in-use-solution/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

