<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Technology Blog of Peter Manis</title>
	
	<link>http://pyverted.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sun, 06 Sep 2009 00:58:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/pyverted" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Google Chrome on Linux</title>
		<link>http://feedproxy.google.com/~r/pyverted/~3/O01q3x6YrGU/</link>
		<comments>http://pyverted.com/linux/google-chrome-on-linux/2009/09/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 00:58:40 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://pyverted.com/?p=398</guid>
		<description><![CDATA[This won&#8217;t be long, I just want to go over a couple things about Chrome on Linux.  So first off, its fast, super duper fast.  I am running Chrome on 64bit Ubuntu 9.04 with a SSD and Chrome starts up faster than pretty much anything else.
If you aren&#8217;t able to get your GTK [...]]]></description>
			<content:encoded><![CDATA[<p>This won&#8217;t be long, I just want to go over a couple things about Chrome on Linux.  So first off, its fast, super duper fast.  I am running Chrome on 64bit Ubuntu 9.04 with a SSD and Chrome starts up faster than pretty much anything else.</p>
<p>If you aren&#8217;t able to get your GTK theme to work apply one of the other themes available, and then select use GTK theme.</p>
<p>Also if you want to enable Flash do the following</p>
<pre><code>$ sudo updatedb
$ locate libflashplayer.so
$ mkdir /opt/google/chrome/plugins/
$ cp [insert libflashplayer.so location here] /opt/google/chrome/plugins/</code></pre>
<p>Now change the shortcut for Chrome to</p>
<pre><code>/opt/google/chrome/google-chrome --enable-plugins %U</code></pre>
<p>Enjoy the speed and smoothness that is Chrome.</p>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/linux/google-chrome-on-linux/2009/09/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://pyverted.com/linux/google-chrome-on-linux/2009/09/</feedburner:origLink></item>
		<item>
		<title>Python Zipfile support</title>
		<link>http://feedproxy.google.com/~r/pyverted/~3/9Eb2isxnOFU/</link>
		<comments>http://pyverted.com/python/python-zipfile-support/2009/08/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 04:34:06 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Python 2.6]]></category>

		<guid isPermaLink="false">http://pyverted.com/?p=378</guid>
		<description><![CDATA[One of my favorite features in Python 2.6 is zipfile support.  It is mentioned it was changed in 2.5, but so far I have not been able to get it to work.  Basically you create a __main__.py file that will act very much like __main__ does in scripts.  You can then make [...]]]></description>
			<content:encoded><![CDATA[<p>One of my favorite features in Python 2.6 is zipfile support.  It is mentioned it was changed in 2.5, but so far I have not been able to get it to work.  Basically you create a __main__.py file that will act very much like __main__ does in scripts.  You can then make a zip file of your Python code and execute it directly.  If you want to read more about it you can read it on the <a href="http://docs.python.org/using/cmdline.html" target="_blank">command line page</a> of the Python documentation.<br />
<span id="more-378"></span><br />
Here is an example you would put in __main__.py</p>
<pre name="code" class="python:nogutter">
#/usr/bin/python2.6
#
# ziptest.py
import sys
print sys.argv
</code></pre>
<p>and for the sake of this example we will have another file with the header.  The best thing to do would be to make a system that added this to the beginning of the file when building it.  We will name this file zip_template.py</p>
<pre name="code" class="python:nogutter">
#/usr/bin/python2.6
#
# Copyright 2009, ME</code></pre>
<p>So lets zip up the __main__.py file and then concatenate the two files together to create our archive.  We also need to make it executable.</p>
<pre><code>$ zip tmp_appname.zip __main__.py
$ cat zip_template.py tmp_appname.zip &gt; appname.zip
$ rm tmp_appname.zip
$ chmod +x appname.zip
$ ./appname.zip
['./appname.zip']</code></pre>
<p>There you have it.  You can now bundle your Python code in a zip file and run it just like you would a Java jar.  It also doesn&#8217;t have to end with .zip you can name it .par or no extension at all if you like.</p>
<p>I would like to see <a href="http://bugs.python.org/issue6749" target="_blank">support for encrypted zip files</a> so that you can encrypt this archive and Python will prompt for the password.</p>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/python/python-zipfile-support/2009/08/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://pyverted.com/python/python-zipfile-support/2009/08/</feedburner:origLink></item>
		<item>
		<title>Endian Firewall Hostname Limitation</title>
		<link>http://feedproxy.google.com/~r/pyverted/~3/C_sJej7smiw/</link>
		<comments>http://pyverted.com/linux/endian-firewall-hostname-limitation/2009/08/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 02:40:34 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Endian]]></category>
		<category><![CDATA[Firewall]]></category>
		<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://pyverted.com/?p=376</guid>
		<description><![CDATA[Endian firewall seems to have a hostname limitation in their web interface that requires at least 3 characters.  I prefer a hostname that is shorter than that so I had to track down the settings to change it.  There are two files that you have to change.
/var/efw/main/settings
     HOSTNAME=$hostname
/var/efw/main/hostname.conf
  [...]]]></description>
			<content:encoded><![CDATA[<p>Endian firewall seems to have a hostname limitation in their web interface that requires at least 3 characters.  I prefer a hostname that is shorter than that so I had to track down the settings to change it.  There are two files that you have to change.</p>
<pre><code>/var/efw/main/settings
     HOSTNAME=$hostname
/var/efw/main/hostname.conf
     ServerName $hostname</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/linux/endian-firewall-hostname-limitation/2009/08/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://pyverted.com/linux/endian-firewall-hostname-limitation/2009/08/</feedburner:origLink></item>
		<item>
		<title>Using Mercurial on your home directory</title>
		<link>http://feedproxy.google.com/~r/pyverted/~3/sEtE62Vdyeo/</link>
		<comments>http://pyverted.com/version-control/using-mercurial-on-your-home-directory/2009/08/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 00:34:30 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[Version Control]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mercurial]]></category>

		<guid isPermaLink="false">http://pyverted.com/?p=353</guid>
		<description><![CDATA[This is a follow up to my previous post, Setting Up Version Control On Your Home Directory.  This post will cover using Mercurial instead of Git to store the files in your home directory.
To start this off you need to install Mercurial
sudo [yum or apt-get] install mercurial

The next step is initializing the repository in [...]]]></description>
			<content:encoded><![CDATA[<p>This is a follow up to my previous post, <a href="http://pyverted.com/linux/setting-up-version-control-on-your-home-directory/2009/08/" target="_blank">Setting Up Version Control On Your Home Directory</a>.  This post will cover using Mercurial instead of Git to store the files in your home directory.</p>
<p>To start this off you need to install Mercurial</p>
<pre><code>sudo [yum or apt-get] install mercurial</code></pre>
<p><span id="more-353"></span><br />
The next step is initializing the repository in your home directory and protect others from being able to read files.</p>
<pre><code>$ cd ~
$ hg init
$ chmod 700 .hg/</code></pre>
<p>In my previous post a commenter pointed out something I was not aware of.  When using git if you were to run &#8216;git clean&#8217; all files not under version control would get deleted.  You should be doing regular backups anyway, but that is certainly something we do not want to be able to do on accident.  The hg equivalent is &#8216;hg purge&#8217;, but purge is a bundled extension that must be enabled, and because it might be enabled we want to explicitly disable that plugin from being able to work in our repository.  To do so you put the following line in ~/.hg/hgrc, because that file will take precedence over conf files in etc and your ~/.hgrc file.</p>
<pre><code>[extensions]
hgext.purge = !</code></pre>
<p>You can store anything you would like to in this repository, but there is most likely going to be some files, and very large files at that, that you do not want to store.  To fix that we are going to start off by ignoring everything in your home directory and selectively removing files from the list that we want to store.  The following commands are going to list all non-hidden files, but listing directories first, the second command lists everything except for &#8216;.&#8217; and &#8216;..&#8217; directory references and greps for all hidden files and lists them directories first.  One thing to note is that the &#8211;group-directories-first option is not available on CentOS and the only distro I can confirm it exists in is Ubuntu.</p>
<pre><code>$ ls -1 --group-directories-first &gt; .hgignore
$ ls -1 --group-directories-first -A | grep '^\.' &gt;&gt; .hgignore
$ cat .hgignore
Applications
bin
Desktop
...
.cache
.checkbox
.compiz
...
.bash_aliases
.bash_history
.bash_logout
...
.xsession-errors</code></pre>
<p>Go through the list and either comment out (prepend with #) or remove from .hgignore any file/directory names that you DO want to store in version control, any file listed in .hgignore will be ignored by mercurial, unless you &#8216;hg add&#8217; the file or directory.</p>
<p>If you want to see what files will be picked up by an &#8216;hg add&#8217; you can run &#8216;hg status&#8217;</p>
<pre><code>$ hg status
? .bash_history
? .bash_logout
? .bash_profile
? .bashrc
? .hgignore
? .hgrc
? .mysql_history
? .screenrc
? bin/mysqltuner.pl</code></pre>
<p>If that is satisfactory you can now run &#8216;hg add&#8217; to add the files listed here.</p>
<pre><code>$ hg add
adding .bash_history
adding .bash_logout
adding .bash_profile
adding .bashrc
adding .hgignore
adding .hgrc
adding .mysql_history
adding .screenrc
adding bin/mysqltuner.pl</code></pre>
<p>And you can verify it by again running &#8216;hg status&#8217;</p>
<pre><code>$ hg status
A .bash_history
A .bash_logout
A .bash_profile
A .bashrc
A .hgignore
A .hgrc
A .mysql_history
A .screenrc
A bin/mysqltuner.pl</code></pre>
<p>So go ahead now and run &#8216;hg commit&#8217; and we can deal with individual files under ignored directories afterwards.  Running &#8216;hg commit&#8217; should be default use vi as your editor so after writing your description his Esc, then type :wq and it will commit.</p>
<pre><code>Initial commit of home directory files.

Contains mostly bash dot files, but also a script in my bin directory

HG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: Leave message empty to abort commit.
HG: --
HG: user: Peter Manis &lt;manis@pyverted.com&gt;
HG: branch 'default'
HG: added .bash_history
HG: added .bash_logout
HG: added .bash_profile
HG: added .bashrc
HG: added .hgignore
HG: added .hgrc
HG: added .mysql_history
HG: added .screenrc
HG: added bin/mysqltuner.pl</code></pre>
<p>So there were a couple directories I had in my .hgignore file that I would like to store certain files in version control.  The first is .ssh and the second is .irssi.  So to do this we run &#8216;hg add&#8217; and then &#8216;hg commit&#8217;</p>
<pre><code>$ hg add .ssh/config
$ hg add .irssi/config
$ hg status
A .irssi/config
A .ssh/config
$ hg commit
Adding files that are under ignored directories

HG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: Leave message empty to abort commit.
HG: --
HG: user: Peter Manis &lt;manis@pyverted.com&gt;
HG: branch 'default'
HG: added .irssi/config
HG: added .ssh/config</code></pre>
<p>Let us now take a look at the local commits that we have.</p>
<pre><code>$ hg log
changeset:   1:5ca5d6d283fe
tag:         tip
user:        Peter Manis &lt;manis@pyverted.com&gt;
date:        Thu Aug 13 19:48:16 2009 -0400
summary:     Adding files that are under ignored directories

changeset:   0:d0e3d9042208
user:        Peter Manis &lt;manis@pyverted.com&gt;
date:        Thu Aug 13 19:43:06 2009 -0400
summary:     Initial commit of home directory files.</code></pre>
<p>We now need to prepare to push these local commits to our bitbucket private repository.  To do this we need to setup ssh keys</p>
<pre><code>$ ssh-keygen -t rsa -b 2048
Generating public/private rsa key pair.
Enter file in which to save the key (/home/mercurialguide/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/mercurialguide/.ssh/id_rsa.
Your public key has been saved in /home/mercurialguide/.ssh/id_rsa.pub.
The key fingerprint is:
c5:fc:5b:3e:06:2c:3f:f9:17:51:bf:78:f8:60:ac:cb mercurialguide@hostname</code></pre>
<p>Now sign up for a bitbucket account, create your first private repository, I called mine homedir.  After you do that you need to go into your &#8220;Account&#8221; page and add your ssh public key to the list of ssh keys.</p>
<pre><code>$ cat .ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAwRewbcXoot9nUUZzonryDYKBhxapI69JRW5TNsxfJQEAw4l7VoA681sgHVA2B8T876Tn9uZrzMBgcEz4GMGVsrU31wVNa9p/HtBJCyp1zWKoitoR1wu2FdNRSgsjFOdlMJ6BIxchmG58/hwA88FZXdYgcKMe2WWQP7pDInhHIJhLKPoctXURr6kSM7TWLh4eO81amSE2GB77mCRIoqxI6Y0uQGqO6JDhFUQAPuErCJcfXSkO+Lv9XIyCwhclki2oZUMwvDyYYrHVHWCNZ/azY1C4Ea722CFSWQjAUI9ljA8yaYmLaI4tbgWu9bNQdNy7v9x9EMtq8Q828BF9LGb+tw== mercurialguide@hostname</code></pre>
<p>You will also need to edit your .ssh/config file for bitbucket.</p>
<pre><code>Host bitbucket.org
  User hg
  Compression yes</code></pre>
<p>Now we can push changes to bitbucket</p>
<pre><code>$ hg push ssh://bitbucket.org/manis/homedir/
pushing to ssh://bitbucket.org/manis/homedir/
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 2 changesets with 12 changes to 12 files
remote: bb/acl: manis is allowed. accepted payload.
remote: quota: 103.6 MB in use, 500.0 MB available (20.72% used)</code></pre>
<p>And you&#8217;re done!  You just setup a remote repository with your home directory files.  Now that you have that setup remember that until you &#8216;hg push&#8217; your changes they are only local.</p>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/version-control/using-mercurial-on-your-home-directory/2009/08/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://pyverted.com/version-control/using-mercurial-on-your-home-directory/2009/08/</feedburner:origLink></item>
		<item>
		<title>My Move to Mercurial</title>
		<link>http://feedproxy.google.com/~r/pyverted/~3/QGT5lBvVlUI/</link>
		<comments>http://pyverted.com/version-control/my-move-to-mercurial/2009/08/#comments</comments>
		<pubDate>Sat, 08 Aug 2009 22:00:08 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[Version Control]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[Mercurial]]></category>

		<guid isPermaLink="false">http://pyverted.com/?p=330</guid>
		<description><![CDATA[My recent post about using Git/Mercurial on my home directory really pushed me to figure out which DVCS I wanted to move to long term.  I wanted to share with you the reasons why I switched, not to try to convince you to switch to Mercurial, but to share with you things you may [...]]]></description>
			<content:encoded><![CDATA[<p>My <a href="http://pyverted.com/linux/setting-up-version-control-on-your-home-directory/2009/08/" target="_blank">recent post</a> about using <a href="http://git-scm.com/" target="_blank">Git</a>/<a href="http://mercurial.selenic.com/wiki/" target="_blank">Mercurial</a> on my home directory really pushed me to figure out which DVCS I wanted to move to long term.  I wanted to share with you the reasons why I switched, not to try to convince you to switch to Mercurial, but to share with you things you may not have known about it.  These observations were primarily over the last week, but I had interacted with both git and mercurial prior to taking the time to learn more about them.  I will also mention that there are going to be things about Mercurial and Git that I cannot comment on.  I do not deal with distributed version control as much as I do centralized so I am unable to comment on features that are more DVCS specific.<br />
<span id="more-330"></span><br />
As I was writing the post about using DVCS on my home directory, I couldn&#8217;t resist using both Mercurial and Git side by side.  With the structure being similar, but different it was much easier than it would have been doing Subversion and a DVCS.  I already had a Git environment setup so pushing my home directory and really interacting with Git wasn&#8217;t a problem, but with Mercurial I didn&#8217;t really want to take the time to set everything up only to ditch it all later.  I then remembered that <a href="http://bitbucket.org/" target="_blank">bitbucket</a> offered 1 private repository with the free account, something that <a href="http://github.com" target="_blank">GitHub</a> does not do.  I created an account and started to play with it a bit and felt more comfortable with the actions of Mercurial than I ever did with Git.  This is when I really started to get a good feel for using Mercurial and how natural it felt to me.</p>
<p>I never liked the status output of Git, the Mercurial output was much closer to Subversion, which is what I was used to.  A quick side note, I have read that most feel Mercurial is an easier move for Subversion users.  With my first real Mercurial involvement needing a lot of adds and removes it was nice to have an &#8216;addremove&#8217; command that quickly took care of this for me.  With Git you had to run add on the files, which was not fun if you added a large number of new files.  Before anything is said about adding files I will say that yes, if you are adding a lot of new files it is probably from adding a directory, which is more easily added, but I found a number of instances where I had to add a lot of files where it wasn&#8217;t that easy and writing out a one liner to do it just isn&#8217;t enjoyable.</p>
<p>The ability to serve a web interface straight from the command line was a feature I found very interesting, again being able to setup a complete environment it wasn&#8217;t something I really needed, but it was certainly a nice feature to have.  Setting up a Mercurial/Apache environment is also much easier than doing it with Git.  I love Trac, I use it for everything I can, but it was very difficult to use with Git for a couple reasons.  The first was that the versions of software needed for the Trac plugin didn&#8217;t mesh well with the CentOS 5 environment it would be hosted on.  The 2nd, which is one of my biggest gripes about Git is the revision id Git uses.  Git uses full hashes like &#8220;b3ef65139dea83be5965a972159aa628847b763c&#8221; while Mercurial will use a number and a short hash like &#8220;0:3f7766464126&#8243; and revisions can be referenced by either.  Here is a visual comparison of the two.</p>
<ul>
<li>Git: <a href="http://labs.ohloh.net/ohcount/browser" target="_blank">OhLoh Labs</a></li>
<li>Mercurial: <a href="http://pylonshq.com/project/pylonshq/browser" target="_blank">Pylons</a></li>
</ul>
<p>I&#8217;m sure you can see what a difference that makes, the Mercurial revision id is 1/3 the length of the Git.</p>
<p>Mercurial itself is written in Python, and it is pointed out in some of the pages I link to later that this allows the developers to concentrate on adding features and paying more attention to creating the best version control system instead of having to deal with all the issues that can be involved in maintaining more low level code like C/C++.  When you don&#8217;t have to spend time on garbage collection and finding memory leaks you have more time to add in features like Mercurial&#8217;s archiving option.  I can simple link to http://webaddress.com/repository/archive/tip.<a href="http://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html" target="_blank">{zip,tar.gz,tar.bz2}</a> and it will create an archive version of the tip, or what is also known as the last revision, but you can also link to tags and create archives based on that.  It also allows me to very easily add autogenerated links to my Trac project index as well, seen below.</p>
<p><img src="http://static.pyverted.com/for/posts/20090808/mercurial_trac.png" /></p>
<p>I think that Mercurial being written in Python influences my decision more than I may realize.  I like to have the power to add and change things and considering that I write Python more than I do anything else these days that fits in very nicely.  It means that if I want a feature I can write it, I don&#8217;t need to know C or C++ and with the design of Python the features can be more easily added and shared with others.  An example of a quick and easy extension is the <a href="http://mercurial.selenic.com/wiki/InfoExtension" target="_blank">InfoExtension</a>, which if you are used to Subversion will look very much like &#8217;svn info&#8217;.</p>
<p>Back in April, <a href="http://googlecode.blogspot.com/2009/04/mercurial-support-for-project-hosting.html" target="_blank">Google added support for Mercurial</a> to their project hosting service, which you can see even has <a href="http://code.google.com/p/android-health-tracker/source/list" target="_blank">integrated branch graphing</a>.  More recently Python creator <a href="http://mail.python.org/pipermail/python-dev/2009-March/087931.html" target="_blank">Guido van Rossum announced</a> they will be moving from Subversion to Mercurial along with a <a href="http://sayspy.blogspot.com/2009/03/why-python-is-switching-to-mercurial.html" target="_blank">followup from Brett Cannon</a> about the decision.  There is also a <a href="http://www.python.org/dev/peps/pep-0374/" target="_blank">detailed PEP</a> about the selection of a distributed VCS.</p>
<p>These are just some of the things that I really liked about Mercurial, you can read a little more on the following pages:</p>
<ul>
<li><a href="http://nubyonrails.com/articles/five-features-from-mercurial-that-would-make-git-suck-less" target="_blank">Five Features from Mercurial That Would Make Git Suck Less</a></li>
<li><a href="http://blog.zacharyvoase.com/post/147813314/why-mercurial-git-or-how-i-learned-to-stop-censoring" target="_blank">Why Mercurial > Git, or How I Learned To Stop Censoring Myself and Participate in Flamewars.</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/version-control/my-move-to-mercurial/2009/08/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://pyverted.com/version-control/my-move-to-mercurial/2009/08/</feedburner:origLink></item>
		<item>
		<title>Fedora DHCP</title>
		<link>http://feedproxy.google.com/~r/pyverted/~3/vkB2JYK3iOU/</link>
		<comments>http://pyverted.com/linux/fedora-dhcp/2009/08/#comments</comments>
		<pubDate>Sat, 08 Aug 2009 04:24:56 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://pyverted.com/?p=327</guid>
		<description><![CDATA[I installed Fedora in a virtual machine to play with Fedora Directory Server since it would be more recent than RHEL or CentOS.  I noticed post install that I could not stop pulling an IP address from DHCP despite setting up the /etc/sysconfig/network-scripts/ifcfg-eth0 file to be static.  After a quick search I found [...]]]></description>
			<content:encoded><![CDATA[<p>I installed Fedora in a virtual machine to play with Fedora Directory Server since it would be more recent than RHEL or CentOS.  I noticed post install that I could not stop pulling an IP address from DHCP despite setting up the /etc/sysconfig/network-scripts/ifcfg-eth0 file to be static.  After a quick search I found that Fedora is using the NetworkManager to handle the networking before anything else so to fix this issue you need to disable NetworkManager and enable plain old network.</p>
<p><code>chkconfig NetworkManager off<br />
chkconfig --levels 2345 network on<br />
/etc/init.d/network restart</code></p>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/linux/fedora-dhcp/2009/08/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://pyverted.com/linux/fedora-dhcp/2009/08/</feedburner:origLink></item>
		<item>
		<title>Right-click MD5 file generation, with autocheck</title>
		<link>http://feedproxy.google.com/~r/pyverted/~3/SwoKeZb-gWc/</link>
		<comments>http://pyverted.com/linux/right-click-md5-file-generation-with-autocheck/2009/08/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 07:59:16 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Bash Script]]></category>
		<category><![CDATA[Gnome]]></category>
		<category><![CDATA[MD5]]></category>

		<guid isPermaLink="false">http://pyverted.com/?p=319</guid>
		<description><![CDATA[In my previous post I mentioned using a shebang in MD5 files to make them autocheck.  I created a quick nautilus script that will take selected files and create an md5 file with the shebang and append the hashes of the files to it.  It will also make the MD5 file executable so [...]]]></description>
			<content:encoded><![CDATA[<p>In my <a href="http://pyverted.com/linux/md5-file-autochecking/2009/08/" target="_blank">previous post</a> I mentioned using a shebang in MD5 files to make them autocheck.  I created a quick nautilus script that will take selected files and create an md5 file with the shebang and append the hashes of the files to it.  It will also make the MD5 file executable so that you can run that file to do the check.</p>
<p>The file gets placed in ~/.gnome2/nautilus-scripts/ and will take a restart of X.</p>
<pre><code>#!/bin/bash

FILENAME=`gdialog --title "MD5 File" --inputbox "Enter the name of the MD5 file (without extension)" 100 200 2&gt;&amp;1`
if [ ${#FILENAME} -lt 1 ]; then
  FILENAME=temp_name.md5
else
  FILENAME=$FILENAME.md5
fi

echo "#!/usr/bin/md5sum -c" &gt; $FILENAME
/usr/bin/md5sum $* &gt;&gt; $FILENAME
chmod +x $FILENAME</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/linux/right-click-md5-file-generation-with-autocheck/2009/08/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://pyverted.com/linux/right-click-md5-file-generation-with-autocheck/2009/08/</feedburner:origLink></item>
		<item>
		<title>MD5 File Autochecking</title>
		<link>http://feedproxy.google.com/~r/pyverted/~3/fp_gnN5WFkY/</link>
		<comments>http://pyverted.com/linux/md5-file-autochecking/2009/08/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 07:27:17 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MD5]]></category>
		<category><![CDATA[Shebang]]></category>
		<category><![CDATA[Templates]]></category>

		<guid isPermaLink="false">http://pyverted.com/?p=311</guid>
		<description><![CDATA[Tonight I was playing around with creating more templates in Ubuntu&#8217;s ~/Template directory and thought I&#8217;d play with MD5 files.  This doesn&#8217;t just apply to the ~/Templates dir, but putting it in the templates directory will make it easier for a couple reasons.  If you put this header in a MD5.md5 file and [...]]]></description>
			<content:encoded><![CDATA[<p>Tonight I was playing around with creating more templates in Ubuntu&#8217;s ~/Template directory and thought I&#8217;d play with MD5 files.  This doesn&#8217;t just apply to the ~/Templates dir, but putting it in the templates directory will make it easier for a couple reasons.  If you put this header in a MD5.md5 file and make that template executable, when you right click and create an MD5 file the file will be executable and will already have the shebang in the file.</p>
<p>An example, the following will let you run ./filename.md5 and have it return the results of the md5 check.</p>
<pre><code>#!/usr/bin/md5sum -c

bf185a69398a7fa91b6006aae61f8be1  TracMercurial-0.11.0.7-py2.4.egg</code></pre>
<pre><code>$ chmod +x mercurial_plugin.md5
$ ./mercurial_plugin.md5
TracMercurial-0.11.0.7-py2.4.egg: OK</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/linux/md5-file-autochecking/2009/08/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://pyverted.com/linux/md5-file-autochecking/2009/08/</feedburner:origLink></item>
		<item>
		<title>Ubuntu User Directories</title>
		<link>http://feedproxy.google.com/~r/pyverted/~3/6u9ORW_NOHI/</link>
		<comments>http://pyverted.com/linux/ubuntu-user-directories/2009/08/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 00:08:21 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://pyverted.com/?p=302</guid>
		<description><![CDATA[I discovered that if you delete directories in your home directory like Templates and other system folders it will make an undesirable change to ~/.config/user-dirs.dirs changing the location of variables to $HOME/, which means if you want to add the directory back you have to edit the file.  
This file defines the locations for [...]]]></description>
			<content:encoded><![CDATA[<p>I discovered that if you delete directories in your home directory like Templates and other system folders it will make an undesirable change to ~/.config/user-dirs.dirs changing the location of variables to $HOME/, which means if you want to add the directory back you have to edit the file.  </p>
<p>This file defines the locations for Desktop, Music, Templates, etc so I went ahead and moved those files to Dropbox so I can maintain the files across multiple machines.</p>
<p>While I&#8217;m on the topic of these directories, I want to mention the awesomeness that is the Templates directory.  If you add the file &#8220;Python Script.py&#8221; to that directory and put in the following text:</p>
<pre name="code" class="python:nogutter">
#!/usr/bin/python2.5
#
# Copyright 2009

import sys

# Enter text here</pre>
<p>You can then right click in a directory, go to &#8220;Create Document&#8221; you will see &#8220;Python Script&#8221; listed and if you select it a .py file will be created with the previous text in it.  This directory lets you create templates for anything you want and easily use it to create documents.</p>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/linux/ubuntu-user-directories/2009/08/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://pyverted.com/linux/ubuntu-user-directories/2009/08/</feedburner:origLink></item>
		<item>
		<title>Setting Up Version Control on your Home Directory</title>
		<link>http://feedproxy.google.com/~r/pyverted/~3/XBJV0mDy2qY/</link>
		<comments>http://pyverted.com/linux/setting-up-version-control-on-your-home-directory/2009/08/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 05:01:20 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Dot Files]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[Version Control]]></category>

		<guid isPermaLink="false">http://pyverted.com/?p=274</guid>
		<description><![CDATA[UPDATE: I just initialized a mercurial repository in my home dir as well to have a side by side comparison of the two.  If you are interested in using mercurial please look at the bottom for a few notes on setting it up.
In Ubuntu 9.04 a new application was introduced called etckeeper.  This [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE:</strong> I just initialized a mercurial repository in my home dir as well to have a side by side comparison of the two.  If you are interested in using mercurial please look at the bottom for a few notes on setting it up.</p>
<p>In Ubuntu 9.04 a new application was introduced called etckeeper.  This application uses various version control systems to store versions of files within etc.  Some machines that I work on I keep my home directory very clean, and I go out of my way to keep things organized and stored in version control.  I have dropped the ball on being so organized when it comes to my home desktop, but tonight, that changed.  This is how to use version control with your home directory.  I am not going to cover indepth topics about using Git or any other version control, this guide simply explains how to maintain a local repository.</p>
<p>The first step is to install your preferred version control system.  In this case I am going to use git, since a lot of people are familiar with it.</p>
<p><code>sudo apt-get install git</code><br />
<span id="more-274"></span><br />
Now we need to initialize our repository and prevent other users from having access.</p>
<p><code>$ cd ~<br />
$ git init<br />
Initialized empty Git repository in /home/user/.git/<br />
$ chmod 700 .git</code></p>
<p>We don&#8217;t need to put every file under version control so we need to create a list of everything in our home directory and then remove what we don&#8217;t want.  To do this we are first going to list all non-hidden files directories first, and then list all hidden files directories first followed by leaving out the current and parent directories.  This list gets put in a file called .gitignore, a file that git reads to determine what files it should ignore.</p>
<p><code>$ ls -1 --group-directories-first &gt; .gitignore<br />
$ ls -1 --group-directories-first -A | grep '^\.' &gt;&gt; .gitignore<br />
$ cat .gitignore<br />
Applications<br />
bin<br />
Desktop<br />
...<br />
.cache<br />
.checkbox<br />
.compiz<br />
...<br />
.bash_aliases<br />
.bash_history<br />
.bash_logout<br />
...<br />
.xsession-errors</code></p>
<p>Now you should go through and remove files and directories you would like to have maintained in version control.  You can also temporarily comment out a file with a # so that it will get added and then uncomment the file so that in the future changes will be ignored.</p>
<p>After editing .gitignore you can run &#8216;git status&#8217; to verify the files that are not ignored.</p>
<pre><code>$ git status
# On branch master
#
# Initial commit
#
# Untracked files:
#   (use "git add &lt;file&gt;..." to include in what will be committed)
#
#       .bash_aliases
#       .bash_history
#       .bash_logout
#       .bash_profile
#       .bashrc
#       .gitconfig
#       .gitignore
#       .hgrc
#       .nvidia-settings-rc
#       .profile
#       .screenrc
#       .ssh/
#       .subversion/
#       .vim/
#       .viminfo
#       .vimrc
nothing added to commit but untracked files present (use "git add" to track)</code></pre>
<p>Some things you may want to leave out like in my case I don&#8217;t really want to have the auth information for subversion or ssh private keys stored in version control.  For those specific things you can add lines like the following to your .gitignore file.</p>
<p><code>.ssh/id_*<br />
.subversion/auth/</code></p>
<p>To test what files will be added and what will not be added you can do a dry run.</p>
<p><code>$ git add -n -A<br />
add '.bash_aliases'<br />
...<br />
add '.screenrc'<br />
add '.ssh/config'<br />
add '.ssh/known_hosts'<br />
add '.subversion/README.txt'<br />
add '.subversion/config'<br />
add '.subversion/servers'<br />
add '.vim/colors/astronaut.vim'<br />
...</code></p>
<p>Now we need to add the files to git and commit them.</p>
<p><code>$ git add -A<br />
$ git commit -m "Initial commit of files in home directory"</code></p>
<p>Now if you make a change to .profile you can easily revert it</p>
<pre><code>$ echo 'testing' &gt;&gt; .profile
$ git status
# On branch master
# Changed but not updated:
#   (use "git add &lt;file&gt;..." to update what will be committed)
#   (use "git checkout -- &lt;file&gt;..." to discard changes in working directory)
#
#       modified:   .profile
#
no changes added to commit (use "git add" and/or "git commit -a")
$ git checkout .profile
$ git status
# On branch master
nothing to commit (working directory clean)</code></pre>
<p>And you&#8217;re done.</p>
<h2>Mercurial</h2>
<p>I have not decided which DVCS I will be using so I initialized a hg repository along side the git repository so that I can see the differences first hand.  The mercurial command is &#8216;hg&#8217; and the ignore file is .hgignore so this guide can be easily adapted to using mercurial.  One nice benefit is that <a href="http://bitbucket.org" target="_blank">BitBucket&#8217;s</a> free plan comes with a private repository so you can easily setup a remote repository to store  it all.</p>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/linux/setting-up-version-control-on-your-home-directory/2009/08/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		<feedburner:origLink>http://pyverted.com/linux/setting-up-version-control-on-your-home-directory/2009/08/</feedburner:origLink></item>
		<item>
		<title>VLC on a separate X Screen</title>
		<link>http://feedproxy.google.com/~r/pyverted/~3/oR_FbIJSiRg/</link>
		<comments>http://pyverted.com/linux/vlc-on-a-separate-x-screen/2009/07/#comments</comments>
		<pubDate>Sun, 05 Jul 2009 23:01:06 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Dual Monitors]]></category>
		<category><![CDATA[GTK]]></category>
		<category><![CDATA[VLC]]></category>

		<guid isPermaLink="false">http://pyverted.com/?p=267</guid>
		<description><![CDATA[I have an odd overlay issue when using my HDTV as a second monitor on my desktop.  When I would set them up with the correct resolutions they would be reverted to something that caused an overlap.  The only way to fix this was to do separate X screens, but I couldn&#8217;t remember [...]]]></description>
			<content:encoded><![CDATA[<p>I have an odd overlay issue when using my HDTV as a second monitor on my desktop.  When I would set them up with the correct resolutions they would be reverted to something that caused an overlap.  The only way to fix this was to do separate X screens, but I couldn&#8217;t remember how to send VLC to the 2nd X screen.  Applications like Firefox can accept the &#8211;display flag, but VLC does not.  To prevent having it send any other applications to the 2nd display I made it a local variable in a bash script and run VLC from there.  Just associate movies with the bash script and it will run them full screen on the 2nd X screen.</p>
<pre><code>#!/bin/bash

DISPLAY=:0.1
vlc -f $*</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/linux/vlc-on-a-separate-x-screen/2009/07/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://pyverted.com/linux/vlc-on-a-separate-x-screen/2009/07/</feedburner:origLink></item>
		<item>
		<title>Wordpress 2.8 Database Upgrade Loop</title>
		<link>http://feedproxy.google.com/~r/pyverted/~3/UENG7Ejb3rU/</link>
		<comments>http://pyverted.com/general/wordpress-2-8-database-upgrade-loop/2009/06/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 14:01:19 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Memcache]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://pyverted.com/?p=265</guid>
		<description><![CDATA[Last night I upgraded both of my blogs to Wordpress 2.8 and ran into a couple problems.  The redirection plugin caused some problems with wp-db.php so I had to disable that to get the site back up if you upgrade redirection prior to upgrading you won&#8217;t have that problem.
The other problem I ran into [...]]]></description>
			<content:encoded><![CDATA[<p>Last night I upgraded both of my blogs to Wordpress 2.8 and ran into a couple problems.  The redirection plugin caused some problems with wp-db.php so I had to disable that to get the site back up if you upgrade redirection prior to upgrading you won&#8217;t have that problem.</p>
<p>The other problem I ran into was that I would be presented with a page saying &#8220;Database Upgrade Required&#8221;, after upgrading it would bring me back to the same page.  The problem ended up being the wp-content/object-cache.php file, moving that out fixed the problem.  However because the page was still cached in memcache moving the file back raised the same issues.  The faster fix is to restart memcache all together to clear the cache.</p>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/general/wordpress-2-8-database-upgrade-loop/2009/06/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://pyverted.com/general/wordpress-2-8-database-upgrade-loop/2009/06/</feedburner:origLink></item>
		<item>
		<title>Retrieve Gmail/GApps Message Count</title>
		<link>http://feedproxy.google.com/~r/pyverted/~3/-b0BfRJyXHQ/</link>
		<comments>http://pyverted.com/python/retrieve-gmailgapps-message-count/2009/06/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 05:02:53 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[Gmail]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://pyverted.com/?p=243</guid>
		<description><![CDATA[Long ago I switched from using any sort of mail client to using the webmail interface of Gmail/Google Apps.  This switch was really fueled by my increased usage of the interface after being hired by Google.  I won&#8217;t go on and on about using the web interface, but sometimes it is nice to [...]]]></description>
			<content:encoded><![CDATA[<p>Long ago I switched from using any sort of mail client to using the webmail interface of Gmail/Google Apps.  This switch was really fueled by my increased usage of the interface after being hired by Google.  I won&#8217;t go on and on about using the web interface, but sometimes it is nice to know how many actual emails are in your account.  Google mail only shows you the number of threaded emails, not each individual response.  If I look in &#8220;All Mail&#8221; for my manis@digital39.com account I see &#8220;1 &#8211; 100 of 21758&#8243;, which represents the number of email threads, the actual number of responses is 56578.  FYI, this requires that you enable IMAP support for the account.</p>
<p><code>$ imap_count.py manis@digital39.com<br />
Password for manis@digital39.com: *****<br />
56578 messages in account manis@digital39.com</code></p>
<p>Expand the code below and copy it to a file on your system.  It takes one argument, and that argument is a comma separated list of email addresses.</p>
<pre name="code" class="python:nogutter:collapse">
#!/usr/bin/python2.4
#
# Copyright (c) 2009, Peter Manis
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# Neither the name of the Peter Manis nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import getpass
import imaplib
import sys

results = []

def RetrieveMsgCount(username, password):
  """Retrieves message count by accessing Gmail or Google Apps IMAP account.

  Args:
    username: str, Username of the account we are accessing.
    password: str, Password of the account we are accessing.

  Returns:
    count: str, Number of messages in IMAP account

  Raises:
    imaplib.IMAP4.error: Failed to login to the IMAP account.
  """
  try:
    imap = imaplib.IMAP4_SSL('imap.gmail.com', 993)
    imap.login(username, password)
    status, [count] = imap.select ("[Gmail]/All Mail")
    imap.close()
    imap.logout()
  except imaplib.IMAP4.error:
    return 'Unable to check'
  else:
    return count

def main():
  if len(sys.argv) > 1:
    accounts = sys.argv[1]
    for account in accounts.split(','):
      password = getpass.getpass("Password for %s: " % account)
      results.append('%s messages in account %s' % (
          RetrieveMsgCount(account, password), account))
    for account in results:
      print account
  else:
    print "Please provide a comma separated list of accounts to check."

if __name__ == '__main__':
  main()
</pre>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/python/retrieve-gmailgapps-message-count/2009/06/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://pyverted.com/python/retrieve-gmailgapps-message-count/2009/06/</feedburner:origLink></item>
		<item>
		<title>Why techies get annoyed</title>
		<link>http://feedproxy.google.com/~r/pyverted/~3/Pez2p4J1yQg/</link>
		<comments>http://pyverted.com/random/why-techies-get-annoyed/2009/05/#comments</comments>
		<pubDate>Tue, 12 May 2009 03:25:35 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://pyverted.com/?p=235</guid>
		<description><![CDATA[Many times I hear people say how they hate when their friend gets mad at them for asking questions.  I have been on both sides of this, I often get annoyed after receiving a number of questions, and I have complained about the way people have acted with me in the past.  Looking [...]]]></description>
			<content:encoded><![CDATA[<p>Many times I hear people say how they hate when their friend gets mad at them for asking questions.  I have been on both sides of this, I often get annoyed after receiving a number of questions, and I have complained about the way people have acted with me in the past.  Looking back I see what I did that annoyed people and I try very hard to avoid those situations.<br />
<span id="more-235"></span><br />
Continuous questions, you ask one question and instead of taking that question and doing something with it you make a person elaborate on every detail of their answer.  It is sort of hard to survive in the tech world without staying on top of the latest topics, and constantly learning new things, and because of that many of us have spent a lot of time searching and reading articles, tutorials, manuals to get to where we are.  Beyond reading we break a lot of things to learn what we know.  I cannot tell you how many times I have installed Windows or Linux and sometimes I learn something new, but now it is just mind numbing at times.  When you ask a question, and someone gives you an answer that builds on something else you are not aware of take a couple minutes and search Google.  I&#8217;ll give an example&#8230; Lets say you wanted to have a machines, a file server, to store all your files.  You ask a friend for help and he starts mentioning RAID, and that RAID5 is going to be pretty safe.  What you should do is search Google for RAID5, read through the description and if there is something you don&#8217;t understand you could then ask a question about something specific.  &#8220;What exactly is parity?&#8221; might be one, but in situations when someone gives me an answer like that I will do multiple searches on the terms I unfamiliar with.  This does a couple things, it shows the person you have a genuine interest in understanding, that you just need a push in the right direction, and that you respect their time.</p>
<p>What sparked this post was that someone on a mailing list I belong to asked about installing KDE in Ubuntu so that he could switch back and forth between KDE and Gnome, an email sent on the 8th of May.  A few of us gave him commands he could run, and links to topics related to this, each one being shot down for some reason or another.  Eventually a couple people made comments about how maybe Linux wasn&#8217;t for him, and so on, and he started to get defensive, which he has the right to do, but he started explaining how he works with over 100 servers and has been using Linux for like 8 years.  Someone called him out by saying that with that much experience he should have been able to install KDE, which is very true, there might have been a couple problems to fix, but finding what packages to install should have been quite simple.  The user then came back with this email about how we must have unlimited time to learn all of this stuff, and how he doesn&#8217;t have the time to spend figuring something out that many people have figured out already and then ending the email with comments about how if the list becomes unhelpful he will unsubscribe.</p>
<p>A big mistake he made was sounding ungrateful for the help he did receive.  He thanked a few of us as we replied, but they were &#8220;Thanks, but&#8221; replies, telling us what was wrong with our response.  By giving the attitude that your time is more valuable than ours is not the greatest way to get help.  If you really want to make it about the value of an hour unless you are a doctor or a lawyer we can most likely bill more per hour than you can.  Acting like you are some big shot by listing off the stuff you do isn&#8217;t a great thing to do either, you don&#8217;t know the audience, when you have people with a lot of experience hearing you make comments about how awesome you are, and you can&#8217;t install KDE it really makes you look like an ass.</p>
<p>Before you send an email to a list or to a group you need to think about the time you are taking away from other people&#8217;s day.  If 200 people read your email, and it takes them 2 minutes a piece, but the answer to your question shows up in the top 5 results in Google, you just wasted 400 minutes of people&#8217;s time for something you could have found in 5 seconds.  In the case of this guy it took me longer to read his replies than it did to search for a quick howto or give him a command he could run to find out what to install.</p>
<p>I hope this helps some of you who have been annoyed at your friend or acquaintance because they came across as having an attitude or they got upset with you.</p>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/random/why-techies-get-annoyed/2009/05/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://pyverted.com/random/why-techies-get-annoyed/2009/05/</feedburner:origLink></item>
		<item>
		<title>Home Office</title>
		<link>http://feedproxy.google.com/~r/pyverted/~3/4eyFdQX7VYU/</link>
		<comments>http://pyverted.com/consulting/home-office/2009/04/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 02:18:56 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[Consulting]]></category>

		<guid isPermaLink="false">http://pyverted.com/?p=213</guid>
		<description><![CDATA[I forgot to post this last month, and I have since acquired a couple more pieces of equipment the most impressive one being an HP DL360G5 4G RPS Performance Server.  Dual QC 5345 Xeon, 16gb FB ECC RAM, 6&#215;146gb 10K SAS SFF hard drives, in a 1U.  Here is the post I saved [...]]]></description>
			<content:encoded><![CDATA[<p>I forgot to post this last month, and I have since acquired a couple more pieces of equipment the most impressive one being an HP DL360G5 4G RPS Performance Server.  Dual QC 5345 Xeon, 16gb FB ECC RAM, 6&#215;146gb 10K SAS SFF hard drives, in a 1U.  Here is the post I saved last month.  Don&#8217;t miss the recent photos at the bottom of the post.</p>
<p>In 2007 a friend and I both started moving out equipment to rack mount setups.  We each had our own reasons, but the common reasons were saving space, organization, and it is kinda nice to say you have a rack in your house.  When I was looking for a rack/cabinet I found someone a couple hours away that had a lightly used 45U fully enclosed cabinet for sale.  The cabinet came with sides, doors, caster base, two shelves, four-fan unit for the top, and a $350 price tag.  A few days after picking up the cabinet I spoke with him again and we made a deal that resulted in me having an entire car full (trunk full and front and back seats full to the ceiling) of equipment.  I recreated an album containing the older pictures of the cabinet, and how things were organized, which can be viewed in the <a href="http://picasaweb.google.com/peter.manis/RackProject" target="_blank">Rack Project</a> album.<br />
<span id="more-213"></span><br />
After moving to Atlanta I was able to acquire even more rack mount equipment and fill in some of the gaps I had to leave empty in the beginning.  The details of what is in the cabinet can be read on my <a href="http://pyverted.com/gear/" target="_blank">Gear page</a>, but here is a parent list.</p>
<ul>
<li>Linksys WRT54G 4-Port 10/100 54mb Wireless Router</li>
<li>Canon CanoScan 8400F</li>
<li>brother HL Series HL-2070N Laser Printer,</li>
<li>4U, Intel Core 2 Duo E6750 Desktop</li>
<li>5U, AMD Athlon 64 X2 4000+ File Server</li>
<li>1U, Intel Pentium III, 850mhz Endian Firewall/Router</li>
<li>1U, Intel Pentium 4, 2.4ghz IBM x305 Servers (x4)</li>
<li>1U, Tripp Lite HTR07-1U UPS (x2)</li>
<li>1U, Dell PowerConnect 5012 Gigabit Switch</li>
<li>1U, Cisco Catalyst 2900 XL 24 port Switch</li>
<li>1U, CAT5e 24 port Patch Panel</li>
<li>1U, Rack Writer</li>
<li>2U, Intel Pentium 4, 2.6C Linux Desktop</li>
</ul>
<p>I am currently not using the Cisco switch, the 2U desktop, or any of the x305 1Us on a regular basis.  With the monitor and 5.1 audio connected to the same power source I am pulling 515 watts right now, which does raise the power bill, but not to an outrageous amount.</p>
<p>I am opening up time to start doing a little consulting so I have taken some time to organize the work space and make it a better work environment.  The following pictures are of my home office that were taken on March 2nd, <a href="http://picasaweb.google.com/peter.manis/HomeOffice" target="_blank">Home Office</a> album is on PicasaWeb.</p>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/consulting/home-office/2009/04/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://pyverted.com/consulting/home-office/2009/04/</feedburner:origLink></item>
		<item>
		<title>My impression of the ipod touch</title>
		<link>http://feedproxy.google.com/~r/pyverted/~3/ubXhiCLX-AI/</link>
		<comments>http://pyverted.com/hardware/my-impression-of-the-ipod-touch/2009/04/#comments</comments>
		<pubDate>Sun, 12 Apr 2009 09:36:52 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPod]]></category>

		<guid isPermaLink="false">http://pyverted.com/hardware/my-impression-of-the-ipod-touch/2009/04/</guid>
		<description><![CDATA[The other day I purchased an iPod touch with the hopes of having a mp3 player that did what I wanted and a platform to develop applications on.  Prior to using the touch I had never used a touch screen Apple product moee than a couple minutes so I left the store wondering how [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I purchased an iPod touch with the hopes of having a mp3 player that did what I wanted and a platform to develop applications on.  Prior to using the touch I had never used a touch screen Apple product moee than a couple minutes so I left the store wondering how many days I had to return it.  That night I spent over three hours playing with the device and the apps in the store, it was very hard for me to put the device down.  I love my G1, since I work for Google the integration the device gives me is very important to me and would keep me from using something else.  So that being said I love how smooth the iPhone and iPod Touch are, how easy the onscreen keyboard is to use, and the amazing apps that are available. I think the G1 will get to the same point, things will obviously be different and one will have features the other one doesn&#8217;t have, but the big difference right now is device maturity.  There have been things about the iPhone that people have disliked that are now being fixed and things missing from Android are being added. I enjoy having the G1 as my primary device, but I think having the touch available to do certain things is important.  I have been using my touch for most of my Twittering and I am currently writing this blog post from the awesome Wordpress app in the store. The keyboard took some time getting used to but now I can type pretty fast on the device and most things I miss are caught by the auto correct.  One oft big worries before buying the device was size, and how it would feel in my pocket at work.  It is so thing that I don&#8217;t even notice is when I am work so I can move freely without it being this giant block in my pocket. I also don&#8217;t have it moving around in my pocket freely like smaller players might.  Overall I am very happy with the purchase they won&#8217;t get me to move to an iPhone, but I support the use of the touch to complent the Android based products.</p>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/hardware/my-impression-of-the-ipod-touch/2009/04/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://pyverted.com/hardware/my-impression-of-the-ipod-touch/2009/04/</feedburner:origLink></item>
		<item>
		<title>Apple Remote Works, but only on some applications</title>
		<link>http://feedproxy.google.com/~r/pyverted/~3/aTyjVydgV_M/</link>
		<comments>http://pyverted.com/hardware/apple-remote-works-but-only-on-some-applications/2009/02/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 20:03:40 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Remote]]></category>

		<guid isPermaLink="false">http://pyverted.com/?p=210</guid>
		<description><![CDATA[I ran into this problem recently where my Apple remote would not work with iTunes or any other application of the sort.  It would however open Boxee if you pressed the Menu button.  I followed the recommended steps of verifying your remote was transmitting an IR signal and all that, and I knew [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into this problem recently where my Apple remote would not work with iTunes or any other application of the sort.  It would however open Boxee if you pressed the Menu button.  I followed the recommended steps of verifying your remote was transmitting an IR signal and all that, and I knew it was because Boxee would open.</p>
<p>This afternoon I removed Boxee and hit menu, FrontRow opened, as it should have, and then I tried it on iTunes and it was successful.  I&#8217;m not entirely sure what caused the problem, but I didn&#8217;t use Boxee enough to bother keeping it on the machine anyway.</p>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/hardware/apple-remote-works-but-only-on-some-applications/2009/02/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://pyverted.com/hardware/apple-remote-works-but-only-on-some-applications/2009/02/</feedburner:origLink></item>
		<item>
		<title>QR Codes</title>
		<link>http://feedproxy.google.com/~r/pyverted/~3/JodxKckYcdQ/</link>
		<comments>http://pyverted.com/mobile/qr-codes/2008/12/#comments</comments>
		<pubDate>Sun, 14 Dec 2008 00:02:20 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://pyverted.com/?p=203</guid>
		<description><![CDATA[Many don&#8217;t know this, but there is something called a QR code, which is basically a barcode format holding certain data.  The example below holds my name, email and phone number.  If you have an Android based phone you can use the bar code scanner application to add my contact information to your [...]]]></description>
			<content:encoded><![CDATA[<p>Many don&#8217;t know this, but there is something called a QR code, which is basically a barcode format holding certain data.  The example below holds my name, email and phone number.  If you have an Android based phone you can use the bar code scanner application to add my contact information to your phone.  You simple run the application, hold the phone so that the barcode displays on the screen within the box and it will give you a prompt asking if you would like to email me, call me or add me as a contact.</p>
<p><img src="http://chart.apis.google.com/chart?cht=qr&#038;chs=200x200&#038;chl=MECARD:N:Manis,Peter;EMAIL:manis@pyverted.com;TEL:+1+(678)269-7979;;" /></p>
<p>This image was also created using the Google chart api, so it is very easy to integrate into a site that holds contact information.  I think I will add a QR code to my business cards to make it easier for people to save my information.  I should also mention it does not have to be an Android based phone.  Do a search for QR codes on mobile devices and you should be able to find some solutions.</p>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/mobile/qr-codes/2008/12/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://pyverted.com/mobile/qr-codes/2008/12/</feedburner:origLink></item>
		<item>
		<title>Linux File Permissions</title>
		<link>http://feedproxy.google.com/~r/pyverted/~3/BPyqYn60m1E/</link>
		<comments>http://pyverted.com/linux/linux-file-permissions/2008/11/#comments</comments>
		<pubDate>Thu, 27 Nov 2008 07:56:04 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Permissions]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Sys Admin]]></category>

		<guid isPermaLink="false">http://pyverted.com/?p=185</guid>
		<description><![CDATA[When I first started out with Linux permissions were sorta hard to grasp, most likely because I never took the time to really sit down and understand them, but also because they are quite different than Windows permissions.
In Windows you can really put some detail in the ACLs, but with Linux you either need ACLs [...]]]></description>
			<content:encoded><![CDATA[<p>When I first started out with Linux permissions were sorta hard to grasp, most likely because I never took the time to really sit down and understand them, but also because they are quite different than Windows permissions.</p>
<p>In Windows you can really put some detail in the ACLs, but with Linux you either need ACLs implemented or you need to understand how file permissions work.  So first off, lets use the following example</p>
<pre><code># ls -l /
drwxr-xr-x  13 root root  4096 Apr 27  2007 usr
drwxr-xr-x  20 root root  4096 Oct  3 00:33 var</code></pre>
<p>As you can see these are both owned by user root and group root and that the user has read, write, and execute permission permissions, while the group and others do not.  So lets make a change to that to better explain permissions.  So lets say we created /home/johndoe/usr and /home/johndoe/var.<br />
<span id="more-185"></span></p>
<pre><code># ls -l /home/johndoe/
drwxrwxr-x  13 johndoe johndoe  4096 Apr 27  2007 usr
drwxr-xr-x  20 johndoe johndoe  4096 Oct  3 00:33 var</code></pre>
<p>Again, only the owner himself could write to the directories in the previous example.  In this one we ran &#8216;chmod 775 usr&#8217;, which now gives anyone in johndoe group access to write to that folder.  So say I come along and need to write to that folder, the sysadmin can run the following:</p>
<pre><code># groups manis
manis : manis
# usermod -G johndoe manis
# groups manis
manis : manis johndoe</code></pre>
<p>Now the user manis can write to that directory.  It might not be a good idea to place the user manis in the primary group of johndoe and the reason is that if by default directories and files are created with write permission manis would be able to write to all of those.  Instead it might be better to have them both belong to a separate group, maybe empl or students or a department name.  Then permissions can be given to a specific group, but they will not default to permissions that are less than desirable.</p>
<p>That really sort of sums it up for controlling access to files, the standard flags are r=read, w=write, x=execute.  You will also sometimes run across a couple more.</p>
<p>The first is the sticky bit, which Linux ignores on files, but for directories it prevents users other than the owner from renaming, moving, or deleting files within the directory. The sticky bit is represented by a &#8216;t&#8217; or a &#8216;T&#8217; in place of the &#8216;x&#8217; in permissions.  The capital T means that the file/directory in question did not have &#8216;x&#8217; set for the &#8216;others&#8217; bits.</p>
<pre><code># ls -l ~
-rw-rw-r-x 1 user user      111 Aug 29 20:26 test.txt
# chmod 1664 test.txt
-rw-rw-r-T 1 user user      111 Aug 29 20:26 test.txt
# chmod 1665 test.txt
-rw-rw-r-t 1 user user      111 Aug 29 20:26 test.txt
# chmod 0665 test.txt
-rw-rw-r-x 1 user user      111 Aug 29 20:26 test.txt</code></pre>
<p>As you can see we started out with a normal file, we ran chmod with a preceding 1, which sets the sticky bit.  We removed executable permissions by making it 664 instead of 655 and you see there is a capital T replacing the &#8216;x&#8217; in the others column.  If we add executable rights to &#8216;others&#8217;, that then becomes a lowercase &#8216;t&#8217;.  Remove the one and we now are back to where we started.  Again, Linux ignores sticky bits on files, I was just using a file as an example.</p>
<p>Setuid and setgid, like the sticky bit, are seen less often than r,w,x permissions.  What this does is fairly simple, when the bit is set the file is run as the user or group that owns the file.  An example is /usr/bin/passwd.</p>
<pre><code># ls -l /usr/bin/passwd
-rwsr-xr-x 1 root root 30796 Feb  7  2008 /usr/bin/passwd
# ls -l /etc/passwd
-rw-r--r-- 1 root root 1428 Aug 26 09:52 /etc/passwd</code></pre>
<p>The &#8217;s&#8217; in the owners column means that the setuid bit has been set.  As you can see /etc/passwd can only be written to by root, but users need to be able to change their password.  So when /usr/bin/passwd is executed it is view by the system as being run by root, and therefore any files owned by root that passwd interacts with can be modified by users allowed to execute the file.  The same with setgid, the &#8217;s&#8217; is in the group column, but it will take on the role of that group.  To set the setuid bit, you would make the first bit of chmod a 4 and for setgid you would use a 2.</p>
<pre><code># chmod 4755 testfile.txt
# ls -l testfile.txt
-rwsr-xr-x  1 manis  eng  0 Nov 24 15:47 testfile.txt
# chmod 755 testfile.txt
# ls -l testfile.txt
-rwxr-xr-x  1 manis  eng  0 Nov 24 15:47 testfile.txt
# chmod 2755 testfile.txt
# ls -l testfile.txt
-rwxr-sr-x  1 manis  eng  0 Nov 24 15:47 testfile.txt</code></pre>
<p>The last thing I want to talk about is using changing permissions.  There are 3 main programs, chmod, chgrp, and chown.  I have seen some variation to just to be safe I will say to check the usage before changing permissions.  My examples will be for CentOS.</p>
<h3>chmod</h3>
<p>All of my examples used numbers to represent the permissions, but you can use the letters too.  If you wanted to give write permission to just a group you would run.</p>
<pre><code># chown g+w testfile.txt</code></pre>
<p>and to a user</p>
<pre><code># chown u+w testfile.txt</code></pre>
<p>For a lot of people I think the octal numbers for chmod can be a little confusing at first.  It is really just simple math that will eventually become second nature.  A 4 is equal to read permissions, a 2 is equal to write permissions and a 1 is equal to execute permissions.  There are two things about these numbers, one is that they follow the binary count right to left.  When running &#8216;ls -l&#8217; permissions are displayed RWX or 421 and binary is 16 8 4 2 1.  The other thing is that no matter how you spin it the combination of numbers is unique for any combination of permissions, which I will show you in a minute.</p>
<p>Anyway back to the math of it.  When you run chmod in most cases you just use 3 digits, like in one of my examples 755.  The first is for the owner, the second is for the group, and the third is everyone else.  The number 7 comes from 4, read access, 2, write access, and 1, execute permissions.  The next number 5, is read access (4) and execute (1) or (4+1) and the same goes for the &#8220;other&#8221; permissions.  Read+write is 6, execute would be just 1, read would be just 4, so if you think about it you could do any combination and it would represent a unique set of permissions. 600 would be read and write for the owner, but nothing for anyone else.</p>
<p>The best thing you can do is just create some files and start playing with permissions.  Soon enough you will know them like the back of your hand and know how to change them to fit your needs.</p>
<p>If I jumped around too much or made something unclear please comment and I will try to clarify.</p>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/linux/linux-file-permissions/2008/11/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://pyverted.com/linux/linux-file-permissions/2008/11/</feedburner:origLink></item>
		<item>
		<title>SMS via Email</title>
		<link>http://feedproxy.google.com/~r/pyverted/~3/OA3Uo4mPNUM/</link>
		<comments>http://pyverted.com/mobile/sms-via-email/2008/11/#comments</comments>
		<pubDate>Sun, 23 Nov 2008 09:28:51 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[SMS]]></category>

		<guid isPermaLink="false">http://pyverted.com/?p=179</guid>
		<description><![CDATA[Today I was in need of sending text msgs to my cell phone using email, but without it arriving as an email it needed to arrive as a standard SMS message.  I came across an article on Tech Recipes that solved my problem.  Here is the combined list of email addresses. Replace &#8216;phonenumber&#8217; [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was in need of sending text msgs to my cell phone using email, but without it arriving as an email it needed to arrive as a standard SMS message.  I came across an <a href="http://www.tech-recipes.com/rx/2819/sms_email_us_cellular_suncom_powertel_att_alltel/" target="_blank">article on Tech Recipes</a> that solved my problem.  Here is the combined list of email addresses. Replace &#8216;phonenumber&#8217; with your 10 digit phone number (5405551212@tmomail.net).</p>
<p>T-Mobile: phonenumber@tmomail.net<br />
Virgin Mobile: phonenumber@vmobl.com<br />
Cingular: phonenumber@cingularme.com<br />
Sprint: phonenumber@messaging.sprintpcs.com<br />
Verizon: phonenumber@vtext.com<br />
Nextel: phonenumber@messaging.nextel.com<br />
US Cellular: phonenumber@email.uscc.net<br />
SunCom: phonenumber@tms.suncom.com<br />
Powertel: phonenumber@ptel.net<br />
AT&#038;T: phonenumber@txt.att.net<br />
Alltel: phonenumber@message.alltel.com<br />
Metro PCS: phonenumber@mymetropcs.com</p>
<p>This is inspiring me to write a monitoring script that is just for sending email to phones, but that will be another post.</p>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/mobile/sms-via-email/2008/11/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://pyverted.com/mobile/sms-via-email/2008/11/</feedburner:origLink></item>
	</channel>
</rss>
