<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Technology Blog of Peter Manis &#187; Linux</title>
	<atom:link href="http://pyverted.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://pyverted.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sat, 20 Mar 2010 22:51:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Switching to zsh</title>
		<link>http://pyverted.com/linux/switching-to-zsh/2010/02/</link>
		<comments>http://pyverted.com/linux/switching-to-zsh/2010/02/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 20:57:04 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Zsh]]></category>

		<guid isPermaLink="false">http://pyverted.com/?p=496</guid>
		<description><![CDATA[I have never looked into using a different shell in Linux, I&#8217;m not entirely sure why, maybe I just liked bash enough.  This past week I started looking into zsh, and liked what I saw.  Last night I migrated my shell files to be 99.9% interchangeable between shells and continue to load what [...]]]></description>
			<content:encoded><![CDATA[<p>I have never looked into using a different shell in Linux, I&#8217;m not entirely sure why, maybe I just liked bash enough.  This past week I started looking into zsh, and liked what I saw.  Last night I migrated my shell files to be 99.9% interchangeable between shells and continue to load what I want without me having to change anything.</p>
<p>This post outlines some changes I made that will allow me to use both bash and zsh with the same startup files, but still have some shell specific settings that will get sourced.  I didn&#8217;t need to move the files to ~/.shellfiles, but I felt having all of them as symlinks instead of some being symlinks to other dotfiles.  Some of the shell specific things are setopt/shopt commands, setting prompts, and history settings.</p>
<p>I am storing the files in ~/.shellfiles, it isn&#8217;t my preferred choice, but it is less likely to be used by something else.  Since I use version control on my home directory I needed to first &#8216;hg rename&#8217; each one of my files to the ~/.shellfiles directory.  After moving the files symlinks needed to be created to the original files.<br />
<span id="more-496"></span></p>
<pre><code>.bash_logout -&gt; .shellfiles/logout
.bash_profile -&gt; .shellfiles/profile
.bashrc -&gt; .shellfiles/rc-shell
.profile -&gt; .shellfiles/profile
.zlogout -&gt; .shellfiles/logout
.zprofile -&gt; .shellfiles/profile
.zshenv -&gt; .shellfiles/env
.zshrc -&gt; .shellfiles/rc-shell</code></pre>
<p>Inside of ~/.shellfiles/profile two variables are set and two log entries are added to ~/.shellfiles/shell_history, which I added as a log of when shells are exec&#8217;d, what files are sourced, and the order they are sourced.  The following shows what happens when I login, open a shell, do some work, and then switch from zsh to bash.</p>
<pre><code>################################# LOGIN ########################################
02/20/10 10:19:12
 .shellfiles/profile

02/20/10 10:19:12
 .shellfiles/rc-shell
 .shellfiles/rc-zsh
 .shellfiles/completion-zsh
 .shellfiles/functions
 .shellfiles/aliases

02/20/10 10:19:36
 .shellfiles/env

02/20/10 10:19:36
 .shellfiles/rc-shell
 .shellfiles/rc-zsh
 .shellfiles/completion-zsh
 .shellfiles/functions
 .shellfiles/aliases

02/20/10 10:19:41
 .shellfiles/rc-shell
 .shellfiles/rc-bash
 .shellfiles/completion-bash
 .shellfiles/functions
 .shellfiles/aliases</code></pre>
<p>From time to time I need to refresh a file like my aliases or functions so I created a function, &#8216;refresh&#8217;, that I can run to source files and take into account dependencies and add the log entry for that file.  So that if I run &#8216;refresh aliases&#8217;, I would have a history entry like this.</p>
<pre><code>02/20/10 10:47:30
 .shellfiles/aliases</code></pre>
<p>I&#8217;ll admit the shell history might be a bit overboard, but I needed to implement it when I was initially splitting up files so that I could ensure the correct files were sourced in various situations.</p>
<p>Within ~/.shellfiles/rc-shell I have a section at the top that sources shell specific files, and below that it has shared exports, sourced files, and operations.</p>
<pre><code>if [ -z "$ZSH_VERSION" ] &amp;&amp; [ -z "$BASH_VERSION" ]; then
  CUR_SHELL=$(echo $SHELL  | awk -F'/' '{print $NF}')
elif [ -n "$BASH_VERSION" ]; then
  CUR_SHELL='bash'
elif [ -n "$ZSH_VERSION" ]; then
  CUR_SHELL='zsh'
else
  CUR_SHELL='bash'
fi

printf "\n$(date +"%D %T") \n .shellfiles/rc-shell\n" &gt;&gt; $SHELLHISTORY

if [ -f "$SHELLFILES/rc-$CUR_SHELL" ]; then
  . "$SHELLFILES/rc-$CUR_SHELL"
fi

#------------------------------------------------------------------------------#

# Shared between zsh and bash

if [ -f "$SHELLFILES/functions" ]; then
  . "$SHELLFILES/functions"
fi
.....</code></pre>
<p>When a user is logging into the system the actual version of the shell is not available, so you need to base the startup files on the user&#8217;s shell.  Within a console or within a script the versions are available, so if when you open a terminal it will determine if it is bash or zsh based on checking if the version variable for each shell has a value greater than 0.  Once the it is known what shell we are in the proper files will be sourced.</p>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/linux/switching-to-zsh/2010/02/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Suggested change to aliasing commands</title>
		<link>http://pyverted.com/linux/suggested-change-to-aliasing-commands/2010/01/</link>
		<comments>http://pyverted.com/linux/suggested-change-to-aliasing-commands/2010/01/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 06:50:15 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Commands]]></category>
		<category><![CDATA[Sys Admin]]></category>

		<guid isPermaLink="false">http://pyverted.com/?p=425</guid>
		<description><![CDATA[When I wrote the code to automatically generate aliases for hosts in my SSH config I started thinking about how checks are never done to verify we are not overriding an existing alias.  This is my solution for it.  I almost think that alias should be an alias for register_alias so that all [...]]]></description>
			<content:encoded><![CDATA[<p>When I wrote the code to automatically generate aliases for hosts in my SSH config I started thinking about how checks are never done to verify we are not overriding an existing alias.  This is my solution for it.  I almost think that alias should be an alias for register_alias so that all aliases get checked, but I&#8217;m sure there could be an instance where it would break something.  Let me know what you think about assigning aliases this way.</p>
<pre><code># .bash_functions
function register_alias() {
  local alias=$(echo $* | cut -d'=' -f 1)
  local TEMP_CMD=$(which $alias)
  local TEMP_ALIAS=$(echo "`alias`" | sed 's/alias\ \(.*\)=.*/\1/' | grep ^$alias$)
  if [ ${#TEMP_CMD} -gt 0 ]; then
    echo "Alias $alias conflicts with command $TEMP_CMD"
  elif [ ${#TEMP_ALIAS} -gt 0 ]; then
    echo "Alias $alias conflicts with alias $alias"
  else
    alias "$*"
  fi
}</code></pre>
<pre><code># .bashrc
if [ -f ~/.bash_functions ]; then
  . ~/.bash_functions
fi</code></pre>
<pre><code># .bash_aliases

register_alias sls='screen -ls'
register_alias sdr='screen -d -r'</code></pre>
<p><b>Update</b>: I changed the TEMP_ALIAS line to use sed instead of cut/sed</p>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/linux/suggested-change-to-aliasing-commands/2010/01/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Various aliases and short scripts</title>
		<link>http://pyverted.com/linux/various-aliases-and-short-scripts/2010/01/</link>
		<comments>http://pyverted.com/linux/various-aliases-and-short-scripts/2010/01/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 04:14:10 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sys Admin]]></category>

		<guid isPermaLink="false">http://pyverted.com/?p=412</guid>
		<description><![CDATA[There are some aliases and small scripts I use on a normal basis.
I prefer to just type in the machine I want to ssh to instead of typing ssh in front of it.  This chunk of code goes in my ~/.bashrc file and creates an alias for each &#8220;Host &#8230;&#8221; entry in ~/.ssh/config.  [...]]]></description>
			<content:encoded><![CDATA[<p>There are some aliases and small scripts I use on a normal basis.</p>
<p>I prefer to just type in the machine I want to ssh to instead of typing ssh in front of it.  This chunk of code goes in my ~/.bashrc file and creates an alias for each &#8220;Host &#8230;&#8221; entry in ~/.ssh/config.  It checks to see if there is an existing command that matches the Host entry, and alerts you if there is a conflict</p>
<pre><code># Generate SSH aliases
for host in $(grep ^Host .ssh/config | sed s/Host\ //g); do
  TEMP_CMD=$(which $host)
  TEMP_ALIASES=$(echo "`alias`" | sed 's/alias\ \(.*\)=.*/\1/' | grep ^$host$)
  if [ ${#TEMP_CMD} -gt 0 ]; then
    echo "Alias $host conflicts with command $TEMP_CMD"
  elif [ ${#TEMP_ALIASES} -gt 0 ]; then
    echo "Alias $host conflicts with alias $host"
  else
    alias $host="ssh $host"
  fi
done</code></pre>
<p>When you open a terminal you will see something like this if you have conflicts.</p>
<pre><code>Alias www conflicts with alias www
Alias hg conflicts with command /usr/bin/hg
Alias git conflicts with command /usr/bin/git
[20:05:21] manis@baron:~$</code></pre>
<p><span id="more-412"></span><br />
Thing things I need to do on a normal basis with screen is list the sessions, and attach an already attached session.  The sdr alias can have a session appended to it, or run by itself if you only have one session.</p>
<pre><code># Screen Aliases
alias sls='screen -ls'
alias sdr='screen -d -r'</code></pre>
<p>There are a few commands I just think are way too long, these make it a little faster to do things, the alias md5 will make it easier to move back and forth between OS X and Linux.</p>
<pre><code># Command Shortening Aliases
alias md5='md5sum'
alias sha='sha256sum'
alias p='/usr/bin/python2.5'</code></pre>
<p>Simple ls aliases, should be pretty straight forward.</p>
<pre><code># ls Aliases
alias lsd='ls --group-directories-first'
alias lsl='ls -l'
alias lsh='ls -lh'
alias ls1='ls -1'</code></pre>
<p>The first alias here, just mounts a given ISO ($1) at mount point ($2).  The 2nd is a manual mount for my filer.  I didn&#8217;t want it automounting since it would give someone access to pretty much everything I have.  A quick line count alias, quickie to grep history, and an alias to give me the size of a folder only showing 1 level below.  The last alias in this group creates a screen session with the name irssi and executes irssi in side of it, but it also detaches the session.  This was created because a lot of times I wanted to start irssi in the background, but didn&#8217;t want to have to detach the screen session.</p>
<pre><code># Various
alias iso='sudo mount -o loop $1 $2'
alias mount.filer='sudo mount host:/dir /dir'
alias lc='wc -l'
alias gh='history | grep'
alias fs='du --max-depth=1 -h'
alias irc='screen -d -m -S irssi /usr/bin/irssi'</code></pre>
<p>This is a short script, that could probably be made into a one line alias.  It uses screen to connect to a USB serial adapter.  By default it connects at 115200, but the speed can easily be changed&#8230; &#8217;s 9600&#8242;</p>
<pre><code>#!/bin/bash

if [ $# -ne 1 ]; then
  SPEED=115200
else
  SPEED=$1
fi

screen /dev/ttyUSB0 $SPEED</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/linux/various-aliases-and-short-scripts/2010/01/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Move to Cherokee</title>
		<link>http://pyverted.com/linux/move-to-cherokee/2009/12/</link>
		<comments>http://pyverted.com/linux/move-to-cherokee/2009/12/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 09:51:13 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Cherokee]]></category>
		<category><![CDATA[Web Server]]></category>

		<guid isPermaLink="false">http://pyverted.com/?p=404</guid>
		<description><![CDATA[I just finished moving everything over to Cherokee and thus far I am really enjoying it.  It has a built in Admin interface that handles graceful restarts, a long long list of features, and from what I have read it has very good performance.
Right now I am talking with some people about the very [...]]]></description>
			<content:encoded><![CDATA[<p>I just finished moving everything over to <a href="http://www.cherokee-project.com" target="_blank">Cherokee</a> and thus far I am really enjoying it.  It has a built in Admin interface that handles graceful restarts, a long long list of features, and from what I have read it has very good performance.</p>
<p>Right now I am talking with some people about the very interesting <a href="http://www.cherokee-project.com/doc/modules_handlers_dbslayer.html" target="_blank">MySQL bridge integrated in Cherokee</a>.  The bridge allows you to send commands in a language and have it returned in the same language.  So you can use Ruby, Python, JSON or PHP to send your SQL command and you will get your results back in the same language.  There is built in media streaming support, built in SSL/TLS, support for FastCGI, SCGI, uWSGI, and tons more stuff.</p>
<p>I encourage you to check it out.  I will definitely be posting more about Cherokee in coming weeks when I test out the MySQL bridge and compare it to the performance with the MySQL module for Python.</p>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/linux/move-to-cherokee/2009/12/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Chrome on Linux</title>
		<link>http://pyverted.com/linux/google-chrome-on-linux/2009/09/</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>
		</item>
		<item>
		<title>Endian Firewall Hostname Limitation</title>
		<link>http://pyverted.com/linux/endian-firewall-hostname-limitation/2009/08/</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>
		</item>
		<item>
		<title>Fedora DHCP</title>
		<link>http://pyverted.com/linux/fedora-dhcp/2009/08/</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>
		</item>
		<item>
		<title>Right-click MD5 file generation, with autocheck</title>
		<link>http://pyverted.com/linux/right-click-md5-file-generation-with-autocheck/2009/08/</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>
		</item>
		<item>
		<title>MD5 File Autochecking</title>
		<link>http://pyverted.com/linux/md5-file-autochecking/2009/08/</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>
		</item>
		<item>
		<title>Ubuntu User Directories</title>
		<link>http://pyverted.com/linux/ubuntu-user-directories/2009/08/</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>
		</item>
		<item>
		<title>Setting Up Version Control on your Home Directory</title>
		<link>http://pyverted.com/linux/setting-up-version-control-on-your-home-directory/2009/08/</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>
		</item>
		<item>
		<title>VLC on a separate X Screen</title>
		<link>http://pyverted.com/linux/vlc-on-a-separate-x-screen/2009/07/</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>
		</item>
		<item>
		<title>Linux File Permissions</title>
		<link>http://pyverted.com/linux/linux-file-permissions/2008/11/</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>
		</item>
		<item>
		<title>Work Environment</title>
		<link>http://pyverted.com/sysadmin/work-environment/2008/11/</link>
		<comments>http://pyverted.com/sysadmin/work-environment/2008/11/#comments</comments>
		<pubDate>Sun, 16 Nov 2008 16:56:48 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[Applications]]></category>
		<category><![CDATA[Consulting]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Environment]]></category>

		<guid isPermaLink="false">http://pyverted.com/?p=109</guid>
		<description><![CDATA[I have noticed a few people have been commenting on their development environments and wanted to chime in on what I use when I am consulting or working on a personal project.
Internet Based:

Dropbox &#8211; This application allows me to share files between all of my platforms.  It works very similar to how subversion works, [...]]]></description>
			<content:encoded><![CDATA[<p>I have noticed a few people have been commenting on their development environments and wanted to chime in on what I use when I am consulting or working on a personal project.</p>
<p><strong>Internet Based</strong>:</p>
<ul>
<li><a href="http://www.getdropbox.com/" target="_blank">Dropbox</a> &#8211; This application allows me to share files between all of my platforms.  It works very similar to how subversion works, but commits the files automatically after they have been added to the directory.  They are stored encrypted on the Dropbox servers so the information is safe from prying eyes.</li>
<li><a href="http://twitter.com/petermanis" target="_blank">Twitter</a> &#8211; I never got the whole twitter thing for a long time, but it is nice to know what my friends are up to.</li>
<li><a href="http://www.facebook.com/profile.php?id=516407504" target="_blank">Facebook</a> &#8211; Probably the only decent social networking site out there</li>
<li><a href="http://www.linkedin.com/in/manis" target="_blank">LinkedIn</a> &#8211; Business social networking.</li>
<li><a href="http://del.icio.us/petermanis" target="_blank">del.icio.us</a> &#8211; Social bookmarking.</li>
<li><a href="http://pownce.com/manis/" target="_blank">Pownce</a> &#8211; Similar to twitter, but does more for media sharing.</li>
</ul>
<p><span id="more-109"></span></p>
<p><strong>On the Desktop</strong>:</p>
<ul>
<li><a href="http://www.eclipse.org/" target="_blank">Eclipse</a> with <a href="http://pydev.sourceforge.net" target="_blank">Pydev</a> &#8211; I have done a lot of switching of IDEs, I sometimes go back to <a href="http://www.activestate.com/Products/komodo_ide/komodo_edit.mhtml" target="_blank">Komodo Edit</a>, but for the most part I have found Pydev to be one of the best IDEs for Python development</li>
<li><a href="http://macromates.com/" target="_blank">Textmate</a> &#8211; For a lot of things I hate Textmate.  For a long time I was against code completion, but lacking drop down code completion is something I dislike a great deal about Textmate.  I have found Textmate to be great for editing JSON by hand, and for a quick edit on pretty much any type of source.  It also happens to be the best &#8220;notepad&#8221; alternative on the Mac.  What I use Textmate for most of all is notes.  I have a few directories and I run &#8220;mate&#8221; on it giving me a great environment for keeping notes.</li>
<li><a href="http://www.zend.com/en/products/studio/" target="_blank">Zend Studio for Eclipse</a> &#8211; I use Zend Studio for almost all of my PHP development.  It is a fantastic product and the only times I don&#8217;t really use it are when I have a quick edit to make.  In those cases I usually pick Textmate (on the Mac) and UltraEdit (on Windows)</li>
<li><a href="http://www.ultraedit.com/" target="_blank">UltraEdit</a> &#8211; UltraEdit doesn&#8217;t have drop down completions or a lot of other fancy IDE features, for it is a super powerful editor and I have been using it for about 6 years now and don&#8217;t plan on stopping.  It took time getting used to it, but once I did I find myself using it for more than I ever thought I would.</li>
<li><a href="http://tortoisesvn.tigris.org/" target="_blank">TortoiseSVN</a> &#8211; The best subversion client you can find.  I have tried a lot of the ones for Mac and Windows and I really haven&#8217;t found on that works as well or gives just the right features as TortoiseSVN.</li>
<li><a href="http://www.flashfxp.com/" target="_blank">FlashFXP</a> &#8211; I rarely use FTP, but when I do FlashFXP is my choice.  I wish it included SFTP/SSH support, but hopefully they will do a rewrite at some point and it will be included.</li>
<li><a href="http://www.scootersoftware.com/" target="_blank">Beyond Compare</a> &#8211; Probably the best text comparison tool I have ever used.  In addition to comparing file contents you can do various checks on file themselves, which helps when comparing directories full of files.</li>
<li><a href="http://www.analogx.com/CONTENTS/download/system/capture.htm" target="_blank">AnalogX Capture</a> &#8211; I use this to capture website designs that motivate me or inspire me.</li>
<li><a href="http://www.microsoft.com/windows/windows-xp/" target="_blank">Windows XP</a> &#8211; My primary desktop runs Windows, and while so many have so much to say about an operating system they know very little about tuning and maintaining I still enjoy using Windows for many tasks.</li>
<li><a href="http://www.apple.com/macosx/" target="_blank">Mac OS X, Leopard</a> &#8211; My work laptop is a Mac Book Pro running Leopard, and I enjoy using it more than any other system so I find myself doing a decent amount of work on it.</li>
<li><a href="http://www.ubuntu.com/" target="_blank">Ubuntu</a> &#8211; As for a Linux desktop I use Ubuntu since it saves time getting things setup and there is a lot of software available for the distro.</li>
<li><a href="http://www.mozilla.com/en-US/products/firefox/" target="_blank">Firefox</a> &#8211; One of the best browsers, and super awesome on Mac OS X.</li>
<li><a href="http://www.videolan.org/vlc/" target="_blank">VLC</a> &#8211; Video player that handles playing DVD ISOs directly and supports virtually any format.</li>
<li><a href="http://www.vienna-rss.org/vienna2.php" target="_blank">Vienna</a> &#8211; Feed reader for Mac OS.</li>
<li><a href="http://culturedcode.com/things/" target="_blank">Things</a> &#8211; Todo list application with a lot of features.</li>
<li><a href="http://iterm.sourceforge.net/" target="_blank">iTerm</a> &#8211; Terminal application for Mac OS.</li>
<li><a href="http://www.adiumx.com/" target="_blank">AdiumX</a>/<a href="http://pidgin.im/" target="_blank">Pidgin</a> &#8211; Multi service chat clients</li>
<li><a href="http://www.xchat.org/" target="_blank">XChat</a>/<a href="http://sourceforge.net/projects/xchataqua/" target="_blank">XChat Aqua</a> &#8211; One of the best IRC clients, and the Mac OS port of it.</li>
<li><a href="http://fuse.sourceforge.net/sshfs.html" target="_blank">sshfs</a>/<a href="http://code.google.com/p/macfuse/" target="_blank">MacFUSE</a> &#8211; sshfs is one of the greatest tools, you&#8217;ll never need a sftp client again.</li>
<li><a href="http://iconfactory.com/software/twitterrific" target="_blank">Twitterific</a> &#8211; Mac OS twitter client</li>
<li><a href="http://www.gnu.org/software/screen/" target="_blank">screen</a> &#8211; Essential tool for anyone working on Unix/Linux systems.  Allows you to detach a session and disconnect while keeping your session active on the system.</li>
<li><a href="http://www.gnu.org/software/bash/manual/bashref.html" target="_blank">bash</a> &#8211; No explanation needed</li>
<li><a href="http://www.transmissionbt.com/" target="_blank">Transmission</a> &#8211; Bit torrent client for Mac OS.  Supports IP block lists.</li>
<li><a href="http://vmware.com/products/fusion/" target="_blank">VMware Fusion</a> &#8211; Virtualization software for Mac OS.</li>
<li>ssh/scp/sftp &#8211; Remote terminal, file transfer.</li>
</ul>
<p><strong>On the Server</strong>:</p>
<ul>
<li><a href="http://www.danga.com/memcached/" target="_blank">memcached</a> &#8211; A high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load.</li>
<li><a href="http://httpd.apache.org/" target="_blank">Apache</a> &#8211; Web server that has stood the test of time and handles significant traffic.</li>
<li><a href="http://subversion.tigris.org/" target="_blank">Subversion</a>/mod_dav_svn &#8211; Popular revision control</li>
<li><a href="http://djangoproject.com/" target="_blank">Django</a>/<a href="http://www.modpython.org/" target="_blank">mod_python</a> &#8211; Python web framework and the Apache module that can handle heavy work load.</li>
<li><a href="http://www.php.net" target="_blank">PHP</a> &#8211; Don&#8217;t need to explain this one</li>
<li><a href="http://www.mysql.com" target="_blank">MySQL</a> &#8211;  Or this one.</li>
<li><a href="http://lucene.apache.org/solr/" target="_blank">Solr</a> &#8211; Lucene based index software.  Very fast, and fairly easy to configure and use.</li>
<li><a href="http://www.gnu.org/software/screen/" target="_blank">screen</a>, <a href="http://www.gnu.org/software/bash/manual/bashref.html" target="_blank">bash</a>, ssh, and sftp are also used on the server.</li>
</ul>
<p><strong>Planned for the Future</strong>:</p>
<ul>
<li><a href="http://www.postgresql.org/" target="_blank">PostgreSQL</a> &#8211; PostgreSQL is a powerful, open source relational database system. It has more than 15 years of active development and a proven architecture that has earned it a strong reputation for reliability, data integrity, and correctness.</li>
<li><a href="http://www.pgadmin.org/" target="_blank">pgAdmin III</a> &#8211; The most popular and feature rich Open Source administration and development platform for PostgreSQL</li>
<li><a href="http://varnish.projects.linpro.no/" target="_blank">Varnish</a> &#8211; Varnish is a state-of-the-art, high-performance HTTP accelerator. It uses the advanced features in Linux 2.6, FreeBSD 6/7 and Solaris 10 to achieve its high performance.</li>
<li><a href="http://www.nongnu.org/fab/" target="_blank">Fabric</a> &#8211; Fabric is like the Python capistrano</li>
<li><a href="http://www.capify.org/" target="_blank">Capistrano</a> &#8211; Capistrano is a tool for automating tasks on one or more remote servers. It executes commands in parallel on all targeted machines, and provides a mechanism for rolling back changes across multiple machines.</li>
<li><a href="http://www.apsis.ch/pound/" target="_blank">Pound</a>, <a href="http://www.danga.com/perlbal/" target="_blank">Perlbal</a>, and <a href="http://nginx.net/" target="_blank">Nginx</a> &#8211; Reverse proxy load balancer and web servers</li>
<li><a href="http://code.google.com/p/modwsgi/" target="_blank">mod_wsgi</a> &#8211; What appears to be a better what to run Django in Apache</li>
<li><a href="http://activemq.apache.org/" target="_blank">ActiveMQ</a> &#8211; Popular and powerful open source Message Broker and Enterprise Integration Patterns provider.</li>
<li><a href="http://www.sun.com/software/solaris/" target="_blank">Solaris</a> and <a href="http://opensolaris.org/os/" target="_blank">OpenSolaris</a> &#8211; Unix-based operating system introduced by Sun Microsystems in 1992 as the successor to SunOS.</li>
<li><a href="http://github.com/dcramer/django-debug-toolbar/tree/master" target="_blank">Django Debug Toolbar</a> &#8211; The Django Debug Toolbar is a configurable set of panels that display various debug information about the current request/response.</li>
<li><a href="http://git.or.cz/" target="_blank">Git</a> &#8211; Open source version control system designed to handle very large projects with speed and efficiency, but just as well suited for small personal repositories</li>
<li><a href="http://sourceforge.net/projects/shelled" target="_blank">ShellEd</a> &#8211; ShellEd is a superb shell script editor for Eclipse. The great benefit of this plugin is the integration of man page information for content assist and text hover.</li>
<li><a href="http://www.erlang.org/" target="_blank">Erlang</a> &#8211; Erlang is a programming language designed at the Ericsson Computer Science Laboratory.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/sysadmin/work-environment/2008/11/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extracting text segments with sed</title>
		<link>http://pyverted.com/linux/extracting-text-segments-with-sed/2008/08/</link>
		<comments>http://pyverted.com/linux/extracting-text-segments-with-sed/2008/08/#comments</comments>
		<pubDate>Sun, 31 Aug 2008 03:40:03 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[Text Manipulation]]></category>

		<guid isPermaLink="false">http://pyverted.com/?p=471</guid>
		<description><![CDATA[A couple days ago a friend sent an email to a mailing list I am on wondering how to replace the first 99 characters of a line and extracting characters 100-106 inclusive.
cat file &#124; sed 's/^.\{99\}\(.\{7\}\).*/\1/g'
I will let you look up the regex to know what each part is doing.  You would need to [...]]]></description>
			<content:encoded><![CDATA[<p>A couple days ago a friend sent an email to a mailing list I am on wondering how to replace the first 99 characters of a line and extracting characters 100-106 inclusive.</p>
<pre><code>cat file | sed 's/^.\{99\}\(.\{7\}\).*/\1/g'</code></pre>
<p>I will let you look up the regex to know what each part is doing.  You would need to do this on a per line basis if you wanted to get 100-106 from each line.</p>
<p>I realize that this is somewhat poor design since I don&#8217;t need to cat the file to sed, sed will handle reading from the file.  I was just showing that the output needed to be sent to sed for the purpose my friend was looking for.  In a real app that needed the functionality you would process the file line by line and pass that line to the sed command to grab the 7 characters.</p>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/linux/extracting-text-segments-with-sed/2008/08/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using stdin as an input file</title>
		<link>http://pyverted.com/linux/using-stdin-as-an-input-file/2008/08/</link>
		<comments>http://pyverted.com/linux/using-stdin-as-an-input-file/2008/08/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 01:55:28 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Files]]></category>

		<guid isPermaLink="false">http://pyverted.com/?p=511</guid>
		<description><![CDATA[This is just a quick example I whipped up, it isn&#8217;t an actual situation where you might use it and wget might even take stdin for urls.
Lets say you have a html file you want to download all of the mp3s from so you run the following command to get the urls
[21:41:33][user@host ~]$ cat index.html [...]]]></description>
			<content:encoded><![CDATA[<p>This is just a quick example I whipped up, it isn&#8217;t an actual situation where you might use it and wget might even take stdin for urls.</p>
<p>Lets say you have a html file you want to download all of the mp3s from so you run the following command to get the urls</p>
<pre><code>[21:41:33][user@host ~]$ cat index.html | sed -e 's/"/\n/g' | egrep '^http.*\.mp3$'

http://www.greatestsiteever.com/song.mp3

http://www.goodmusic.com/goody.mp3

http://www.badmusic.com/bad.mp3

...</code></pre>
<p>The thing is that you don&#8217;t want to write those urls to a file on the drive because you just don&#8217;t want the clutter.</p>
<p>Enter /dev/stdin</p>
<pre><code>[21:45:48][user@host ~]$ cat index.html | sed -e 's/"/\n/g' | egrep '^http.*\.mp3$' | wget -i /dev/stdin
--21:45:49--  http://www.greatestsiteever.com/song.mp3
Resolving www.greatestsiteever.com... 10.10.10.1
Connecting to www.greatestsiteever.com|10.10.10.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `song.mp3'

    [   &lt;=========================================================&gt;   ] 3,443,012      1832.5K/s   in 2.2s   

21:45:51 (1832.5 KB/s) - `song.mp3' saved [43012]

FINISHED --21:45:51--
Downloaded: 1 files, 3.28M in 2.2s (1832.5 KB/s)
......</code></pre>
<p>This technique can be very handy depending on the type of work you are doing.  If you are needing to pass a configuration file to an application and the filesystem is read only or you don&#8217;t want to actually write the config to the filesystem or any situation where a command needs an input file and you don&#8217;t want to create any files.</p>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/linux/using-stdin-as-an-input-file/2008/08/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Move to Desktop Linux</title>
		<link>http://pyverted.com/linux/my-move-to-desktop-linux/2008/07/</link>
		<comments>http://pyverted.com/linux/my-move-to-desktop-linux/2008/07/#comments</comments>
		<pubDate>Sat, 05 Jul 2008 03:26:54 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://pyverted.com/?p=475</guid>
		<description><![CDATA[I spent the evening moving formatting my desktop and moving to Linux full time for my desktop.  In some ways this was a difficult move and in other ways it wasn&#8217;t.  What made it difficult is that there are applications in Windows that I have not found a decent replacement for.  An [...]]]></description>
			<content:encoded><![CDATA[<p>I spent the evening moving formatting my desktop and moving to Linux full time for my desktop.  In some ways this was a difficult move and in other ways it wasn&#8217;t.  What made it difficult is that there are applications in Windows that I have not found a decent replacement for.  An example would be FlashFXP, I have tried other apps, but so far none have given me the feel that FlashFXP did.  Another is Photoshop&#8230; now I am aware of GIMP, but I am not a fan of it, I am sure over time I would enjoy it, but right now I enjoy the feel of working in Photoshop.  Also with the way I have everything setup Windows wasn&#8217;t bad.  Most of the complaints I hear about Windows are from people who hardly ever use Windows, or haven&#8217;t used Windows since 3.11.  They complain about things they don&#8217;t know anything about or they say they tried to fix a Windows machine for someone and spent X hours trying to get something to work.  In some cases it was simply because they don&#8217;t have a lot of experience with Windows and it is not fair to blame Windows for that.</p>
<p>I use Linux on my company laptop, so I have gotten pretty used to using it the majority of my day for all kinds of stuff.  I found myself coming home and getting on my Windows machine needing to write some bash scripts or integrate with Linux machines better or just little tasks that are, in my opinion, easier in Linux.  All the days of using Linux I never said to myself&#8230; if I only had Windows, but at home I have countless times said&#8230; if this was only Linux.</p>
<p>I do need to continue to run a Windows virtual machine so I have been testing out VMware server and VMware workstation on Linux.  Server is free, but does not handle USB and will most likely not support unity anytime soon.  Unity will make a lot of things much better, it will allow me to use the few apps I need to without having to be inside the Windows vm all the time.</p>
<p>When I opened the Linux VMware server client it would crash and I would get the following errors.</p>
<pre><code>/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_3.4' not found (required by /usr/lib/libcairo.so.2)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/libstdc++.so.6)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_3.4' not found (required by /usr/lib/libcairo.so.2)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/libstdc++.so.6)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_3.4' not found (required by /usr/lib/libcairo.so.2)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/libstdc++.so.6)</code></pre>
<p>I had to install gcc 4.3, and run the following commands to get it working</p>
<pre><code>cp /usr/lib/gcc/i486-linux-gnu/3.4.6/libgcc_s.so
/usr/lib/vmware-server-console/lib/libgcc_s.so.1/libgcc_s.so.1</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/linux/my-move-to-desktop-linux/2008/07/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Command Aliases</title>
		<link>http://pyverted.com/linux/new-command-aliases/2007/11/</link>
		<comments>http://pyverted.com/linux/new-command-aliases/2007/11/#comments</comments>
		<pubDate>Wed, 07 Nov 2007 09:57:57 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Aliases]]></category>

		<guid isPermaLink="false">http://pyverted.com/?p=480</guid>
		<description><![CDATA[Here are two new command aliases I added
Directory list with auto grep
user@host:~$ alias lsg="ls &#124; grep $1"
user@host:~$ lsg D
Desktop
Documents
Downloads
ZDE
Directory list with &#8216;more&#8217;
user@host:~$ alias lsm="ls &#124; more"
user@host:~$ lsm
Desktop
......
Pictures
--More--
]]></description>
			<content:encoded><![CDATA[<p>Here are two new command aliases I added</p>
<p>Directory list with auto grep</p>
<pre><code>user@host:~$ alias lsg="ls | grep $1"
user@host:~$ lsg D
Desktop
Documents
Downloads
ZDE</code></pre>
<p>Directory list with &#8216;more&#8217;</p>
<pre><code>user@host:~$ alias lsm="ls | more"
user@host:~$ lsm
Desktop
......
Pictures
--More--</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/linux/new-command-aliases/2007/11/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu love dwindling away</title>
		<link>http://pyverted.com/linux/ubuntu-love-dwindling-away/2007/10/</link>
		<comments>http://pyverted.com/linux/ubuntu-love-dwindling-away/2007/10/#comments</comments>
		<pubDate>Mon, 22 Oct 2007 08:56:51 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://pyverted.com/?p=486</guid>
		<description><![CDATA[So I have been noticing horrible transfer speed problems on my laptop.  I ran hdparm in BackTrack and got 34mb/sec in Ubuntu 2.53mb/sec.  I am unable to set dma on the drive which is the real performance killer in this case. I have thus far found not solution other than compiling my own [...]]]></description>
			<content:encoded><![CDATA[<p>So I have been noticing horrible transfer speed problems on my laptop.  I ran hdparm in BackTrack and got 34mb/sec in Ubuntu <b>2.53mb/sec</b>.  I am unable to set dma on the drive which is the real performance killer in this case. I have thus far found not solution other than compiling my own kernel, which I&#8217;m kinda annoyed about.  If I wanted to be compiling kernels to get the latest features I would be using a distro that I would expect to have to do so.  If I cannot find a solution I may have to move away from Ubuntu.</p>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/linux/ubuntu-love-dwindling-away/2007/10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Penta-Booting My Laptop</title>
		<link>http://pyverted.com/linux/penta-booting-my-laptop/2007/10/</link>
		<comments>http://pyverted.com/linux/penta-booting-my-laptop/2007/10/#comments</comments>
		<pubDate>Sun, 21 Oct 2007 05:20:11 +0000</pubDate>
		<dc:creator>Peter Manis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://pyverted.com/?p=491</guid>
		<description><![CDATA[I install Kubuntu on my laptop today so now I am penta-booting BackTrack, Slackware, Ubuntu, Kubuntu, and Windows XP.  I would really like to get a few more on there, but this laptop only has a 60gb hard drive and I am not in the mood to deal with the possible horror resizing partitions [...]]]></description>
			<content:encoded><![CDATA[<p>I install Kubuntu on my laptop today so now I am penta-booting BackTrack, Slackware, Ubuntu, Kubuntu, and Windows XP.  I would really like to get a few more on there, but this laptop only has a 60gb hard drive and I am not in the mood to deal with the possible horror resizing partitions can cause if an error occurs.  I might clean off the laptop next month and put on Solaris, and try to get Fedora working again.</p>
<p>As a follow up to my Ubuntu post, I spent a good number of hours playing with Ubuntu in Gnome and I have enjoyed Gnome more than I used to.  I feel a big part of that is the new &#8220;shiny&#8221; features Ubuntu added.  I did have a lot of trouble installing Rails though, took me about 8 times before the error telling me rails did not exist went away and when I installed mongrel fastthread blew up so I had to install the deb package to avoid a headache.  I cannot say that the problem occurred because I was using Ubuntu, but since I did not compile my Ruby install I cannot say if something done during that install contributed to my problems.</p>
<p>Another interesting problem I had was that when I updated about 200mb in packages today my machine suddenly started taking a crap on me.  I do not get the shiny boot screen for Ubuntu and I am not entirely sure why, but I also don&#8217;t even get text on my screen.  This means if something goes wrong I cannot know what caused it.  Basically it went like this, the machine was booting (known by looking at the HD light) and then stopped, I hit CTRL-ALT-DEL and then it took a few seconds and booted into X.  Once I have logged in I am missing my nice shortcuts to other partitions and I even had trouble mounting them.  After one attempt mounting them I said screw it and reinstalled Ubuntu.</p>
<p>With all of that said I am at somewhat of a fork in the road.  I would really like to install 7 or 8 distros on this laptop so that I can try some of the things I learn at conferences, but at the same time, I would really like to use just one operating system on the machine.  I love my Slackware, and I would like to keep Backtrack on incase I ever need it, but I feel as my main laptop distro I will be using Ubuntu for the simple fact that it works right out of the box for me, if I ever need to reinstall on the road I can and know that I don&#8217;t have to download anything to get wireless working or hassle with anything to get standby working.</p>
<p>I can buy a 1gb memory stick for this laptop for $129 from the Dell website, which isn&#8217;t horrible, but at the same time it is $129 for 1gb of RAM.  If I install another stick, I have to remove one 256 stick giving me roughly 1.2gb of RAM.  That memory could then be used for VMWare server, which would allow me to run as many distros as I wanted.  The one downside is that I have received information from very good sources BackTrack should always be run from a LiveCD or direct boot, and should not be used from a VM.</p>
<p>I&#8217;ll end this post now that I feel I am jumping into too many things, but before I do I have decided to backup the things that I need to backup and I setup my laptop right.  I will be removing Kubuntu and Slackware, installing Ubuntu on the Slackware partition, deleting the old Ubuntu and Kubuntu partitions and joining them to make one ext3 shared partition.  I have to have Windows XP and I have to have BackTrack to complete my labs and my exam for OSCP.</p>
<p>Funny I went from Penta-booting to Triple-Booting in one day and for no good reason.</p>
]]></content:encoded>
			<wfw:commentRss>http://pyverted.com/linux/penta-booting-my-laptop/2007/10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
