<?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>Sean&#039;s Blog &#187; Linux</title>
	<atom:link href="http://seanbehan.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://seanbehan.com</link>
	<description>Web Programming, Ruby on Rails, Wordpress, PHP from Burlington, Vermont</description>
	<lastBuildDate>Wed, 18 Jan 2012 21:44:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Backup and Rotate MySQL Databases Simple Bash Script</title>
		<link>http://seanbehan.com/databases/backup-and-rotate-mysql-databases-simple-bash-script/</link>
		<comments>http://seanbehan.com/databases/backup-and-rotate-mysql-databases-simple-bash-script/#comments</comments>
		<pubDate>Sat, 04 Jun 2011 16:29:48 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[backups]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysqldump]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1343</guid>
		<description><![CDATA[Make a directory ( it can anywhere ) called baks/mysql mkdir -p /baks/mysql Create a file (it can be anywhere) called /root/mysql_backups.sh and put this script in it #!/bin/bash # modify the following to suit your environment export DB_BACKUP=&#34;/baks/mysql&#34; export DB_USER=&#34;root&#34; export DB_PASSWD=&#34;your-mysql-password-goes-here&#34; # title and version echo &#34;&#34; echo &#34;Backup and rotate all mysql [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Fdatabases%2Fbackup-and-rotate-mysql-databases-simple-bash-script%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Backup and Rotate MySQL Databases Simple Bash Script" data-url="http://seanbehan.com/databases/backup-and-rotate-mysql-databases-simple-bash-script/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>Make a directory ( it can anywhere ) called baks/mysql</p>
<pre class="wp-code-highlight prettyprint">
mkdir -p /baks/mysql
</pre>
<p>Create a file (it can be anywhere) called /root/mysql_backups.sh and put this script in it</p>
<pre class="wp-code-highlight prettyprint">
#!/bin/bash

# modify the following to suit your environment
export DB_BACKUP=&quot;/baks/mysql&quot;
export DB_USER=&quot;root&quot;
export DB_PASSWD=&quot;your-mysql-password-goes-here&quot;

# title and version
echo &quot;&quot;
echo &quot;Backup and rotate all mysql databases&quot;
echo &quot;--------------------------&quot;

rm -rf $DB_BACKUP/04
mv $DB_BACKUP/03 $DB_BACKUP/04
mv $DB_BACKUP/02 $DB_BACKUP/03
mv $DB_BACKUP/01 $DB_BACKUP/02
mkdir $DB_BACKUP/01

echo &quot;* Creating backup...&quot;
mysqldump --user=$DB_USER --password=$DB_PASSWD --all-databases | bzip2 &gt; $DB_BACKUP/01/mysql-`date +%Y-%m-%d`.bz2
echo &quot;----------------------&quot;
echo &quot;Done&quot;
exit 0
</pre>
<p>Install it via cron and have it run at 3:10 am every morning.</p>
<pre class="wp-code-highlight prettyprint">
crontab -e

10 3 * * * /root/mysql_backups.sh  &gt; /baks/status.log
</pre>
<p>This script will save the last 4 days of data.</p>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/databases/backup-and-rotate-mysql-databases-simple-bash-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Copy and Paste to/from the Global Register with Tmux on Mac OS X</title>
		<link>http://seanbehan.com/linux/how-to-copy-and-paste-tofrom-the-global-register-with-tmux-on-mac-os-x/</link>
		<comments>http://seanbehan.com/linux/how-to-copy-and-paste-tofrom-the-global-register-with-tmux-on-mac-os-x/#comments</comments>
		<pubDate>Sat, 14 May 2011 03:10:23 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[environment]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[development environment]]></category>
		<category><![CDATA[named pipe]]></category>
		<category><![CDATA[pipes]]></category>
		<category><![CDATA[tmux]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1304</guid>
		<description><![CDATA[Using the system clipboard with tmux on OS X is broken. I really like tmux but having copy and paste is kind of important for me. Here is my attempt to get it back with a simple bash script until I find something better. The approach is to take a named pipe and feed it [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Flinux%2Fhow-to-copy-and-paste-tofrom-the-global-register-with-tmux-on-mac-os-x%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="How to Copy and Paste to/from the Global Register with Tmux on Mac OS X" data-url="http://seanbehan.com/linux/how-to-copy-and-paste-tofrom-the-global-register-with-tmux-on-mac-os-x/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>Using the system clipboard with tmux on OS X is broken. I really like tmux but having copy and paste is kind of important for me. Here is my attempt to get it back with a simple bash script until I find something better. The approach is to take a named pipe and feed it the contents of &#8220;tmux showb&#8221;. A bash script will manage the pipe and because this script is initialized from a normal session it will write to the system clipboard just fine.</p>
<p>In my .bash_profile&#8230; </p>
<pre class="wp-code-highlight prettyprint">
pipe4tmux=/tmp/pipe4tmux
alias tcp=&quot;tmux showb &gt; $pipe4tmux&quot;
if [[ ! -p $pipe4tmux ]]; then
~/pipe4tmux.sh &amp;
fi
</pre>
<p>And in pipe4tmux.sh&#8230;</p>
<pre class="wp-code-highlight prettyprint">
#!/bin/bash
pipe4tmux=/tmp/pipe4tmux
echo &quot;Starting named pipe $pipe4tmux&quot;
trap &quot;rm -f $pipe4tmux&quot; EXIT

if [[ ! -p $pipe4tmux ]]; then
  mkfifo $pipe4tmux
fi

while true
do
  pbcopy &lt; $pipe4tmux
done

echo &quot;Quitting pipe4tmux $pip4tmux&quot;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/linux/how-to-copy-and-paste-tofrom-the-global-register-with-tmux-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ruby Enterprise Edition and Passenger ./script/console production fails and instead returns Loading production environment (Rails 2.3.5) Rails requires RubyGems &gt;= 1.3.2. Please install RubyGems and try again: http://rubygems.rubyforge.org</title>
		<link>http://seanbehan.com/linux/ruby-enterprise-edition-and-passenger-scriptconsole-production-fails-and-instead-returns-loading-production-environment-rails-2-3-5-rails-requires-rubygems-1-3-2-please-install-rubygems-and-t/</link>
		<comments>http://seanbehan.com/linux/ruby-enterprise-edition-and-passenger-scriptconsole-production-fails-and-instead-returns-loading-production-environment-rails-2-3-5-rails-requires-rubygems-1-3-2-please-install-rubygems-and-t/#comments</comments>
		<pubDate>Fri, 01 Oct 2010 14:00:21 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[irb]]></category>
		<category><![CDATA[passenger]]></category>
		<category><![CDATA[production]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[ruby enterprise edition]]></category>
		<category><![CDATA[rubygems]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1211</guid>
		<description><![CDATA[After installing Ruby Enterprise Edition, REE, and Passenger on Ubuntu you may see this error message when you run script/console for the first time ./script/console production # =&#62; Loading production environment (Rails 2.3.5) Rails requires RubyGems &#62;= 1.3.2. Please install RubyGems and try again: http://rubygems.rubyforge.org You then scratch your head and run which gem which [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Flinux%2Fruby-enterprise-edition-and-passenger-scriptconsole-production-fails-and-instead-returns-loading-production-environment-rails-2-3-5-rails-requires-rubygems-1-3-2-please-install-rubygems-and-t%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Ruby Enterprise Edition and Passenger ./script/console production fails and instead returns Loading production environment (Rails 2.3.5) Rails requires RubyGems >= 1.3.2. Please install RubyGems and try again: http://rubygems.rubyforge.org" data-url="http://seanbehan.com/linux/ruby-enterprise-edition-and-passenger-scriptconsole-production-fails-and-instead-returns-loading-production-environment-rails-2-3-5-rails-requires-rubygems-1-3-2-please-install-rubygems-and-t/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>After installing Ruby Enterprise Edition, REE, and Passenger on Ubuntu you may see this error message when you run script/console for the first time</p>
<pre class="wp-code-highlight prettyprint">
./script/console production
# =&gt;
Loading production environment (Rails 2.3.5)
Rails requires RubyGems &gt;= 1.3.2. Please install RubyGems and try again: http://rubygems.rubyforge.org
</pre>
<p>You then scratch your head and run </p>
<pre class="wp-code-highlight prettyprint">
which gem
which ruby
which rails
</pre>
<p>to find that all appears to be in order. You have rubygems installed , ruby is installed and so is rails. You also find that each are pointing to the correct location, which is something like /usr/bin/gem -> /opt/ruby-enterprise-x.x.x.x/bin/gem, where x.x.x.x is the version of REE. </p>
<p>The problem isn&#8217;t however, with any of the above. The issue is with the location of irb. If you installed (like me) irb with apt-get install irb, then irb isn&#8217;t aware of your shiny new REE and ruby gems. It&#8217;s a simple fix however, unlink irb and symlink the /usr/bin/irb to REE&#8217;s irb like so&#8230;  </p>
<pre class="wp-code-highlight prettyprint">
rm /usr/bin/irb
</pre>
<p>And symlink it to the irb that REE has in bin </p>
<pre class="wp-code-highlight prettyprint">
ln -s /opt/ruby-enterprise-x.x.x.x/bin/irb /usr/bin/irb
</pre>
<p>Now cd into your rails app and run </p>
<pre class="wp-code-highlight prettyprint">
./script/console production
</pre>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/linux/ruby-enterprise-edition-and-passenger-scriptconsole-production-fails-and-instead-returns-loading-production-environment-rails-2-3-5-rails-requires-rubygems-1-3-2-please-install-rubygems-and-t/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How Many Gigs of RAM Are On My Server?</title>
		<link>http://seanbehan.com/linux/how-many-gigs-of-ram-are-on-my-server/</link>
		<comments>http://seanbehan.com/linux/how-many-gigs-of-ram-are-on-my-server/#comments</comments>
		<pubDate>Tue, 21 Sep 2010 15:53:36 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[gig]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[ram]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1204</guid>
		<description><![CDATA[How much memory is on my linux server? Run the free command free -g total used free shared buffers cached Mem: 2 1 0 0 0 1 -/+ buffers/cache: 0 1 Swap: 3 0 3 Which will tell you memory in Gigs. You can pass other flags, such as, -m or -k, which will give [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Flinux%2Fhow-many-gigs-of-ram-are-on-my-server%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="How Many Gigs of RAM Are On My Server?" data-url="http://seanbehan.com/linux/how-many-gigs-of-ram-are-on-my-server/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>How much memory is on my linux server? Run the free command</p>
<pre class="wp-code-highlight prettyprint">
free -g
 total       used       free     shared    buffers     cached
Mem:             2          1          0          0          0          1
-/+ buffers/cache:          0          1
Swap:            3          0          3
</pre>
<p>Which will tell you memory in Gigs. You can pass other flags, such as, -m or -k, which will give you the number in megs and kilobytes respectively.
</pre>
<p>The man page is as follows</p>
<pre class="wp-code-highlight prettyprint">
man free

FREE(1)                                                                       Linux User's Manual                                                                      FREE(1)

NAME
       free - Display amount of free and used memory in the system

SYNOPSIS
       free [-b | -k | -m | -g] [-o] [-s delay ] [-t] [-V]

DESCRIPTION
       free  displays the total amount of free and used physical and swap memory in the system, as well as the buffers used by the kernel.  The shared memory column should be
       ignored; it is obsolete.

   Options
       The -b switch displays the amount of memory in bytes; the -k switch (set by default) displays it in kilobytes; the -m switch displays it in megabytes;  the  -g  switch
       displays it in gigabytes.

       The -t switch displays a line containing the totals.

       The  -o  switch  disables the display of a &quot;buffer adjusted&quot; line.  If the -o option is not specified, free subtracts buffer memory from the used memory and adds it to
       the free memory reported.

       The -s switch activates continuous polling delay seconds apart. You may actually specify any floating point number for delay, usleep(3) is used for microsecond resolu-
       tion delay times.

       The -V displays version information.

FILES
       /proc/meminfo
              memory information

SEE ALSO
       ps(1), slabtop(1), vmstat(8), top(1)
</pre>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/linux/how-many-gigs-of-ram-are-on-my-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Have Git Email Committers After Pushes</title>
		<link>http://seanbehan.com/git/have-git-email-committers-after-pushes/</link>
		<comments>http://seanbehan.com/git/have-git-email-committers-after-pushes/#comments</comments>
		<pubDate>Tue, 14 Sep 2010 22:50:05 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[email]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[/etc/hosts]]></category>
		<category><![CDATA[committer]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[mta]]></category>
		<category><![CDATA[push]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1198</guid>
		<description><![CDATA[You need a Mail Transfer Agent MTA on the server. The easiest way is to install Sendmail, which Git uses by default. apt-get install sendmail Remember that /etc/hosts file needs the ip address to map to the domain name your sending mail from # vim /etc/hosts 127.0.0.1 localhost localhost.localdomain 207.136.202.87 wwwexample.com Sendmail has a tendency [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Fgit%2Fhave-git-email-committers-after-pushes%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Have Git Email Committers After Pushes" data-url="http://seanbehan.com/git/have-git-email-committers-after-pushes/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>You need a Mail Transfer Agent MTA on the server. The easiest way is to install Sendmail, which Git uses by default. </p>
<pre class="wp-code-highlight prettyprint">
apt-get install sendmail
</pre>
<p>Remember that /etc/hosts file needs the ip address to map to the domain name your sending mail from</p>
<pre class="wp-code-highlight prettyprint">
# vim /etc/hosts
127.0.0.1     localhost localhost.localdomain
207.136.202.87    wwwexample.com
 </pre>
<p>Sendmail has a tendency to hang when sending mail otherwise. To test sendmail </p>
<pre class="wp-code-highlight prettyprint">
sendmail email@example.com
this is a test
how are you today world?
.
</pre>
<p>The period on a line by itself denotes end of message and will terminate the prompt and deliver the message. </p>
<p>Now you need to configure Git to send email after it receives a &#8220;push&#8221; from a committer. You can add email addresses, or you can set up a mailing list to email all members. Either way, you accomplish this with the following command, just remember to cd into the git repository.  </p>
<pre class="wp-code-highlight prettyprint">
git config --add hooks.mailinglist &quot;mailinglist@example.com&quot;
</pre>
<p>Next you need to activate the post-receive hook, located in the hooks directory of your repository. </p>
<pre class="wp-code-highlight prettyprint">
cp post-receive.sample post-receive
</pre>
<p>And uncomment the last line, which uses sendmail to deliver the commit message</p>
<pre class="wp-code-highlight prettyprint">
# uncomment the last line but keep the period &quot;.&quot;
. /usr/share/doc/git-core/contrib/hooks/post-receive-email
</pre>
<p>All done. Now just make some changes to your source code, add and commit them and you should receive an email with all the details!</p>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/git/have-git-email-committers-after-pushes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Uploading Files with Curl</title>
		<link>http://seanbehan.com/linux/uploading-files-with-curl/</link>
		<comments>http://seanbehan.com/linux/uploading-files-with-curl/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 16:10:05 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[tips & snippets]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[upload]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1174</guid>
		<description><![CDATA[curl -i -F name=test -F filedata=@localfile.jpg http://example.org/upload Courtesy of http://ariejan.net/2010/06/07/uploading-files-with-curl/]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Flinux%2Fuploading-files-with-curl%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Uploading Files with Curl" data-url="http://seanbehan.com/linux/uploading-files-with-curl/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><pre class="wp-code-highlight prettyprint">
curl -i -F name=test -F filedata=@localfile.jpg http://example.org/upload
</pre>
<p>Courtesy of <a href="http://ariejan.net/2010/06/07/uploading-files-with-curl/">http://ariejan.net/2010/06/07/uploading-files-with-curl/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/linux/uploading-files-with-curl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recursively Zip Up a Directory while Excluding Certain Files Based on File Extension Type</title>
		<link>http://seanbehan.com/linux/recursively-zip-up-a-directory-while-excluding-certain-files/</link>
		<comments>http://seanbehan.com/linux/recursively-zip-up-a-directory-while-excluding-certain-files/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 19:42:56 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[exclude]]></category>
		<category><![CDATA[photoshop]]></category>
		<category><![CDATA[psd]]></category>
		<category><![CDATA[zip]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1064</guid>
		<description><![CDATA[In the example below, I&#8217;m going to zip up a directory that includes images in both PNG and PSD file formats. However, I want to exclude the PSDs because they are huge! zip -r my-compressed-dir-without-psd.zip directory-to-zip -x '*.psd']]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Flinux%2Frecursively-zip-up-a-directory-while-excluding-certain-files%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Recursively Zip Up a Directory while Excluding Certain Files Based on File Extension Type" data-url="http://seanbehan.com/linux/recursively-zip-up-a-directory-while-excluding-certain-files/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>In the example below, I&#8217;m going to zip up a directory that includes images in both PNG and PSD file formats. However, I want to exclude the PSDs because they are huge!</p>
<pre class="wp-code-highlight prettyprint">
zip -r my-compressed-dir-without-psd.zip directory-to-zip -x '*.psd'
</pre>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/linux/recursively-zip-up-a-directory-while-excluding-certain-files/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Uncompress A Bz2 File Using Tar Command</title>
		<link>http://seanbehan.com/linux/uncompress-a-bz2-file-using-tar-command/</link>
		<comments>http://seanbehan.com/linux/uncompress-a-bz2-file-using-tar-command/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 21:18:13 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[bzip2]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[tar]]></category>
		<category><![CDATA[uncompress]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1062</guid>
		<description><![CDATA[Uncompress a bz2 file using tar command tar --use-compress-program bzip2 -xvf your-file-to-uncompress.tar.bz2 @source http://www.kde.gr.jp/help/doc/kdebase/doc/khelpcenter/faq/HTML/bzip2.html]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Flinux%2Funcompress-a-bz2-file-using-tar-command%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Uncompress A Bz2 File Using Tar Command" data-url="http://seanbehan.com/linux/uncompress-a-bz2-file-using-tar-command/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>Uncompress a bz2 file using tar command</p>
<pre class="wp-code-highlight prettyprint">
tar --use-compress-program bzip2 -xvf your-file-to-uncompress.tar.bz2
</pre>
<p>@source <a href="http://www.kde.gr.jp/help/doc/kdebase/doc/khelpcenter/faq/HTML/bzip2.html">http://www.kde.gr.jp/help/doc/kdebase/doc/khelpcenter/faq/HTML/bzip2.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/linux/uncompress-a-bz2-file-using-tar-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding Public/Private Key Pairs on Mac OS X and Ubuntu for Passwordless Remote SSH Sessions</title>
		<link>http://seanbehan.com/linux/adding-publicprivate-key-pairs-on-mac-os-x-and-ubuntu-for-passwordless-remote-ssh-sessions/</link>
		<comments>http://seanbehan.com/linux/adding-publicprivate-key-pairs-on-mac-os-x-and-ubuntu-for-passwordless-remote-ssh-sessions/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 23:09:42 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[remote]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=872</guid>
		<description><![CDATA[On your local machine cd into the .ssh directory in your home &#8220;~/&#8221; directory. If it doesn&#8217;t exist you can create it with &#8220;mkdir ~/.ssh&#8221;. Next generate your public/private keys and copy the public key to the remote server. cd ~/.ssh ssh-keygen -t rsa -b 4096 # will take a couple seconds but when finished [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Flinux%2Fadding-publicprivate-key-pairs-on-mac-os-x-and-ubuntu-for-passwordless-remote-ssh-sessions%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Adding Public/Private Key Pairs on Mac OS X and Ubuntu for Passwordless Remote SSH Sessions" data-url="http://seanbehan.com/linux/adding-publicprivate-key-pairs-on-mac-os-x-and-ubuntu-for-passwordless-remote-ssh-sessions/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>On your local machine cd into the .ssh directory in your home &#8220;~/&#8221; directory. If it doesn&#8217;t exist you can create it with &#8220;mkdir ~/.ssh&#8221;. Next generate your public/private keys and copy the public key to the remote server.</p>
<pre class="wp-code-highlight prettyprint">
cd ~/.ssh
ssh-keygen -t rsa -b 4096
# will take a couple seconds but when finished
# specify a full path (if there is already an existing key) or hit enter to install to the default location ~/.ssh
# when it prompts for a passphrase just hit enter
# and enter again when it asks to confirm the passphrase
# then we copy the public key the remote server (this assumes you don't already have an authorized_keys file)
# copy and paste the contents of the id_rsa.pub file into the authorized_keys file otherwise
scp id_rsa.pub user@yourdomain.com:.ssh/authorized_keys
</pre>
<p>You&#8217;ll need to edit your ssh config file and restart the process to allow for public/private key authentication.</p>
<pre class="wp-code-highlight prettyprint">
vim /etc/ssh/ssh_config
# add or uncomment these two lines
RSAAuthentication yes
PubKeyAuthentication yes
# ... and restart
/etc/init.d/ssh restart
</pre>
<h1>Troubleshooting</h1>
<p>A couple of things to keep in mind. 1) Permissions matter. Make sure that your keys are not world readable (this should be secure) Run chmod 400 on authorized_keys file.</p>
<p>If you had a set of keys already setup in .ssh/ on your local machine and want to install the new keys in another directory so as not to overwrite the old pair, you need to add them to ssh with this command</p>
<pre class="wp-code-highlight prettyprint">
ssh-add ~/full/path/to/your/new/keys
</pre>
<p>More information is available here <a href="http://www.debian-administration.org/articles/152 ">http://www.debian-administration.org/articles/152<br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/linux/adding-publicprivate-key-pairs-on-mac-os-x-and-ubuntu-for-passwordless-remote-ssh-sessions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Updating Your Twitter Status with cURL and a Bash Function</title>
		<link>http://seanbehan.com/linux/updating-your-twitter-status-with-curl-and-a-bash-function/</link>
		<comments>http://seanbehan.com/linux/updating-your-twitter-status-with-curl-and-a-bash-function/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 01:34:50 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[mac os x]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=673</guid>
		<description><![CDATA[I&#8217;m usually at the command line so I wrote a little a bash function so that i can type tweet this is really neat but kind of pointless and it will update my twitter status! some characters trip it up but in general it&#8217;s useful for most of my tweets. The tweet function just spits [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Flinux%2Fupdating-your-twitter-status-with-curl-and-a-bash-function%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Updating Your Twitter Status with cURL and a Bash Function" data-url="http://seanbehan.com/linux/updating-your-twitter-status-with-curl-and-a-bash-function/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>I&#8217;m usually at the command line so I wrote a little a bash function so that i can type</p>
<pre class="wp-code-highlight prettyprint">
tweet this is really neat but kind of pointless
</pre>
<p>and it will update my twitter status! some characters trip it up but in general it&#8217;s useful for most of my tweets. The tweet function just spits out the arguments passed to it for the status parameter for the API call to twitter.</p>
<p>Add the following to the .bash_profile file and reload the terminal (don&#8217;t forget to add your email and pwd where appropriate).</p>
<pre class="wp-code-highlight prettyprint">
tweet() {
   curl -u your_twitter_email_addr:your_twitter_passwd -d status=&quot;$*&quot; http://twitter.com/statuses/update.xml
 }
 </pre>
<p>*** Twitter still uses http basic authentication for their API. However, they are moving away from it in favor of oAuth. So I&#8217;m not sure how long this fun will last :{</p>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/linux/updating-your-twitter-status-with-curl-and-a-bash-function/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

