Bitcetera TecBlog http://www.bitcetera.com/en/rss/ en-us 40 News about Bitcetera products, services and the technologies used. Dressed Up <p>It was about time the Bitcetera webpage got a new outfit. And some new features with it, stay tuned for more.</p> Mon, 31 Mar 2008 18:09:00 GMT http://www.bitcetera.com/en/tecblog/2008/03/31/dressed-up/ http://www.bitcetera.com/en/tecblog/2008/03/31/dressed-up/ Regex in a Nutshell <h2>Reg... what?</h2><p> Regular expressions (or regex for short) are the Swiss army knife of string searching and manipulation, a cure against cascades of conditions and ugly loops. However, some folks also in the software developer herd still consider them hard to learn and thus keep their hands off. Big mistake!</p><h2>Reg... how?</h2><p> Here are a few helpful resources for learning regex: </p><ul><li><a href="&#104;ttp://www.stedee.id.au/So_You_Want_to_Learn_Regular_Expressions" target="_blank">Tutorial by Steve McInerney</a> </li><li><a href="&#104;ttp://www.fileformat.info/tool/regex.htm" target="_blank">Online regex tester</a> </li></ul><p> And finally our handy and colorful cheat sheet: </p><ul><li><a href="/assets/media/regex_in_a_nutshell.pdf">Download the cheat sheet</a> </li></ul><p> Please keep in mind that although many programming languages and text editors implement regex nowadays, the actual implementation may differ. Expressions using niftier features are generally more likely not to work in a different environment.</p><p>And make sure you have fully understood the concept of "greediness" because if you haven't, you'll end up with way too large, slow and buggy expressions - promised!</p> Tue, 01 Apr 2008 23:13:00 GMT http://www.bitcetera.com/en/tecblog/2008/04/01/regex-in-a-nutshell/ http://www.bitcetera.com/en/tecblog/2008/04/01/regex-in-a-nutshell/ Add the CAcert Root Certificate <h2>What is CAcert?</h2><p> <a href="&#104;ttp://www.cacert.org" target="_blank">CAcert</a> is a non-profit certificate authority (or CA for short) where you can - once your <a href="/en/services">identity is verified</a> to a sufficient degree by the web of trusted users - issue free SSL certificates for your webservers. However, SSL certificates only work without warning messages if the root certificate of the CA which issued it are known to the client. At the time of writing this is not yet the case for <a href="&#104;ttp://wiki.cacert.org/wiki/InclusionStatus" target="_blank">mainstream clients</a> such as Firefox. But this should change in the future as CAcert is currently undergoing a serious audit needed for inclusion into mainstream clients. Until then, here's how to add the root certificate manually.</p><h2>Adding the Root Certificate</h2><p> There is one crucial step when adding root certificates manually: You must be absolutely sure that the root certificate is authentic by comparing fingerprints and certificate metadata such as the owner with those posted - in this case - on the official <a href="&#104;ttp://www.cacert.org/index.php?id=3" target="_blank">CAcert Wiki</a>.</p><h3>Firefox 3</h3><ol><li>Browse with Firefox 3 to the <a href="&#104;ttp://www.cacert.org/index.php?id=3" target="_blank">CAcert Wiki</a>. </li><li>Click on "Class 3 PKI Key, Intermediate Certificate (PEM Format)". </li><li>Click the "View" button and verify the fingerprints and owner. </li><li>Select all "Trust this CA to ..." checkboxes and click "OK". </li></ol><h3>Mac OS X 10.5.x</h3><ol><li>Browse to the <a href="&#104;ttp://www.cacert.org/index.php?id=3" target="_blank">CAcert Wiki</a>. </li><li>Click on "Class 3 PKI Key, Intermediate Certificate (PEM Format)". </li><li>Drag the certificate onto the Keychain application. </li><li>Click the "View Certificates" button, then click "Details" and verify the finterprints and owner. </li><li>Select "System" to install the certificate system-wide and click "OK". </li></ol><h3>Gentoo Linux</h3><p> <pre> cd&#160;/etc/ssl/certs curl&#160;&#104;ttp://www.cacert.org/certs/class3.der&#160;>import.der openssl&#160;sha1&#160;import.der&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;###&#160;VERIFY&#160;THE&#160;SHA1&#160;FINGERPRINT&#160;### openssl&#160;md5&#160;import.der&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;###&#160;VERIFY&#160;THE&#160;MD5&#160;&#160;FINGERPRINT&#160;### openssl&#160;x509&#160;-text&#160;-inform&#160;der&#160;-in&#160;import.der&#160;&#160;&#160;###&#160;VERIFY&#160;THE&#160;OWNER&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;### openssl&#160;x509&#160;-in&#160;import.der&#160;-inform&#160;der&#160;-out&#160;CAcert_Class_3_Root_CA.pem&#160;-outform&#160;pem rm&#160;import.der c_rehash&#160;. update-ca-certificates&#160; </pre></p><h3>Other Clients</h3><p> See the <a href="&#104;ttps://wiki.cacert.org/wiki/BrowserClients" target="_blank">CAcert Wiki</a> for more.</p> Sun, 27 Apr 2008 21:26:00 GMT http://www.bitcetera.com/en/tecblog/2008/04/27/add-the-cacert-root-certificate/ http://www.bitcetera.com/en/tecblog/2008/04/27/add-the-cacert-root-certificate/ Switched from Subversion to Git <h2>Switch</h2><p>Our switch from <a href="&#104;ttp://subversion.tigris.org" target="_blank">Subversion</a> to <a href="&#104;ttp://git.or.cz" target="_blank">Git</a> is complete. As of today all repositories are available by use of Git only. The URLs change as follows:</p><table><tr><td>Subversion:</td><td>&#104;ttps://svn.bitcetera.com/svn/{REPOSITORY}/trunk </td></tr> <tr><td>Git:</td><td>&#104;ttps://git.bitcetera.com/{REPOSITORY}.git </td></tr> </table> <h2>Gentoo Overlay</h2><p>If you are using the <a href="/en/products/gentoo-ebuilds">Bitcetera overlay for Gentoo Linux</a>, you have to perform a few simple steps in order to keep it working: </p><ol><li>Add the CAcert root certificate <a href="/en/tecblog/2008/04/27/add-the-cacert-root-certificate">following this guide</a>. </li><li>Remove the old Bitcetera overlay with <code>layman -d bitcetera</code>. </li><li>Edit the file <code>/etc/layman/layman.cnf</code> and replace <code>&#104;ttps://svn.bitcetera.com/svn/gentoo/layman.xml</code> with <code>&#104;ttps://git.bitcetera.com/gentoo.git/layman.xml</code>. </li><li>Add the new Bitcetera overlay with <code>layman -a bitcetera</code>.</li></ol> Mon, 28 Apr 2008 01:04:00 GMT http://www.bitcetera.com/en/tecblog/2008/04/28/switched-from-subversion-to-git/ http://www.bitcetera.com/en/tecblog/2008/04/28/switched-from-subversion-to-git/ Gentoo Prefix on Mac OS X <h2>Open Source on Mac OS X</h2><p>There are a few ways how to spice up your Mac with unixish Open Source software: <a href="&#104;ttp://www.finkproject.org" target="_blank">Fink</a> uses the Debian package manager and overall works pretty well, yet it seems as if it has been loosing momentum lately, many package versions date back quite a bit. A reason for this could be <a href="&#104;ttp://www.macports.org" target="_blank">MacPorts</a> (formerly know as Darwin Ports) which generally features more up-to-date package versions. Unfortunately, it's package manager falls short in many areas, most notably dependency handling.</p><p>Thus I'm rather unhappy with either of them, especially as our servers are running <a href="&#104;ttp://www.gentoo.org" target="_blank">Gentoo Linux</a> and I've soon come to love the power of it's package manager Portage. Why can't there be anything like that on Mac OS X?</p><h2>Gentoo Prefix</h2><p>Well, there is! The project is called <a href="&#104;ttp://www.gentoo.org/proj/en/gentoo-alt/prefix/index.xml" target="_blank">Gentoo Prefix</a> and aims at bootstrapping Gentoo Linux in any subdirectory you choose. The initial <a href="&#104;ttp://www.gentoo.org/proj/en/gentoo-alt/prefix/bootstrap-macos.xml" target="_blank">installation on Mac OS X</a> takes more time, yet it's painless and you're rewarded with all the power of Gentoo and Portage running right on your Mac OS X Mach kernel. What a beauty! </p> Thu, 08 May 2008 20:43:00 GMT http://www.bitcetera.com/en/tecblog/2008/05/08/gentoo-prefix-on-mac-os-x/ http://www.bitcetera.com/en/tecblog/2008/05/08/gentoo-prefix-on-mac-os-x/ Asterisk, Ruby and Growl <h2>What is this?</h2><p> Wouldn't it be nice to get an anouncement on your computer when you receive an incoming call on your <a href="&#104;ttp://www.asterisk.org" target="_blank">Asterisk</a> or <a href="&#104;ttp://www.callweaver.org" target="_blank">CallWeaver</a> telephony server? Don't want to fiddle around with <tt>app_notify</tt> which is cumbersome on the former and not even ported to the latter? Well, Ruby to the rescue!</p><h2>Installation</h2><p> You need a couple of gems for this to work. <tt>ruby-growl</tt> will do the talking to the Growl clients while <tt>batphone</tt> hooks into Asterisk/CallWeaver:</p><p><pre> gem&#160;install&#160;ruby-growl gem&#160;install&#160;batphone </pre></p><p>Note: As of today, <tt>batphone</tt> is not yet available as a gem. However, you can download and install it <a href="&#104;ttp://hans.fugal.net/src/batphone/doc/files/README.html" target="_blank">from here instead</a>.</p><h3>Asterisk</h3><p> Create the script <tt>/opt/bin/growl_call</tt> which must be executable by the user under which Asterisk is running: <pre> &#35;!/usr/bin/env&#160;ruby</p><p>require&#160;'rubygems' require&#160;'ruby-growl' require&#160;'agi'</p><p>agi&#160;=&#160;AGI.new</p><p>message&#160;=&#160;<<-EOS From:&#160;#{agi.env['agi_calleridname']}&#160;<#{agi.env['agi_callerid']}> Context:&#160;#{agi.env['ogi_context']} Date:&#160;#{Time.now.strftime('%Y-%m-%d&#160;%H:%m:%S')} EOS</p><p>client&#160;=&#160;Growl.new("{CLIENT}",&#160;"CallWeaver",&#160;["incoming&#160;call"],&#160;nil,&#160;'{PASSWORD}') client.notify("incoming&#160;call",&#160;"Incoming&#160;Call",&#160;message,&#160;0,&#160;true) </pre></p><p>Make sure you replace <tt>{CLIENT}</tt> with the domain name or IP of the Growl client and <tt>{PASSWORD}</tt> with the password you have set in Growl for remote notifications. </p><p>And finally add the following command wherever appropriate in <tt>extensions.conf</tt>:</p><h3>CallWeaver</h3><p> Same as above, but you have to replace all occurrances of <tt>agi</tt> and <tt>AGI</tt> with the CallWeaver equivalent <tt>ogi</tt> and <tt>OGI</tt>. However, there are two exceptions: <code>require 'agi'</code> and <code>AGI.new</code> must not be renamed.</p><h2>Growl</h2><p> Growl itself is only available on Mac OS X. However, there are third-party ports for other platforms: </p><ul><li><a href="&#104;ttp://www.growl.info" target="_blank">Tru blu Growl on Mac OS X</a> </li><li><a href="&#104;ttp://www.mumbles-project.org" target="_blank">Growl-capable Mumbles on Linux</a> </li><li><a href="&#104;ttp://www.tripthevortex.com/growl" target="_blank">Growl clients on Windows</a></li></ul> Mon, 14 Jul 2008 19:06:00 GMT http://www.bitcetera.com/en/tecblog/2008/07/14/asterisk-ruby-and-growl/ http://www.bitcetera.com/en/tecblog/2008/07/14/asterisk-ruby-and-growl/ Postwhite Released <p>See <a href="/en/products/postwhite">the Postwhite product page</a> for more.</p> Wed, 23 Jul 2008 19:00:00 GMT http://www.bitcetera.com/en/tecblog/2008/07/23/postwhite-released/ http://www.bitcetera.com/en/tecblog/2008/07/23/postwhite-released/