<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title></title>
  <link href="http://bill-ingram.com/atom.xml" rel="self"/>
  <link href="http://bill-ingram.com/"/>
  <updated>2011-12-16T15:36:41-06:00</updated>
  <id>http://bill-ingram.com/</id>
  <author>
    <name>Bill Ingram</name>
    
  </author>

  
  <entry>
    <title>Regular Expression for Parsing Phone Numbers</title>
    <link href="http://bill-ingram.com/2011/11/04/phone-number-parse-regex/"/>
    <updated>2011-11-04T13:59:00-05:00</updated>
    <id>http://bill-ingram.com/2011/11/04/phone-number-parse-regex</id>
    <content type="html">&lt;p&gt;This regular expression will parse most phone numbers into four groups: country code, area code, number, and extension. It works most of the time, see the examples below.&lt;/p&gt;

&lt;p&gt;Here's the expression:&lt;/p&gt;

&lt;p&gt;``` bash&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;^(?:[\+]?[\(]?([\d]{1,3})[\s\-\.\)]+)?(?:[\(]?([\d]{1,3})[\s\-\/\)]+)([2-9][0-9\s\-\.]{6,}[0-9])(?:[\s\D]+([\d]{1,5}))?$
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;```&lt;/p&gt;

&lt;p&gt;Again, as a Java string:&lt;/p&gt;

&lt;p&gt;``` java&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&quot;^(?:[\\+]?[\\(]?([\\d]{1,3})[\\s\\-\\.\\)]+)?(?:[\\(]?([\\d]{1,3})[\\s\\-\\/\\)]+)([2-9][0-9\\s\\-\\.]{6,}[0-9])(?:[\\s\\D]+([\\d]{1,5}))?$&quot;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;```&lt;/p&gt;

&lt;p&gt;Results:&lt;/p&gt;

&lt;table class=&quot;grid&quot;&gt;
    &lt;tbody&gt;
    &lt;tr&gt;
        &lt;th&gt;Target String&lt;/th&gt;
        &lt;th&gt;matches()&lt;/th&gt;
        &lt;th&gt;group(0)&lt;/th&gt;
        &lt;th&gt;group(1)&lt;/th&gt;
        &lt;th&gt;group(2)&lt;/th&gt;
        &lt;th&gt;group(3)&lt;/th&gt;
        &lt;th&gt;group(4)&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;011-656-555-1234&lt;/td&gt;
        &lt;td&gt;Yes&lt;/td&gt;
        &lt;td&gt;011-656-555-1234&lt;/td&gt;
        &lt;td&gt;011&lt;/td&gt;
        &lt;td&gt;656&lt;/td&gt;
        &lt;td&gt;555-1234&lt;/td&gt;
        &lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;(217)555-1234&lt;/td&gt;
        &lt;td&gt;Yes&lt;/td&gt;
        &lt;td&gt;(217)555-1234&lt;/td&gt;
        &lt;td&gt;&lt;/td&gt;
        &lt;td&gt;217&lt;/td&gt;
        &lt;td&gt;555-1234&lt;/td&gt;
        &lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;(907) 555-1234&lt;/td&gt;
        &lt;td&gt;Yes&lt;/td&gt;
        &lt;td&gt;(907) 555-1234&lt;/td&gt;
        &lt;td&gt;&lt;/td&gt;
        &lt;td&gt;907&lt;/td&gt;
        &lt;td&gt;555-1234&lt;/td&gt;
        &lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;+82-10-5551-2345&lt;/td&gt;
        &lt;td&gt;Yes&lt;/td&gt;
        &lt;td&gt;+82-10-5551-2345&lt;/td&gt;
        &lt;td&gt;82&lt;/td&gt;
        &lt;td&gt;10&lt;/td&gt;
        &lt;td&gt;5551-2345&lt;/td&gt;
        &lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;+(82) 10-5551-2345&lt;/td&gt;
        &lt;td&gt;Yes&lt;/td&gt;
        &lt;td&gt;+(82) 10-5551-2345&lt;/td&gt;
        &lt;td&gt;82&lt;/td&gt;
        &lt;td&gt;10&lt;/td&gt;
        &lt;td&gt;5551-2345&lt;/td&gt;
        &lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;+886-2-55512345&lt;/td&gt;
        &lt;td&gt;Yes&lt;/td&gt;
        &lt;td&gt;+886-2-55512345&lt;/td&gt;
        &lt;td&gt;886&lt;/td&gt;
        &lt;td&gt;2&lt;/td&gt;
        &lt;td&gt;55512345&lt;/td&gt;
        &lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;1-416-555-1234 ext 1234&lt;/td&gt;
        &lt;td&gt;Yes&lt;/td&gt;
        &lt;td&gt;1-416-555-1234 ext 1234&lt;/td&gt;
        &lt;td&gt;1&lt;/td&gt;
        &lt;td&gt;416&lt;/td&gt;
        &lt;td&gt;555-1234&lt;/td&gt;
        &lt;td&gt;1234&lt;/td&gt;
&lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;714 555 1234 / 1234&lt;/td&gt;
        &lt;td&gt;Yes&lt;/td&gt;
        &lt;td&gt;714 555 1234 / 1234&lt;/td&gt;
        &lt;td&gt;&lt;/td&gt;
        &lt;td&gt;714&lt;/td&gt;
        &lt;td&gt;555 1234&lt;/td&gt;
        &lt;td&gt;1234&lt;/td&gt;
&lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;+1-714-555-1234&lt;/td&gt;
        &lt;td&gt;Yes&lt;/td&gt;
        &lt;td&gt;+1-714-555-1234&lt;/td&gt;
        &lt;td&gt;1&lt;/td&gt;
        &lt;td&gt;714&lt;/td&gt;
        &lt;td&gt;555-1234&lt;/td&gt;
        &lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;+(82) 10-5326-5760&lt;/td&gt;
        &lt;td&gt;Yes&lt;/td&gt;
        &lt;td&gt;+(82) 10-5326-5760&lt;/td&gt;
        &lt;td&gt;82&lt;/td&gt;
        &lt;td&gt;10&lt;/td&gt;
        &lt;td&gt;5326-5760&lt;/td&gt;
        &lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

</content>
  </entry>
  
  <entry>
    <title>Textmate-like fuzzy finder in RubyMine</title>
    <link href="http://bill-ingram.com/2011/09/28/fuzzyfind-with-rubymine/"/>
    <updated>2011-09-28T11:13:00-05:00</updated>
    <id>http://bill-ingram.com/2011/09/28/fuzzyfind-with-rubymine</id>
    <content type="html">&lt;p&gt;I just discovered, after months of &lt;a href=&quot;http://www.jetbrains.com/ruby/&quot; title=&quot;JetBrains RubyMine&quot;&gt;RubyMine&lt;/a&gt; use, that the GoTo functions work like fuzzyfinder in Textmate. There are a lot of useful shortcuts under the GoTo menu; the ones I am finding most useful are &lt;code&gt;Ctrl+Shft+N&lt;/code&gt; for finding and opening a file, &lt;code&gt;Ctrl+N&lt;/code&gt; for a class, and &lt;code&gt;Alt+Shft+N&lt;/code&gt; for jumping to a corresponding Rails object. For instance, if I am in the People controller, I can jump to the Person model, People views, etc, bringing me that much closer to fulfilling my dream of never having to leave the keyboard when developing.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Google+</title>
    <link href="http://bill-ingram.com/2011/07/01/google-plus/"/>
    <updated>2011-07-01T00:00:00-05:00</updated>
    <id>http://bill-ingram.com/2011/07/01/google-plus</id>
    <content type="html">&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/June_29&quot; title=&quot;Yesterday&quot;&gt;Yesterday&lt;/a&gt; was my birthday, and -- what do you know? -- I got an invitation to join &lt;a href=&quot;http://www.google.com/+&quot; title=&quot;Google+&quot;&gt;Google+&lt;/a&gt;. Pretty exciting! I was one of the first of my friends to get on, so I had the opportunity to invite a lot of my buddies and colleagues. My inbox stayed full today with notices from Google that another one of my contacts had joined the network, and would I like to add her to one of my &lt;em&gt;circles&lt;/em&gt;. Circles, by the way, are what sets Google+ apart from other services in this space. As a friend pointed out today, Google+ is kind of like a combination of Twitter and Facebook. You don't &lt;em&gt;friend&lt;/em&gt; people like in Facebook; you &lt;em&gt;follow&lt;/em&gt; them like on Twitter. Come to think of it, all day people have been comparing Google+ to Facebook, but it's actually a lot more like Twitter than one would think at first glance.&lt;/p&gt;

&lt;p&gt;Another feature I really like, related to circles, is the &lt;em&gt;stream&lt;/em&gt;. Streams are like the Facebook news feed, except they only contain posts and updates from members of a particular circle. I love that I can separate my feeds that way. When I started putting people into circles, it was based on their role in my life: colleagues, friends, family, &amp;amp;c, &amp;amp;c. But now I am reorganizing my circles based on what kind of streams they will produce. For example, some contacts only posts jokes, funny videos, and whatnot, so I've created a new circle called &lt;em&gt;funny&lt;/em&gt; for them. For those who generally share information about computers, I've created a group called &lt;em&gt;computers&lt;/em&gt;. See where I'm going with this?&lt;/p&gt;

&lt;p&gt;I just started this evening with &lt;em&gt;sparks&lt;/em&gt;. Sparks are lists of topics I am interested in, and streams associated with that topic. I'm not really sure what their importance is yet, but I have a few just in case it's useful to.&lt;/p&gt;

&lt;p&gt;So that's my first impression of Google+. If you want to connect, visit &lt;a href=&quot;https://plus.google.com/112120275257508476932/about&quot; title=&quot;my profile&quot;&gt;my profile&lt;/a&gt; and add me to a circle. Cheers.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Starting My Blog Over with Jekyll</title>
    <link href="http://bill-ingram.com/2011/06/27/starting-my-blog-over-with-jekyll.blog/"/>
    <updated>2011-06-27T00:00:00-05:00</updated>
    <id>http://bill-ingram.com/2011/06/27/starting-my-blog-over-with-jekyll.blog</id>
    <content type="html">&lt;p&gt;I started using Wordpress to design my blog because I like the all the free stuff I got out of the box. It is definitely the best turn-key blogging software solution out there -- at least it was when I set up my site a year or so ago. What I really liked about Wordpress was the plethora of nice looking, free themes out there. It was really easy to set up a cool looking blog in just a few minutes.&lt;/p&gt;

&lt;p&gt;Nowadays I think that all the Wordpress provides is probably overkill for my little blog here. What I want now is simplicity. And I found that with Jekyll. Jekyll is not a blogging software solution like Wordpress. It's a  static HTML generator that allows me to write my posts in textile or markdown, and I can check &lt;a href=&quot;https://github.com/waingram&quot; title=&quot;my code&quot;&gt;my code&lt;/a&gt; in at GitHub. It's a workflow I am used to. Super simple. Very clean. I like it.&lt;/p&gt;

&lt;p&gt;Thanks to &lt;a href=&quot;http://tom.preston-werner.com/&quot; title=&quot;Tom Preston-Werner&quot;&gt;Tom Preston-Werner&lt;/a&gt; for sharing.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Removing a service from all run levels on Ubuntu 10.04</title>
    <link href="http://bill-ingram.com/2011/05/10/removing-a-service-from-all-run-levels/"/>
    <updated>2011-05-10T00:00:00-05:00</updated>
    <id>http://bill-ingram.com/2011/05/10/removing-a-service-from-all-run-levels</id>
    <content type="html">&lt;p&gt;If postgres is running, stop it&lt;/p&gt;

&lt;p&gt;``` bash&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo /etc/init.d/postgresql-8.4 stop
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;```&lt;/p&gt;

&lt;p&gt;Or do it the proper way&lt;/p&gt;

&lt;p&gt;``` bash&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo service postgresql-8.4 stop
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;```&lt;/p&gt;

&lt;p&gt;Remove it from rc.d&lt;/p&gt;

&lt;p&gt;``` bash&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo update-rc.d postgresql-8.4 remove
  update-rc.d: /etc/init.d/postgresql-8.4 exists during rc.d purge (use -f to force)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;```&lt;/p&gt;

&lt;p&gt;This time with force!&lt;/p&gt;

&lt;p&gt;``` bash&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo update-rc.d -f postgresql-8.4 remove
  Removing any system startup links for /etc/init.d/postgresql-8.4 ...
    /etc/rc0.d/K19postgresql-8.4
    /etc/rc1.d/K19postgresql-8.4
    /etc/rc2.d/S19postgresql-8.4
    /etc/rc3.d/S19postgresql-8.4
    /etc/rc4.d/S19postgresql-8.4
    /etc/rc5.d/S19postgresql-8.4
    /etc/rc6.d/K19postgresql-8.4
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;```&lt;/p&gt;

&lt;p&gt;That's it.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Installing PostgreSQL-8.2 on Ubuntu 10.04</title>
    <link href="http://bill-ingram.com/2011/05/10/installing-PostgreSQL-8.2-on-Ubuntu-10.04/"/>
    <updated>2011-05-10T00:00:00-05:00</updated>
    <id>http://bill-ingram.com/2011/05/10/installing-PostgreSQL-8.2-on-Ubuntu-10.04</id>
    <content type="html">&lt;p&gt;First, add the Hardy repositories to apt-get sources. If this file does not already exist, create it.&lt;/p&gt;

&lt;p&gt;``` bash&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo vim /etc/apt/sources.list.d/hardy.list
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;```&lt;/p&gt;

&lt;p&gt;Add the Hardy repos.&lt;/p&gt;

&lt;p&gt;``` bash&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;deb http://us.archive.ubuntu.com/ubuntu/ hardy universe
deb http://us.archive.ubuntu.com/ubuntu/ hardy-updates universe
deb http://us.archive.ubuntu.com/ubuntu/ hardy-security universe
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;```&lt;/p&gt;

&lt;p&gt;Update apt-get, and install.&lt;/p&gt;

&lt;p&gt;``` bash&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo apt-get update
sudo apt-get install postgres-8.2
  Reading package lists... Done
  Building dependency tree       
  Reading state information... Done
  Some packages could not be installed. This may mean that you have
  requested an impossible situation or if you are using the unstable
  distribution that some required packages have not yet been created
  or been moved out of Incoming.
  The following information may help to resolve the situation:

  The following packages have unmet dependencies:
    postgresql-8.2: Depends: libkrb53 (&amp;gt;= 1.6.dfsg.2) but it is not installable
  E: Broken packages
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;```&lt;/p&gt;

&lt;p&gt;That's not good. It turns out &lt;code&gt;libkrb53&lt;/code&gt; has been replaced by &lt;code&gt;libkrb5-3&lt;/code&gt; in Ubuntu 10.04. To make matters worse, the old &lt;code&gt;libkrb53&lt;/code&gt; package was split up into several other packages (&lt;code&gt;libkrb5-3&lt;/code&gt; for &lt;code&gt;libkrb5&lt;/code&gt; itself, but also &lt;code&gt;libgssapi-krb5-2&lt;/code&gt;, &lt;code&gt;libk5crypto3&lt;/code&gt;, and &lt;code&gt;libkrb5support0&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Here's the fix (see &lt;a href=&quot;https://bugs.launchpad.net/ubuntu/+source/root-system/+bug/462059&quot; title=&quot;Bug #462059&quot;&gt;Bug #462059&lt;/a&gt;). Use equivs to generate a fake transitional &lt;code&gt;libkrb53&lt;/code&gt; package.&lt;/p&gt;

&lt;p&gt;Create a dummy file called &lt;code&gt;libkrb.txt&lt;/code&gt;, with this text:&lt;/p&gt;

&lt;p&gt;``` bash&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Package: libkrb53
Version: 1.6.dfsg.2+fake1
Depends: libkrb5-3, libgssapi-krb5-2, libk5crypto3, libkrb5support0
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;```&lt;/p&gt;

&lt;p&gt;Run &lt;code&gt;equivs-build&lt;/code&gt; on the dummy file. (You may have to &lt;code&gt;sudo apt-get install equivs&lt;/code&gt; first.)&lt;/p&gt;

&lt;p&gt;``` bash&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo equivs-build krb.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;```&lt;/p&gt;

&lt;p&gt;This will generate the file &lt;code&gt;libkrb53_1.6.dfsg.2+fake1_all.deb&lt;/code&gt;. Install the resulting .deb.&lt;/p&gt;

&lt;p&gt;``` bash&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo dpkg -i libkrb53_1.6.dfsg.2+fake1_all.deb
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;```&lt;/p&gt;

&lt;p&gt;Now install postgresql-8.2; it's dependencies are resolved.&lt;/p&gt;

&lt;p&gt;``` bash&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo apt-get install postgresql-8.2
  Reading package lists... Done  
  Building dependency tree       
  Reading state information... Done
  Suggested packages:
    oidentd ident-server
  The following NEW packages will be installed:
    postgresql-8.2
  ...
  ...
  ...
  Starting PostgreSQL 8.2 database server
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;```&lt;/p&gt;

&lt;p&gt;Done!&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Recursively delete .svn directories</title>
    <link href="http://bill-ingram.com/2011/04/25/recursively-delete-.svn-directories/"/>
    <updated>2011-04-25T00:00:00-05:00</updated>
    <id>http://bill-ingram.com/2011/04/25/recursively-delete-.svn-directories</id>
    <content type="html">&lt;p&gt;Finding all the .svn directories is easy&lt;/p&gt;

&lt;p&gt;``` bash&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ find . -type d -name .svn
./.svn
./sourceA/.svn
./sourceB/.svn
./sourceB/module/.svn
./sourceC/.svn
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;```&lt;/p&gt;

&lt;p&gt;Now use command substitution with &lt;code&gt;rm -rf&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;``` bash&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;rm -rf `find . -type d -name .svn`
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;```&lt;/p&gt;

&lt;p&gt;Note the use of the &lt;em&gt;backtick&lt;/em&gt; symbol (located under the ~ on the English keyboard)&amp;mdash;that is not a single quote.&lt;/p&gt;
</content>
  </entry>
  
</feed>

