<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="http://www.globaljunkdrawer.com/styles/rss.css" type="text/css"?>
<rdf:RDF 
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
  xmlns="http://my.netscape.com/rdf/simple/0.9/"
>

 <channel>
  <title>Mental Junk</title>
  <link>http://www.globaljunkdrawer.com/index.php?blogId=1</link>
  <description></description>
 </channel>
    <item>
   <title>PTY allocation request failed on channel 0</title>
   <description>&lt;p&gt;
That is the message that greeted me when I tried to log into my VPS (webserver).
&lt;/p&gt;
&lt;p&gt;
I had no way of accessing my box at the console - so I couldn&#039;t do much of anything.&amp;nbsp; All the posts I could find that solved the issue (or presented solutions, anyway) required you to log into the box.&amp;nbsp; Uhhh.... this is a VIRTUAL SYSTEM.&amp;nbsp; There is NO console.&amp;nbsp; How do you log in to fix it, guys?
&lt;/p&gt;
&lt;p&gt;
Continuing my search, I stumbled upon Yak Shaving&#039;s blog regarding the same issue.&amp;nbsp; The magic command?&amp;nbsp; 
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;pre class=&quot;brush: bash&quot;&gt;
ssh user@host &amp;quot;/bin/bash -i&amp;quot;
&lt;/pre&gt;
&lt;pre class=&quot;brush: bash&quot;&gt;
Ah!  Pure magic!!  Back into the system as root.  Just the way it should be.
&lt;/pre&gt;
&lt;pre class=&quot;brush: bash&quot;&gt;
&lt;a href=&quot;http://www.asteriosk.gr/blog/2009/02/20/pty-allocation-request-failed-on-channel-0/&quot; target=&quot;_blank&quot;&gt;Please check out his entire entry for the full solution.&lt;/a&gt; 
&lt;/pre&gt;
&amp;nbsp;
&lt;p&gt;
&amp;nbsp;Thanks again Yak.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;pre class=&quot;brush: bash&quot;&gt;
Edit: tldr;
&lt;/pre&gt;
&lt;pre class=&quot;brush: bash&quot;&gt;
rm -rf /dev/ptmx
mknod /dev/ptmx c 5 2
chmod 666 /dev/ptmx
umount /dev/pts
rm -rf /dev/pts
mkdir /dev/pts
mount /dev/pts
&lt;/pre&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;</description>
   <link>http://www.globaljunkdrawer.com/index.php?op=ViewArticle&amp;articleId=92&amp;blogId=1</link>
      <pubDate>Fri, 23 Apr 2010 13:17:33 -0300</pubDate>   
  </item>
    <item>
   <title>Fortune_mod automated Twitter feed</title>
   <description>&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;http://www.globaljunkdrawer.com/plugins/plogeshi/styles/plogeshi.css&quot; /&gt;&lt;p&gt;
I&#039;ve been getting a lot of interest in the automatic Twitters I have
set up.&amp;nbsp; People are curious how I&#039;ve done it and what it is about.&lt;br /&gt;
&lt;em&gt;&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;update:&amp;nbsp; the link to the feed is &lt;a href=&quot;https://twitter.com/fortune_mod&quot; target=&quot;_blank&quot;&gt;http://twitter.com/fortune_mod&lt;/a&gt;&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br /&gt;
Basically, I set up an automatic twitter every half hour, Monday to
Friday between 9am and 5pm.&amp;nbsp; These tweets are from a linux/unix program written by
many people over the years called &lt;a href=&quot;http://en.wikipedia.org/wiki/Fortune_%28Unix%29&quot; target=&quot;_blank&quot; title=&quot;Wikipedia - Fortune Unix&quot;&gt;Fortune&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Fortune is a simple program which pulls random entries from a database
of quotes, sayings, or anything else of trivial importance.&amp;nbsp; I believe the
original intent of the program was to provide a fortune cookie for
users who logged into a computer or other similar activity.&amp;nbsp; Over the
years I have seen it used more as being a generator for tag lines in emails
than anything else.&amp;nbsp; Each time an email is sent, a new fortune is
used as the tag line at the bottom of emails.&amp;nbsp; There are many tutorials
available to get this working on many email clients.&lt;br /&gt;
&lt;br /&gt;
I was looking into the &lt;a href=&quot;http://apiwiki.twitter.com/&quot; target=&quot;_blank&quot; title=&quot;Twitter API&quot;&gt;programmer&#039;s interface that is supplied by the
folks at Twitter&lt;/a&gt; and wanted to set up an automatic twitter.&amp;nbsp; I am using
fortune mainly because it&#039;s readily available.&amp;nbsp; I decided to write a
simple &lt;a href=&quot;http://php.net/&quot; target=&quot;_blank&quot; title=&quot;PHP&quot;&gt;PHP&lt;/a&gt; script that would call fortune, and use the returned text as
the source of a posted tweet.&amp;nbsp; Here is the code:
&lt;/p&gt;
&lt;p&gt;
&lt;br /&gt;
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;
// Auto Twitter feed
$message = shell_exec(&#039;fortune -s -n 140&#039;); // Get a fortune that is less than 140 characters long
$message = urlencode($message); // encode the message to pass to Twitter
$curl_handle = curl_init(); 
curl_setopt($curl_handle, CURLOPT_URL, &#039;&lt;a class=&quot;moz-txt-link-freetext&quot; href=&quot;http://twitter.com/statuses/update.xml&quot;&gt;http://twitter.com/statuses /update.xml&lt;/a&gt;&#039;);
// Set to use the XML interface
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_POST, 1); // POST instead of GET
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, \&quot;source=$source&amp;status=$message\&quot; ) ; 
curl_setopt($curl_handle, CURLOPT_USERPWD, $USER_NAME . &#039;:&#039; . $PASSWORD);
$buffer = curl_exec($curl_handle); // Send the tweet
curl_close($curl_handle); // Clean up
&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;
The next step is to add a &lt;a href=&quot;http://en.wikipedia.org/wiki/Cron&quot;&gt;cron job&lt;/a&gt; which would run the PHP script every half hour.&amp;nbsp; Cron is a program which runs every minute and looks at a table of entries to determine if there are any applications, scripts or processes that should be run.&amp;nbsp; Using Cron, you can make programs run automatically at different times, daily, weekly, monthly or every other day even.&amp;nbsp; For this, I want it to run every half hour only durning business hours.&amp;nbsp; Here is the cron entry:&lt;br /&gt;
&lt;br /&gt;
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;*/&lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;11&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;12&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;13&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;14&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;15&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;17&lt;/span&gt; * * * /usr/bin/php ~/twitter.php&lt;/pre&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
Hope this helps! 
&lt;/p&gt;</description>
   <link>http://www.globaljunkdrawer.com/index.php?op=ViewArticle&amp;articleId=74&amp;blogId=1</link>
      <pubDate>Wed, 30 Sep 2009 22:38:54 -0300</pubDate>   
  </item>
  </rdf:RDF>

