<?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>pastbedti.me &#187; howto</title>
	<atom:link href="http://www.pastbedti.me/tag/howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pastbedti.me</link>
	<description>About ruby, rails, postgresql and stuff....</description>
	<lastBuildDate>Fri, 02 Apr 2010 20:12:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>5-10 second delay when launching Terminal.app in OSX</title>
		<link>http://www.pastbedti.me/2009/09/5-10-second-delay-when-launching-terminal-in-osx/</link>
		<comments>http://www.pastbedti.me/2009/09/5-10-second-delay-when-launching-terminal-in-osx/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 20:29:36 +0000</pubDate>
		<dc:creator>Mathias Stjernström</dc:creator>
				<category><![CDATA[Operatingsystem]]></category>
		<category><![CDATA[Utilities]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.pastbedti.me/?p=540</guid>
		<description><![CDATA[A couple of days ago my Terminal.app (console) got a really annoying feature. When launching the console or when I created a new tab it got stuck for about 5-10 seconds before I got my prompt. 
If you are like me and are spending most of your time in Terminal.app you understand how annoying this [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of days ago my Terminal.app (console) got a really annoying feature. When launching the console or when I created a new tab it got stuck for about 5-10 seconds before I got my prompt. </p>
<p>If you are like me and are spending most of your time in Terminal.app you understand how annoying this is/was. </p>
<p>I tried to rename .profile, .inputrc and evey other startup script I had in my home folder but the problem did not go away. </p>
<p>Then I found an OSX user which had his Terminal crash when started. He solved his problem by cleaning up some OSX systemlogs. So I thought I try the same trick.</p>
<p>The logfiles which he removed where the asl files under /private/var/log/asl/</p>
<p>I read about them here: <a href="http://macosx.com/tech-support/can-i-deleteasl-log/24223.html">http://macosx.com/tech-support/can-i-deleteasl-log/24223.html</a></p>
<p>But I figured I&#8217;d just remove them all <img src='http://www.pastbedti.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>[cc lang=bash]<br />
sudo rm -rf /private/var/log/asl/*<br />
[/cc]</p>
<p>When all asl files where removed my Terminal went back to normal again and I am sooooooo relieved. </p>
<p><strong>This worked for me BUT I do not recommend you to remove anything if you do not know what you are doing!!!<br />
</strong><br />
Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pastbedti.me/2009/09/5-10-second-delay-when-launching-terminal-in-osx/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Running couchdb under an unprivileged user account.</title>
		<link>http://www.pastbedti.me/2009/04/running-couchdb-under-an-unprivileged-user-account/</link>
		<comments>http://www.pastbedti.me/2009/04/running-couchdb-under-an-unprivileged-user-account/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 18:23:55 +0000</pubDate>
		<dc:creator>Mathias Stjernström</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[couchdb]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[unprivileged]]></category>

		<guid isPermaLink="false">http://www.pastbedti.me/?p=423</guid>
		<description><![CDATA[When helping a friend last night with couchdb a got stuck when trying to start it as an unprivileged user. The error messages you get from couchdb is far from easy to understand. 
This is my way of solving it.

[cc console]
$ couchdb
kernel-poll not supported; &#8220;K&#8221; parameter ignored
Apache CouchDB 0.9.0 (LogLevel=info) is starting.
{&#8220;init terminating in do_boot&#8221;,{{badmatch,{error,shutdown}},[{couch_server_sup,start_server,1},{erl_eval,do_apply,5},{erl_eval,exprs,5},{init,start_it,1},{init,start_em,1}]}}
Crash [...]]]></description>
			<content:encoded><![CDATA[<p>When helping a friend last night with couchdb a got stuck when trying to start it as an unprivileged user. The error messages you get from couchdb is far from easy to understand. </p>
<p>This is my way of solving it.<br />
<span id="more-423"></span></p>
<p>[cc console]<br />
$ couchdb<br />
kernel-poll not supported; &#8220;K&#8221; parameter ignored<br />
Apache CouchDB 0.9.0 (LogLevel=info) is starting.<br />
{&#8220;init terminating in do_boot&#8221;,{{badmatch,{error,shutdown}},[{couch_server_sup,start_server,1},{erl_eval,do_apply,5},{erl_eval,exprs,5},{init,start_it,1},{init,start_em,1}]}}</p>
<p>Crash dump was written to: erl_crash.dump<br />
init terminating in do_boot ()<br />
[/cc]</p>
<p>Even with debug turned on it&#8217;s pretty hard to understand.</p>
<p>[cc console]<br />
kernel-poll not supported; &#8220;K&#8221; parameter ignored<br />
Apache CouchDB 0.9.0 (LogLevel=debug) is starting.<br />
Configuration Settings ["./couchdb/local.ini"]:<br />
  [Couch] BindAddress=&#8221;127.0.0.1&#8243;<br />
  [Couch] ConsoleStartupMsg=&#8221;Apache CouchDB is starting.&#8221;<br />
  [Couch] DbRootDir=&#8221;/home/mathias/couchdb&#8221;<br />
  [Couch] DocumentRoot=&#8221;/home/mathias/couchdb/www&#8221;<br />
  [Couch] LogFile=&#8221;/home/mathias/couchdb/couch.log&#8221;<br />
  [Couch] LogLevel=&#8221;debug&#8221;<br />
  [Couch] Port=&#8221;5984&#8243;<br />
  [Couch] UtilDriverDir=&#8221;/usr/local/lib/couchdb/erlang/lib/couch-0.8.1-incubating/priv/lib&#8221;<br />
  [Couch Query Servers] javascript=&#8221;/usr/local/bin/couchjs /usr/local/share/couchdb/server/main.js&#8221;<br />
  [couchdb] database_dir=&#8221;/home/mathias/couchdb&#8221;<br />
  [couchdb] view_index_dir=&#8221;/home/mathias/couchdb&#8221;<br />
  [httpd] bind_address=&#8221;127.0.0.1&#8243;<br />
  [httpd] port=&#8221;5984&#8243;<br />
  [log] level=&#8221;debug&#8221;<br />
[error] [<0.41.0>] {error_report,<0.21.0>,<br />
    {<0.41.0>,crash_report,<br />
     [[{pid,<0.41.0>},<br />
       {registered_name,couch_server},<br />
       {error_info,<br />
           {exit,<br />
               {badarg,<br />
                   [{erlang,list_to_integer,[undefined]},<br />
                    {couch_server,init,1},<br />
                    {gen_server,init_it,6},<br />
                    {proc_lib,init_p_do_apply,3}]},<br />
               [{gen_server,init_it,6},{proc_lib,init_p_do_apply,3}]}},<br />
       {initial_call,{couch_server,init,['Argument__1']}},<br />
       {ancestors,[couch_primary_services,couch_server_sup,<0.1.0>]},<br />
       {messages,[]},<br />
       {links,[<0.36.0>]},<br />
       {dictionary,[]},<br />
       {trap_exit,false},<br />
       {status,running},<br />
       {heap_size,233},<br />
       {stack_size,23},<br />
       {reductions,113}],<br />
      []]}}<br />
{&#8220;init terminating in do_boot&#8221;,{{badmatch,{error,shutdown}},[{couch_server_sup,start_server,1},{erl_eval,do_apply,5},{erl_eval,exprs,5},{init,start_it,1},{init,start_em,1}]}}</p>
<p>Crash dump was written to: erl_crash.dump<br />
init terminating in do_boot ()<br />
[/cc]</p>
<p>When running things as unprivileged users the usual problems are that you do not have access to read/write files or binding to the lower ports A.K.A. &#8220;well known ports&#8221;.  With that in mind I located the original config files for couchdb with the plan of copying or overriding them. </p>
<p>My config files where located under <strong>/usr/local/etc/couchdb/</strong></p>
<p>[cc console]<br />
$ ls -lsa /usr/local/etc/couchdb/<br />
4 -rw-r&#8211;r&#8211; 1 root root 2626 2009-04-10 11:58 default.ini<br />
4 -rw-r&#8211;r&#8211; 1 root root  847 2009-04-10 14:17 local.ini<br />
[/cc]</p>
<p>Reading the documentation I found out that local.ini is just for overriding stuff and local.ini will never be overwritten by any upgrades. The config files contain lots of settings, but my aim is just to get it to start so I focus on the things that I think is the problem and thats all the PATH settings. </p>
<p>In my  unprivileged users home folder I created a folder named couchdb to hold my config and datafiles. I also created a www folder inside it. </p>
<p>After that I create my local.ini to override my settings:</p>
<p>[cc console]<br />
$ cat couchdb/local.ini </p>
<p>[couchdb]<br />
database_dir = ./couchdb<br />
view_index_dir = ./couchdb</p>
<p>[httpd]<br />
port = 5984<br />
bind_address = 127.0.0.1</p>
<p>[log]<br />
level = info<br />
file=./couchdb/couch.log<br />
[/cc]</p>
<p>When our new config is in place we can try to start couchdb again. </p>
<p>[cc console]<br />
$ couchdb -C ./couchdb/local.ini -p ./couchdb/couch.pid -b<br />
Apache CouchDB has started, time to relax.<br />
[/cc]</p>
<p><strong>-C</strong> means use configuration FILE (chainable, does not reset system default). If we do not want to use the system config at all we can use a lowercase -c but we want to keep our overridden config as small as possible right now.</p>
<p><strong>-p</strong> is the path to our pid file and <strong>-b</strong> tells couchdb to spawn in the background.</p>
<p>If you are on your local machine you can just launch your browser and point it to <a href="http://127.0.0.1:5984/">http://127.0.0.1:5984/</a></p>
<p>[cc json]<br />
{&#8220;couchdb&#8221;:&#8221;Welcome&#8221;,&#8221;version&#8221;:&#8221;0.9.0&#8243;}<br />
[/cc]</p>
<p>or you can access the admin gui trough: <a href="http://127.0.0.1:5984/_utils/index.html">http://127.0.0.1:5984/_utils/index.html</a>.</p>
<p>After I started to write this blogpost I did found a page on the Couchdb wiki that explains Error messages and solutions and here it is: <a href="http://wiki.apache.org/couchdb/Error_messages">http://wiki.apache.org/couchdb/Error_messages</a>.</p>
<p>Happy haxxing! </p>
]]></content:encoded>
			<wfw:commentRss>http://www.pastbedti.me/2009/04/running-couchdb-under-an-unprivileged-user-account/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
