<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Code Ghar</title>
	<atom:link href="http://codeghar.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://codeghar.wordpress.com</link>
	<description>Code, Scripts, Configurations, and Discussion</description>
	<lastBuildDate>Fri, 13 Nov 2009 21:50:26 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='codeghar.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/f166b0cc8508c3c1b2f39dd397eca412?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Code Ghar</title>
		<link>http://codeghar.wordpress.com</link>
	</image>
			<item>
		<title>When I Choose Python</title>
		<link>http://codeghar.wordpress.com/2009/11/10/when-i-choose-python/</link>
		<comments>http://codeghar.wordpress.com/2009/11/10/when-i-choose-python/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 15:11:15 +0000</pubDate>
		<dc:creator>hs</dc:creator>
				<category><![CDATA[discussion]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://codeghar.wordpress.com/?p=421</guid>
		<description><![CDATA[I choose Python to write mostly small scripts, helper tools, s&#8217;il vous plaît. I use it to process text files to extract and transform data (poor man&#8217;s ETL). I use it to automate routine manual tasks so I can do bigger and better things with the saved time. I have even (successfully) attempted to write [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeghar.wordpress.com&blog=1985485&post=421&subd=codeghar&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I choose Python to write mostly small scripts, helper tools, s&#8217;il vous plaît. I use it to process text files to extract and transform data (poor man&#8217;s ETL). I use it to automate routine manual tasks so I can do bigger and better things with the saved time. I have even (successfully) attempted to write a prototype B2B web application for my employer. I now understand the range of tasks I can accomplish with Python.</p>
<p>But the right tool should always be used for the job. I am not a programmer. I program a bit here and there but that is not my primary task, interest, or goal. I don&#8217;t write enterprise software. This is why I write scripts and not software. And Python is a very handy and helpful language to write them in.</p>
<p>I have learned and used C, C++, Java, and Perl. They all do wonderful things on their own but the kind of work I do, they are either too unwieldy or Python beats them in &#8220;having fun while creating&#8221;. When I choose Python, I don&#8217;t choose it because it is the best language in the world. I choose it because it gets the job done for me and saves me time. I am not saying that Python could not be used to write enterprise software and I am not saying it could. But for a person who works with data, database, networking, and voice technologies, Python is a useful tool. Use it where appropriate and don&#8217;t try to ram it down a project if it&#8217;s not a good fit.</p>
<p>N.B. The idea for this post came from <a href="http://www.reddit.com/r/Python/comments/a2qxs/bad_news_google_employees_are_being_discouraged/">Bad news: Google employees are being discouraged from using Python for new projects</a>.</p>
Posted in discussion Tagged: python <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeghar.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeghar.wordpress.com/421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeghar.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeghar.wordpress.com/421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeghar.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeghar.wordpress.com/421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeghar.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeghar.wordpress.com/421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeghar.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeghar.wordpress.com/421/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeghar.wordpress.com&blog=1985485&post=421&subd=codeghar&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codeghar.wordpress.com/2009/11/10/when-i-choose-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/71f989105ceedf560923a5bd2b0f6e30?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">hs</media:title>
		</media:content>
	</item>
		<item>
		<title>Code Ghar Official Linux Desktop</title>
		<link>http://codeghar.wordpress.com/2009/11/03/code-ghar-official-linux-desktop/</link>
		<comments>http://codeghar.wordpress.com/2009/11/03/code-ghar-official-linux-desktop/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 17:05:58 +0000</pubDate>
		<dc:creator>hs</dc:creator>
				<category><![CDATA[configuration]]></category>
		<category><![CDATA[discussion]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://codeghar.wordpress.com/?p=414</guid>
		<description><![CDATA[So I decided to take the plunge and use Linux on the desktop. This post describes how the first ever official Code Ghar Linux desktop was created. As I make changes to the computer, I will keep this post updated.
Distribution
I first installed Fedora Rawhide (nightly build) using ext4 as the filesystem. After a couple days, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeghar.wordpress.com&blog=1985485&post=414&subd=codeghar&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>So I decided to take the plunge and use Linux on the desktop. This post describes how the first ever official Code Ghar Linux desktop was created. As I make changes to the computer, I will keep this post updated.</p>
<h3>Distribution</h3>
<p>I first installed Fedora Rawhide (nightly build) using ext4 as the filesystem. After a couple days, I decided to add more memory to the system. Once this memory was installed successfully, the OS would not boot at all. I decided to not risk things further and went with Debian testing (Squeeze) instead. I am more comfortable with a Debian based system anyways so the choice wasn&#8217;t hard. I chose the netinstall CD and only installed the command line (did not choose the Desktop option during install).</p>
<h3>Desktop Environment</h3>
<p>I wanted to make best use of the 3GB RAM in my system. So I chose to install LXDE as my desktop environment. Since I was only running command line, I ran the following command to install LXDE.</p>
<p><code>sudo aptitude install xorg gdm lxde</code></p>
<h3>Wine</h3>
<p>I needed to run three main applications. I could either install a virtual machine running Windows to run these apps or install Wine. I decided to try out Wine. To install Wine, I ran the following command.</p>
<p><code>sudo aptitude install wine</code></p>
<p>Once installed, all you have to do is run the exe file to install your desired application and Wine takes care of the rest. But make sure you have searched that application on the <a href="http://appdb.winehq.org/index.php">Wine Application Database</a>.</p>
<h3>Virtualization</h3>
<p>However much I want to move away from Windows, I just can&#8217;t because of some applications. I chose to use VirtualBox although I have been using VMware on Windows and Mac for a couple years now. To install VirtualBox on Debian, I followed their Wiki (<a href="http://wiki.debian.org/VirtualBox">VirtualBox Installation</a>). Following are the commands I ran.</p>
<p><code>sudo aptitude install virtualbox-ose virtualbox-ose-modules-$(uname -r)</code></p>
<p><code>sudo invoke-rc.d udev reload</code></p>
<p><code>sudo modprobe vboxdrv</code></p>
<p><code>sudo addgroup vboxusers</code></p>
<p><code>sudo adduser codeghar vboxusers</code></p>
<p>I then logged out and logged back in for VirtualBox to be ready to be used.</p>
<h3>Remote Access</h3>
<p>To allow remote access to my machine using VNC, I chose to use X11VNC. To install it, I ran the following command:</p>
<p><code>sudo aptitude install x11vnc</code></p>
<p>To invoke it for my user (since I have a single-user machine), I ran the following command once I logged in. This command is all on one line (in case the formatting of the blog makes it appear different)</p>
<p><code>x11vnc -display :0 -xkb -bg -forever -passwd <em>mypassword</em></code></p>
<p>What this does is that it allows you to access your actual desktop on port 5900, runs in the background (bg flag), does not stop after first remote client disconnects (forever flag) i.e. keeps running, and assigns a password (passwd) which must be used to authenticate yourself. The xkb flag was used because for some reason the shift key did not work when I ran a VNC client from another machine into this one. I forgot which resource I used to fix this issue but I will put up the link once I can find it again.</p>
<p>If my computer is restarted, I will have to run the same command again for me to be able to use VNC. This is why you need access to at least SSH to be able to run this command and start VNC. I added the following alias at the end of my <code>~/.bashrc</code> file. This way I don&#8217;t have to retype the command all the time.</p>
<p><code>alias myvnc="x11vnc -display :0 -xkb -bg -forever -passwd <em>mypassword</em>"</code></p>
<h3>Flash for Iceweasel (Firefox)</h3>
<p>To install Adobe Flash, I followed the instructions on <a href="http://www.debianadmin.com/how-to-install-adobe-flash-in-debian-etchlennysid.html">How to Install Adobe Flash in Debian Etch/Lenny/Sid</a>. As they were very generic, I took only what I needed and did the following.</p>
<p>First I downloaded the <a href="http://www.debian-multimedia.org/pool/main/d/debian-multimedia-keyring/debian-multimedia-keyring_2008.10.16_all.deb">debian-multilemedia-keyring package</a> on the desktop. Then I ran the following command to add it to aptitude.</p>
<p><code>sudo dpkg -i ~/Desktop/debian-multimedia-keyring_2008.10.16_all.deb</code></p>
<p>The I modified my <em>/etc/apt/sources.list</em> and added the following line:</p>
<p><code>deb http://www.debian-multimedia.org testing main</code></p>
<p>I then ran the following command to update aptitude and then install Flash.</p>
<p><code>sudo aptitude update</code></p>
<p><code>sudo aptitude install flashplayer-mozilla</code></p>
<h3>Remote File Access with SSHFS</h3>
<p>I used the guide at <a href="http://www.debianadmin.com/mount-a-remote-file-system-through-ssh-using-sshfs.html">Mount a remote file system through ssh Using sshfs</a> to get this working. I strongly recommend that you read it thoroughly for better information. To install SSHFS, you also need to install FUSE, as below.</p>
<p><code>sudo aptitude install fuse-utils sshfs</code></p>
<p>Now you need to do two things: load the FUSE module (as below)</p>
<p><code>sudo modprobe fuse</code></p>
<p>and also add your user to the fuse group (as below)</p>
<p><code>sudo adduser codeghar fuse</code></p>
<p>I then had to log out and log back in for my user to be recognized as part of fuse group.</p>
<p>I then created a mount directory in my home folder, created folders for all remote file systems I need to access, and created aliases for mounting and un-mounting SSHFS &#8220;shares&#8221;.</p>
<p><code>mkdir /home/codeghar/.mount/</code><br />
<code>mkdir /home/codeghar/.mount/server1</code><br />
<code>mkdir /home/codeghar/.mount/server2</code></p>
<p>To mount server1, I ran the following (also added this as a bash alias to save typing):</p>
<p><code>sshfs codeghar@10.10.1.101:/home/remoteuser/ /home/codeghar/.mount/server1</code></p>
<p>To unmount server1, I ran the following (also added this as a bash alias to save typing):</p>
<p><code>fusermount -u /home/codeghar/.mount/server1</code></p>
<h3>Miscellaneous Applications</h3>
<p>Following are the applications I also installed.</p>
<p>OpenOffice: <code>sudo aptitude install openoffice.org</code><br />
Wireshark: <code>sudo aptitude install wireshark</code><br />
gvim: <code>sudo aptitude install gvim</code><br />
VNC client: <code>sudo aptitude install vncviewer</code><br />
Grsync: <code>sudo aptitude install grsync</code><br />
Pidgin: <code>sudo aptitude install pidgin</code><br />
PDF: <code>sudo aptitude install epdfview</code><br />
Samba: <code>sudo aptitude install samba samba-client smbfs</code></p>
Posted in configuration, discussion Tagged: linux <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeghar.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeghar.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeghar.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeghar.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeghar.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeghar.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeghar.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeghar.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeghar.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeghar.wordpress.com/414/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeghar.wordpress.com&blog=1985485&post=414&subd=codeghar&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codeghar.wordpress.com/2009/11/03/code-ghar-official-linux-desktop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/71f989105ceedf560923a5bd2b0f6e30?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">hs</media:title>
		</media:content>
	</item>
		<item>
		<title>Openfiler: Network Access Configuration Changes Disappear</title>
		<link>http://codeghar.wordpress.com/2009/10/19/openfiler-network-access-configuration-changes-disappear/</link>
		<comments>http://codeghar.wordpress.com/2009/10/19/openfiler-network-access-configuration-changes-disappear/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 21:33:20 +0000</pubDate>
		<dc:creator>hs</dc:creator>
				<category><![CDATA[configuration]]></category>
		<category><![CDATA[openfiler]]></category>

		<guid isPermaLink="false">http://codeghar.wordpress.com/?p=405</guid>
		<description><![CDATA[One day suddenly I could not copy files to my SMB share. I got an error that &#8220;the specified network name is no longer available&#8221;. I looked in /var/log/messages and one repeated error was rps.statd can&#8217;t decode rpc message. I tried to search for its cause and could not find anything that would solve my [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeghar.wordpress.com&blog=1985485&post=405&subd=codeghar&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>One day suddenly I could not copy files to my SMB share. I got an error that &#8220;the specified network name is no longer available&#8221;. I looked in <em>/var/log/messages</em> and one repeated error was <em>rps.statd can&#8217;t decode rpc message</em>. I tried to search for its cause and could not find anything that would solve my problem with not being able to copy any files to the share.</p>
<p>After mucking around the system, I noticed that in Network Access Configuration (in the web GUI), one by one all the entries started to disappear (on each refresh). If I tried to add them back, they would not stick and on refresh would disappear again. Googling revealed a very helpful resource: <a href="https://forums.openfiler.com/viewtopic.php?pid=15861">Network Access Configuration Changes Don&#8217;t &#8220;Stick&#8221;</a>. According to it, the error could be caused by logs filling up the whole filesystem. I looked in <em>/var/log/</em> and saw that the <em>raa</em> folder was taking in excess of 1.3 GB in a root partition of 2 GB (<code>df -h</code> and <code>du -ah</code> revealed this to me). Navigating to the <em>raa</em> folder showed that two files were approximately 600 MB is size: <em>lighttpd.access.log</em> and <em>web-access</em>. I removed these files and then restarted the machine (thinking on the next boot these files would be generated again).</p>
<p>Upon successful reboot, I was able to add entries to Network Access Configuration and everything was back to normal.</p>
<p>Bonus tips: To display all volume groups in command line, use <code>vgdisplay</code>. To display all logical volumes, use <code>lvdisplay</code>. To remove a logical volume via command line, when they can&#8217;t be deleted from the web GUI, use <code><a href="http://linux.die.net/man/8/lvremove">lvmremove</a></code>. Hat tip to <a href="https://forums.openfiler.com/viewtopic.php?id=892">Can&#8217;t delete volume group</a>.</p>
Posted in configuration Tagged: openfiler <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeghar.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeghar.wordpress.com/405/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeghar.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeghar.wordpress.com/405/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeghar.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeghar.wordpress.com/405/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeghar.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeghar.wordpress.com/405/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeghar.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeghar.wordpress.com/405/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeghar.wordpress.com&blog=1985485&post=405&subd=codeghar&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codeghar.wordpress.com/2009/10/19/openfiler-network-access-configuration-changes-disappear/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/71f989105ceedf560923a5bd2b0f6e30?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">hs</media:title>
		</media:content>
	</item>
		<item>
		<title>Install Trac on Debian Squeeze</title>
		<link>http://codeghar.wordpress.com/2009/10/14/install-trac-on-debian-squeeze/</link>
		<comments>http://codeghar.wordpress.com/2009/10/14/install-trac-on-debian-squeeze/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 16:39:30 +0000</pubDate>
		<dc:creator>hs</dc:creator>
				<category><![CDATA[configuration]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[debian]]></category>

		<guid isPermaLink="false">http://codeghar.wordpress.com/?p=384</guid>
		<description><![CDATA[This post aims to provide a step-by-step on how to install Trac in Debian and get it working. These &#8220;instructions&#8221; were created exactly the way I setup my server. So paths and setup information can be modified for your project. The idea was this: there are many guides out there which provide the same information [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeghar.wordpress.com&blog=1985485&post=384&subd=codeghar&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This post aims to provide a step-by-step on how to install Trac in Debian and get it working. These &#8220;instructions&#8221; were created exactly the way I setup my server. So paths and setup information can be modified for your project. The idea was this: there are many guides out there which provide the same information but in a more generic way; this post provides exact path information and such so that there is concrete, real world example of what needs to be done.</p>
<p>CAUTION: This post is a work in progress so there are many things which might not be properly documented and could have adverse effect.</p>
<h3>Install Necessary Applications</h3>
<p><code>sudo aptitude install trac bzr trac-bzr trac-spamfilter postgresql python-psycopg2 apache2 libapache2-mod-wsgi</code></p>
<h3>Prepare Database</h3>
<p><code>sudo vim /etc/postgresql/8.4/main/pg_hba.conf</code><br />
Add following lines:<br />
<code>local tracdb tracuser password<br />
host tracdb tracuser 127.0.0.1/32 md5<br />
host tracdb tracuser 192.168.1.0/24 md5</code></p>
<p><code>psql template1 -W postgres</code><br />
<code>create database tracdb with encoding = 'utf8';</code><br />
<code>create user tracuser password 'password';</code><br />
<code>grant all on database tracdb to tracuser;</code><br />
<code>sudo /etc/init.d/postgresql-8.4 reload</code></p>
<h3>Prepare Directories</h3>
<p><del><code>cd /media/shared/Admin/</code></del><br />
<code>cd /home/codeghar/</code><br />
<code>mkdir /home/codeghar/trac</code><br />
<del><code>cd trac</code></del><br />
<code>cd /home/codeghar/trac/</code><br />
<code>mkdir repo env</code><br />
<code>cd /home/codeghar/trac/repo/</code><br />
<code>bzr init</code></p>
<h3>Create Trac Project</h3>
<p><del><code>cd /media/shared/Admin/env/</code></del><br />
<code>cd /home/codeghar/trac/env/</code><br />
<del><code>trac-admin $(pwd) initenv</code></del><br />
<code>trac-admin /home/codeghar/trac/env/ initenv</code><br />
<em>Project Name [My Project]&gt; codeghartrac</em><br />
<em>Database connection string [sqlite:db/trac.db]&gt; postgres://tracuser:password@localhost/tracdb</em><br />
<em>Repository type [svn]&gt; bzr</em><br />
<em>Path to repository [/path/to/repos]&gt; /media/shared/Admin/trac/repo</em></p>
<h3>Enable Bazaar with Trac</h3>
<p>To get Trac working with bzr, edit the trac.ini file (Hat tip: <a href="https://lists.ubuntu.com/archives/bazaar/2008q1/037738.html">bzr &#8211; trac integration</a>)<br />
<code>vim /media/shared/Admin/trac/env/conf/trac.ini</code><br />
And add the following two lines, if they don&#8217;t already exist<br />
<code>[components]</code><br />
<code>tracbzr.* = enabled</code></p>
<h3>First Test</h3>
<p>Check if everything is working as it should be</p>
<p><code>tracd --port 8000 /media/shared/Admin/trac/repo/</code></p>
<h3>Trac with WSGI and Apache</h3>
<p><del><code>cd /media/shared/Admin/trac/www/</code></del><br />
<del><code>trac-admin /media/shared/Admin/trac/env/ deploy /media/shared/Admin/trac/www/</code></del><br />
<code>trac-admin /home/codeghar/trac/env/ deploy /home/codeghar/trac/www/</code></p>
<p>Put the following in your Virtual Host:</p>
<p><code>WSGIScriptAlias / /home/codeghar/trac/www/cgi-bin/trac.wsgi</code><br />
<code><br />
&lt;Directory /home/codeghar/trac/www/cgi-bin/trac.wsgi&gt;<br />
    WSGIApplicationGroup %{GLOBAL}<br />
    Order deny,allow<br />
    Allow from all<br />
&lt;/Directory&gt;<br />
</code></p>
<p>And then reload Apache. Your site is now available at http://yourip/</p>
<p>Hat tip: <a href="http://svn.debian.org/viewsvn/python-apps/packages/trac/trunk/debian/README.Debian?view=markup">View of /packages/trac/trunk/debian/README.Debian</a>; <a href="http://forum.webfaction.com/viewtopic.php?id=778">bazaar &amp; trac-bzr</a>; <a href="http://trac.edgewall.org/wiki/PostgresqlRecipe">Recipe Installing Trac with PostgreSQL on CentOS4.2</a>; <a href="http://trac.edgewall.org/wiki/TracModWSGI">Trac and mod_wsgi</a>;</p>
Posted in configuration Tagged: apache, debian <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeghar.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeghar.wordpress.com/384/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeghar.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeghar.wordpress.com/384/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeghar.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeghar.wordpress.com/384/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeghar.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeghar.wordpress.com/384/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeghar.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeghar.wordpress.com/384/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeghar.wordpress.com&blog=1985485&post=384&subd=codeghar&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codeghar.wordpress.com/2009/10/14/install-trac-on-debian-squeeze/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/71f989105ceedf560923a5bd2b0f6e30?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">hs</media:title>
		</media:content>
	</item>
		<item>
		<title>When to use GET and POST</title>
		<link>http://codeghar.wordpress.com/2009/10/06/when-to-use-get-and-post/</link>
		<comments>http://codeghar.wordpress.com/2009/10/06/when-to-use-get-and-post/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 20:57:12 +0000</pubDate>
		<dc:creator>hs</dc:creator>
				<category><![CDATA[discussion]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[django]]></category>

		<guid isPermaLink="false">http://codeghar.wordpress.com/?p=391</guid>
		<description><![CDATA[In HTTP and/or HTML, there are two (main?) types of submissions: GET and POST. I have always had a hard time determining when to use GET and when to use POST. In other words, what is the main difference between GET and POST?
Quite simply, if the submission is reading data, without making any changes, use [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeghar.wordpress.com&blog=1985485&post=391&subd=codeghar&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In HTTP and/or HTML, there are two (main?) types of submissions: GET and POST. I have always had a hard time determining when to use GET and when to use POST. In other words, what is the main difference between GET and POST?</p>
<p>Quite simply, if the submission is reading data, without making any changes, use GET. If your submission will be making changes, or causing side-effects, use POST. For example, when doing a query, such as a Google search, the form should use GET. If you are creating a new account with Yahoo! mail, the form should use POST. The Google search is reading data and new account in Yahoo! mail is changing things.</p>
<p>Simple enough, right? Not so, as there are some situations where either could work. One of the best descriptions of the problem I have read is <a href="http://www.cs.tut.fi/~jkorpela/forms/methods.html">Methods GET and POST in HTML forms &#8211; what&#8217;s the difference?</a> And here is what I learned from it (you might learn something else reading the same words):</p>
<p>When doing a submission which will not make changes use GET. When making changes, use POST. But you may want to use POST instead of GET in the following (major?) case: when you don&#8217;t want the data you submit to become a part of the URL. When using GET, the form you submit becomes a part of the URL. So if you have a couple fields, say myname and mynumber, using GET your URL might look like <em>http://www.mydomain.com/someform.html/?myname=codeghar&amp;mynumber=1234</em> after submission. The biggest benefit is that you can bookmark this URL and visit it in future as just another link. The biggest disadvantage, in my opinion, is when you have multiple fields, the fields and their data becomes part of the URL, thus making for ugly URLs. So instead of a neat looking, small URL, you get one huge string.</p>
<p>Don&#8217;t get me wrong: a useful URL, even if ugly, should be preferred to an unfriendly, pretty URL. But if you want to pretty-fy your URLs, use POST instead of GET. And with a pretty URL, your user doesn&#8217;t have to know the inner workings of your form. They can still look at the source code of the page to see what&#8217;s going on, but only if they want to. Encoding the form data into a URL forces them to deal with the data even if they don&#8217;t want to.</p>
<p>The second benefit of using POST is that if your form contains non-ASCII data, it doesn&#8217;t form a part of the URL, which might be a good thing if your HTTP server is unable to handle this data in the URL. I don&#8217;t know, maybe all modern servers or intermediary devices can handle this stuff easily. But better safe than sorry, eh?</p>
<p>So from today my best practice is thus: if the form has a small number of fields, showing the submitted data in the URL is not a problem, and/or URL should be bookmark-able for future reference, use GET if there are no side-effects. If none of these requirements is met, use POST.</p>
<p>One concern I have is: if using HTTPS, is the URL sent in the secure tunnel or is it plaintext for all to see? According to the responses at <a href="http://answers.google.com/answers/threadview/id/758002.html">HTTPS &#8211; is URL string itself secure??</a>, the URL should be encrypted before being sent to the server as it is sent as part of the tunnel rather than a separate string. I think it would depend on the implementation of the client and server (I could be wrong in thinking this).</p>
<p>Don&#8217;t take my understanding of the situation as the final word. Read as much as you can on the subject to form your own best practice. And if you share your understanding and best practice with us, it would help us as well.</p>
<p>Good reads and hat tips: <a href="http://www.w3.org/2001/tag/doc/whenToUseGet.html">URIs, Addressability, and the use of HTTP GET and POST</a>; <a href="http://www.cs.tut.fi/~jkorpela/forms/methods.html">Methods GET and POST in HTML forms &#8211; what&#8217;s the difference?</a>; <a href="http://en.wikipedia.org/wiki/Post/Redirect/Get">Post/Redirect/Get</a>;</p>
Posted in discussion Tagged: apache, django <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeghar.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeghar.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeghar.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeghar.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeghar.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeghar.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeghar.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeghar.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeghar.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeghar.wordpress.com/391/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeghar.wordpress.com&blog=1985485&post=391&subd=codeghar&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codeghar.wordpress.com/2009/10/06/when-to-use-get-and-post/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/71f989105ceedf560923a5bd2b0f6e30?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">hs</media:title>
		</media:content>
	</item>
	</channel>
</rss>