<?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>Racker Hacker &#187; ruby</title>
	<atom:link href="http://rackerhacker.com/tag/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://rackerhacker.com</link>
	<description>Words of wisdom from a server administrator</description>
	<lastBuildDate>Tue, 07 Feb 2012 14:07:41 +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>Getting apache, PHP, and memcached working with SELinux</title>
		<link>http://rackerhacker.com/2011/09/07/getting-apache-php-and-memcached-working-with-selinux/</link>
		<comments>http://rackerhacker.com/2011/09/07/getting-apache-php-and-memcached-working-with-selinux/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 03:55:00 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[red hat]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[selinux]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=2516</guid>
		<description><![CDATA[I'm using SELinux more often now on my Fedora 15 installations and I came up against a peculiar issue today on a new server. My PHP installation is configured to store its sessions in memcached and I brought over some working configurations from another server. However, each time I accessed a page which tried to [...]<p><a href="http://rackerhacker.com/2011/09/07/getting-apache-php-and-memcached-working-with-selinux/">Getting apache, PHP, and memcached working with SELinux</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p><a href="http://rackerhacker.com/wp-content/uploads/2011/09/selinux-penguin-125.png"><img src="http://rackerhacker.com/wp-content/uploads/2011/09/selinux-penguin-125.png" alt="SELinux Penguin" title="SELinux Penguin" width="125" height="113" class="alignright size-full wp-image-2532" /></a>I'm using SELinux more often now on my Fedora 15 installations and I came up against a peculiar issue today on a new server.  My PHP installation is configured to store its sessions in memcached and I brought over some working configurations from another server.  However, each time I accessed a page which tried to initiate a session, the page load would hang for about a minute and I'd find this in my apache error logs:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[Thu Sep 08 03:23:40 2011] [error] [client 11.22.33.44] PHP Warning:  
Unknown: Failed to write session data (memcached). Please verify that 
the current setting of session.save_path is correct (127.0.0.1:11211) 
in Unknown on line 0</pre></div></div>

<p>I ran through my usual list of checks:</p>
<ul>
<li>netstat showed memcached bound to the correct ports/interfaces</li>
<li>memcached was running and I could reach it via telnet</li>
<li>memcached-tool could connect and pull stats from memcached</li>
<li>double-checked my php.ini</li>
<li>tested memcached connectivity via a PHP and ruby script -- they worked</li>
</ul>
<p>Even after all that, I still couldn't figure out what was wrong.  I ran strace on memcached while I ran a curl against the page which creates a session and I found something significant -- memcached wasn't seeing any connections whatsoever at that time.  A quick check of the lo interface with tcpdump showed the same result.  Just before I threw a chair, I remembered one thing:</p>
<p><em>SELinux.</em></p>
<p>A quick check for AVC denials showed the problem:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># aureport --avc | tail -n 1
4021. 09/08/2011 03:23:38 httpd system_u:system_r:httpd_t:s0 42 tcp_socket name_connect system_u:object_r:memcache_port_t:s0 denied 31536</pre></div></div>

<p>I'm far from being a guru on SELinux, so I leaned on audit2allow for help:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># grep memcache /var/log/audit/audit.log | audit2allow
&nbsp;
#============= httpd_t ==============
#!!!! This avc can be allowed using one of the these booleans:
#     httpd_can_network_relay, httpd_can_network_memcache, httpd_can_network_connect
&nbsp;
allow httpd_t memcache_port_t:tcp_socket name_connect;</pre></div></div>

<p>The boolean we're looking for is <code>httpd_can_network_memcache</code>. Flipping the boolean can be done in a snap:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># setsebool -P httpd_can_network_memcache 1
# getsebool httpd_can_network_memcache
httpd_can_network_memcache --&gt; on</pre></div></div>

<p>After adjusting the boolean, apache was able to make connections to memcached without a hitch.  My page which created sessions loaded quickly and I could see data being stored in memcached.  If you want to check the status of all of the apache-related SELinux booleans, just use getsebool:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># getsebool -a | grep httpd | grep off$
allow_httpd_anon_write --&gt; off
allow_httpd_mod_auth_ntlm_winbind --&gt; off
allow_httpd_mod_auth_pam --&gt; off
allow_httpd_sys_script_anon_write --&gt; off
httpd_can_check_spam --&gt; off
httpd_can_network_connect_cobbler --&gt; off
httpd_can_network_connect_db --&gt; off
httpd_can_network_relay --&gt; off
httpd_can_sendmail --&gt; off
httpd_dbus_avahi --&gt; off
httpd_enable_ftp_server --&gt; off
httpd_enable_homedirs --&gt; off
httpd_execmem --&gt; off
httpd_read_user_content --&gt; off
httpd_setrlimit --&gt; off
httpd_ssi_exec --&gt; off
httpd_tmp_exec --&gt; off
httpd_unified --&gt; off
httpd_use_cifs --&gt; off
httpd_use_gpg --&gt; off
httpd_use_nfs --&gt; off</pre></div></div>

<p>If you're interested in SELinux, a good way to get your feet wet is to head over to the CentOS Wiki and review their <a href="http://wiki.centos.org/HowTos/SELinux">SELinux Howtos</a></p>
<p><a href="http://rackerhacker.com/2011/09/07/getting-apache-php-and-memcached-working-with-selinux/">Getting apache, PHP, and memcached working with SELinux</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2011/09/07/getting-apache-php-and-memcached-working-with-selinux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Reincarnation of Twitter&#039;s realtime XMPP search term tracking with ruby</title>
		<link>http://rackerhacker.com/2010/06/17/reincarnation-of-twitters-realtime-xmpp-search-term-tracking-with-ruby/</link>
		<comments>http://rackerhacker.com/2010/06/17/reincarnation-of-twitters-realtime-xmpp-search-term-tracking-with-ruby/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 18:40:48 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[jabber]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[xmpp]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=1517</guid>
		<description><![CDATA[When Twitter was still in its early stages, you could track certain search terms in near-realtime via Jabber. It was quite popular and its performance degraded over time as more users signed up and began posting updates. Eventually, Twitter killed the jabber bot altogether. Many users have asked when it will return. Well, it hasn't [...]<p><a href="http://rackerhacker.com/2010/06/17/reincarnation-of-twitters-realtime-xmpp-search-term-tracking-with-ruby/">Reincarnation of Twitter's realtime XMPP search term tracking with ruby</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>When Twitter was still in its early stages, you could track certain search terms in near-realtime <a href="http://blog.twitter.com/2006/10/use-twitter-by-instant-message.html">via Jabber</a>.  It was quite popular and its performance degraded over time as more users signed up and began posting updates.  Eventually, Twitter killed the jabber bot altogether.  <a href="http://www.lagesse.org/twitter-and-track/">Many users have asked when it will return</a>.</p>
<p>Well, it hasn't returned, but you can build your own replacement with ruby, a jabber account, and a few gems.  While it won't do everything that the original jabber bot did, you can still track tweets mentioning certain terms very quickly.</p>
<p>Here's how to get started:</p>
<p>First, install the <em>tweetstream</em> and <em>xmpp4r-simple</em> gems:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">gem install tweetstream xmpp4r-simple</pre></div></div>

<p>Next, you'll need a jabber account.  You'll probably want to make one for the exclusive use of your jabber bot.  I chose to make up a quick account at <a href="http://www.chatmask.com/">ChatMask</a> for mine.</p>
<p>The last step is to drop a copy of this script on your server:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;">#!/usr/bin/ruby</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'rubygems'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'tweetstream/client'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'tweetstream/hash'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'tweetstream/status'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'tweetstream/user'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'tweetstream/daemon'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'xmpp4r-simple'</span>
&nbsp;
jabber = <span style="color:#6666ff; font-weight:bold;">Jabber::Simple</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'jabberbot@yourjabberserver.com'</span>,<span style="color:#996600;">'jabberpassword'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
tweets = <span style="color:#6666ff; font-weight:bold;">TweetStream::Client</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>twitterusername,twitterpassword<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
tweets.<span style="color:#9900CC;">track</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'celtics'</span>,<span style="color:#996600;">'lakers'</span>,<span style="color:#996600;">'finals'</span>,<span style="color:#996600;">'nba'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>status, client<span style="color:#006600; font-weight:bold;">|</span>
  imtext = <span style="color:#996600;">&quot;#{status.user.screen_name}: #{status.text} <span style="color:#000099;">\r</span><span style="color:#000099;">\n</span>&quot;</span> 
  imtext <span style="color:#006600; font-weight:bold;">+</span>= <span style="color:#996600;">&quot;[http://twitter.com/#{status.user.screen_name}/status/#{status.id}]&quot;</span>
  jabber.<span style="color:#9900CC;">deliver</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;yourjabberusername@yourjabberserver.com&quot;</span>,imtext<span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
jabber.<span style="color:#9900CC;">disconnect</span></pre></div></div>

<p>You'll want to be sure to fill in the following:</p>
<ul>
<li>your jabber bot's username and password</li>
<li>the username and password for the twitter account that will monitor the stream</li>
<li>the search terms you want to track</li>
<li>the destination jabber account where the messages should be sent</li>
</ul>
<p>Ensure that your jabber account has authorized the jabber bot's account so that you'll actually receive the messages.  Also, Twitter is <a href="http://apiwiki.twitter.com/Streaming-API-Documentation#FilterLimiting">very strict with their streaming API tracking terms</a>.  It's a good idea to review their <a href="http://apiwiki.twitter.com/Streaming-API-Documentation">entire Streaming API documentation</a> to ensure that you're not going to end up having your account temporarily or permanently blacklisted.</p>
<p>Once everything is ready to go, you can just run the script within GNU screen or via nohup.  There's still a bit more error checking to do around jabber reconnections, but the script has run non-stop for well over two weeks at a time without a failure.</p>
<p><a href="http://rackerhacker.com/2010/06/17/reincarnation-of-twitters-realtime-xmpp-search-term-tracking-with-ruby/">Reincarnation of Twitter's realtime XMPP search term tracking with ruby</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2010/06/17/reincarnation-of-twitters-realtime-xmpp-search-term-tracking-with-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Idiot&#039;s guide to OAuth logins for Twitter</title>
		<link>http://rackerhacker.com/2010/05/19/idiots-guide-to-oauth-logins-for-twitter/</link>
		<comments>http://rackerhacker.com/2010/05/19/idiots-guide-to-oauth-logins-for-twitter/#comments</comments>
		<pubDate>Thu, 20 May 2010 01:26:07 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=1425</guid>
		<description><![CDATA[It certainly shouldn't be difficult, but I always have a tough time with OAuth. Twitter is dropping support for basic authentication on June 30th, 2010. I have some automated Twitter bots that need an upgrade, so I've been working on a quick solution to generate tokens for my scripts. I formulated a pretty simple script [...]<p><a href="http://rackerhacker.com/2010/05/19/idiots-guide-to-oauth-logins-for-twitter/">Idiot's guide to OAuth logins for Twitter</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>It certainly shouldn't be difficult, but I always have a tough time with <a href="http://en.wikipedia.org/wiki/OAuth">OAuth</a>.  Twitter is <a href="http://apiwiki.twitter.com/OAuth-FAQ#WhenareyougoingtoturnoffBasicAuth">dropping support for basic authentication</a> on <a href="http://countdowntooauth.com/">June 30th, 2010</a>.  I have some automated Twitter bots that need an upgrade, so I've been working on a quick solution to generate tokens for my scripts.</p>
<p>I formulated a pretty simple script using <a href="http://twitter.rubyforge.org/">John Nunemaker's twitter gem</a> that will get it done manually for any scripts you have that read from or update Twitter:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;">#!/usr/bin/ruby</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'rubygems'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'twitter'</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># These credentials are specific to your *application* and not your *user*</span>
<span style="color:#008000; font-style:italic;"># Get these credentials from Twitter directly: http://twitter.com/apps</span>
application_token = <span style="color:#996600;">'[this should be the shorter one]'</span>
application_secret = <span style="color:#996600;">'[this should be the longer one]'</span>
&nbsp;
oauth = <span style="color:#6666ff; font-weight:bold;">Twitter::OAuth</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>application_token,application_secret<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
request_token = oauth.<span style="color:#9900CC;">request_token</span>.<span style="color:#9900CC;">token</span>
request_secret = oauth.<span style="color:#9900CC;">request_token</span>.<span style="color:#9900CC;">secret</span>
<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Request token =&gt; #{request_token}&quot;</span>
<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Request secret =&gt; #{request_secret}&quot;</span>
<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Authentication URL =&gt; #{oauth.request_token.authorize_url}&quot;</span>
&nbsp;
<span style="color:#CC0066; font-weight:bold;">print</span> <span style="color:#996600;">&quot;Provide the PIN that Twitter gave you here: &quot;</span>
pin = <span style="color:#CC0066; font-weight:bold;">gets</span>.<span style="color:#CC0066; font-weight:bold;">chomp</span>
&nbsp;
oauth.<span style="color:#9900CC;">authorize_from_request</span><span style="color:#006600; font-weight:bold;">&#40;</span>request_token,request_secret,pin<span style="color:#006600; font-weight:bold;">&#41;</span>
access_token = oauth.<span style="color:#9900CC;">access_token</span>.<span style="color:#9900CC;">token</span>
access_secret = oauth.<span style="color:#9900CC;">access_token</span>.<span style="color:#9900CC;">secret</span>
<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Access token =&gt; #{oauth.access_token.token}&quot;</span>
<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Access secret =&gt; #{oauth.access_token.secret}&quot;</span>
&nbsp;
oauth.<span style="color:#9900CC;">authorize_from_access</span><span style="color:#006600; font-weight:bold;">&#40;</span>access_token, access_secret<span style="color:#006600; font-weight:bold;">&#41;</span>
twitter = <span style="color:#6666ff; font-weight:bold;">Twitter::Base</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>oauth<span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#CC0066; font-weight:bold;">puts</span> twitter.<span style="color:#9900CC;">friends_timeline</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:count</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<p>When you run the script, it will give you a request token, request secret and a URL to visit.  When you access the URL, you'll be given a PIN.  Type the PIN into the prompt and you'll get your access token and secret.  This is what you can use to continue authenticating with Twitter, so be sure to save the access token and secret.</p>
<p>From then on, you should be able to login with a script like this:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;">#!/usr/bin/ruby</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'rubygems'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'twitter'</span>
&nbsp;
application_token = <span style="color:#996600;">'[this should be the shorter one]'</span>
application_secret = <span style="color:#996600;">'[this should be the longer one]'</span>
&nbsp;
oauth = <span style="color:#6666ff; font-weight:bold;">Twitter::OAuth</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>application_token,application_secret<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
oauth.<span style="color:#9900CC;">authorize_from_access</span><span style="color:#006600; font-weight:bold;">&#40;</span>access_token, access_secret<span style="color:#006600; font-weight:bold;">&#41;</span>
twitter = <span style="color:#6666ff; font-weight:bold;">Twitter::Base</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>oauth<span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#CC0066; font-weight:bold;">puts</span> twitter.<span style="color:#9900CC;">friends_timeline</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:count</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<p>I hope this helps!</p>
<p><a href="http://rackerhacker.com/2010/05/19/idiots-guide-to-oauth-logins-for-twitter/">Idiot's guide to OAuth logins for Twitter</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2010/05/19/idiots-guide-to-oauth-logins-for-twitter/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>New Linux security advisory Twitter bots</title>
		<link>http://rackerhacker.com/2009/02/05/new-linux-security-advisory-twitter-bots/</link>
		<comments>http://rackerhacker.com/2009/02/05/new-linux-security-advisory-twitter-bots/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 17:00:03 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[red hat]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=762</guid>
		<description><![CDATA[Thanks to the simplicity of ruby as well as the twitter and httparty gems, I've whipped up some Twitter bots today. The three bots will alert you when there are Red Hat, Ubuntu, or Debian security advisories. I'd set one up for Fedora, but their feed is broken today. @redhaterrata - Red Hat Errata Updates [...]<p><a href="http://rackerhacker.com/2009/02/05/new-linux-security-advisory-twitter-bots/">New Linux security advisory Twitter bots</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>Thanks to the simplicity of <a href="http://ruby-lang.org/">ruby</a> as well as the <a href="http://twitter.rubyforge.org/">twitter</a> and <a href="http://github.com/jnunemaker/httparty/tree/master">httparty</a> gems, I've whipped up some Twitter bots today.  The three bots will alert you when there are Red Hat, Ubuntu, or Debian security advisories.  I'd set one up for Fedora, but their feed is broken today.</p>
<p><strong><a href="http://twitter.com/redhaterrata/">@redhaterrata</a></strong> - Red Hat Errata Updates<br />
<strong><a href="http://twitter.com/ubuntusecurity/">@ubuntusecurity</a></strong> - Ubuntu Security Notifications<br />
<strong><a href="http://twitter.com/debiansecurity/">@debiansecurity</a></strong> - Debian Security Advisories</p>
<p>As always, you can <a href="http://twitter.com/rackerhacker/">let me know</a> if you have any suggestions for improvements, or other bots you'd like to see.</p>
<p><a href="http://rackerhacker.com/2009/02/05/new-linux-security-advisory-twitter-bots/">New Linux security advisory Twitter bots</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2009/02/05/new-linux-security-advisory-twitter-bots/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Viewing documentation for your ruby gems</title>
		<link>http://rackerhacker.com/2008/11/05/viewing-documentation-for-your-ruby-gems/</link>
		<comments>http://rackerhacker.com/2008/11/05/viewing-documentation-for-your-ruby-gems/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 00:14:57 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=594</guid>
		<description><![CDATA[I stumbled into this four line ruby script that will serve up all of the rdoc documentation for your server's currently installed gems: 1 2 3 4 #!/usr/bin/env ruby require &#34;rubygems/server&#34; options = &#123;:gemdir =&#62; Gem.dir, :port =&#62; 4242, :daemon =&#62; true&#125; Gem::Server::run&#40;options&#41; Thanks to Daniel for the ruby code! Viewing documentation for your ruby [...]<p><a href="http://rackerhacker.com/2008/11/05/viewing-documentation-for-your-ruby-gems/">Viewing documentation for your ruby gems</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>I stumbled into this four line ruby script that will serve up all of the rdoc documentation for your server's currently installed gems:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;">#!/usr/bin/env ruby</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">&quot;rubygems/server&quot;</span>
options = <span style="color:#006600; font-weight:bold;">&#123;</span>:gemdir <span style="color:#006600; font-weight:bold;">=&gt;</span> Gem.<span style="color:#9900CC;">dir</span>, <span style="color:#ff3333; font-weight:bold;">:port</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006666;">4242</span>, <span style="color:#ff3333; font-weight:bold;">:daemon</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#125;</span>
<span style="color:#6666ff; font-weight:bold;">Gem::Server</span>::run<span style="color:#006600; font-weight:bold;">&#40;</span>options<span style="color:#006600; font-weight:bold;">&#41;</span></pre></td></tr></table></div>

<p><em>Thanks to Daniel for the ruby code!</em></p>
<p><a href="http://rackerhacker.com/2008/11/05/viewing-documentation-for-your-ruby-gems/">Viewing documentation for your ruby gems</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2008/11/05/viewing-documentation-for-your-ruby-gems/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

