<?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>Skillett.com &#187; Linux</title>
	<atom:link href="http://www.skillett.com/category/technology/computers/software/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.skillett.com</link>
	<description>Keiron&#039;s daily take on life, the internet and the world around us!</description>
	<lastBuildDate>Thu, 12 Aug 2010 12:10:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
<image>
  <link>http://www.skillett.com</link>
  <url>http://www.skillett.com//images/favicon.ico</url>
  <title>Skillett.com</title>
</image>
		<item>
		<title>Tethering Android Droid/Milestone without Root!</title>
		<link>http://www.skillett.com/technology/mobile-phones/tethering-android-droid-milestone-without-root/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=tethering-android-droid-milestone-without-root</link>
		<comments>http://www.skillett.com/technology/mobile-phones/tethering-android-droid-milestone-without-root/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 16:15:08 +0000</pubDate>
		<dc:creator>Keiron</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mobile Phones]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[droid]]></category>
		<category><![CDATA[milestone]]></category>
		<category><![CDATA[non-root]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[tethering]]></category>
		<category><![CDATA[usb modem]]></category>

		<guid isPermaLink="false">http://www.skillett.com/?p=1289</guid>
		<description><![CDATA[Two posts on the same day and both techie &#8211; don&#8217;t be put off, normal ranty service may well be resumed soon&#8230; I&#8217;ve used my Windows Mobile in the past as a tethered modem for me eee pc when out and about without WiFi or o2 mobile broadband, it&#8217;s not always been easy but has [...]]]></description>
			<content:encoded><![CDATA[<p>Two posts on the same day and both techie &#8211; don&#8217;t be put off, normal ranty service may well be resumed soon&#8230;</p>
<p>I&#8217;ve used my Windows Mobile in the past as a tethered modem for me eee pc when out and about without WiFi or <a href="http://www.o2.co.uk/broadband/mobile/">o2 mobile broadband</a>, it&#8217;s not always been easy but has been handy to have around!</p>
<p>I reinstalled my eee today, and was looking around for how I&#8217;m going to achieve this same functionality with the Milestone on Android, almost everything screamed &#8220;root your device&#8221; at me. I&#8217;m not a fan of rooting it for a lot of reasons the biggest being I don&#8217;t want to brick the device &#8211; so that&#8217;s a non-starter.</p>
<p>Then I spotted a handy guide from linux magazine on <a href="http://www.linux-magazine.com/Online/Blogs/Productivity-Sauce-Dmitri-s-open-source-blend-of-productive-computing/Tether-an-Android-Phone-Using-Proxoid">Tethering Android</a>, it didn&#8217;t work straight off which was a little disappointing. So a little more digging on the Android forums, produced some <a href="http://www.linux-magazine.com/Online/Blogs/Productivity-Sauce-Dmitri-s-open-source-blend-of-productive-computing/Tether-an-Android-Phone-Using-Proxoid">additional instructions</a>. I&#8217;m producing them here for my own benefit as well as yours &#8211; as I&#8217;m bound to forget.</p>
<ol>
<li>Install &#8220;Proxoid&#8221; app from Marketplace.<br/><br/></li>
<li>Turn on USB debugging mode on your phone:<br/><br />
<strong>Settings &#8211; &gt; Application -&gt; Development -&gt; Enable USB Debugging</strong><br/><br/></li>
<li>On your Ubuntu machine create a 90-android.rules file:<br/><br />
<code>gksudo gedit /etc/udev/rules.d/90-android.rules</code><br/><br/></li>
<li>Add the following to it (note this is the difference from the linux magazine tutorial):<br/><br />
<code><br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct} =="0c01", MODE="0666", OWNER="<em>*insertyourusername</em>"<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct} =="0c02", MODE="0666", OWNER="<em>*insertyourusername</em>"<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="22b8", ATTRS{idProduct} =="41db", MODE="0666", OWNER="<em>*insertyourusername</em>"<br />
</code><br />
* insert your username as appropriate!<br/><br/>
</li>
<li>Download and unpack the latest release of the Android SDK: <a href="http://developer.android.com/sdk/">http://developer.android.com/sdk/</a><br/><br/></li>
<li>Connect the phone to the Ubuntu machine with your USB cable and start Proxoid on the phone.<br/><br/></li>
<li>Open a Terminal, navigate to the tools directory in the Android SDK folder and run the following command:<br/><code> ./adb forward tcp:8080 tcp:8080</code><br/><br/></li>
</ol>
<p>The proxy server should now be running, but to be able to use it with Firefox, you have to modify the browser&#8217;s proxy settings:</p>
<ol>
<li>In Firefox, choose Edit -&gt; Preferences and switch to the Advanced -&gt; Network section.<br/><br/></li>
<li>Press the Settings button in the Configure how Firefox connects to the Internet group.<br/><br/></li>
<li>Select the Manual proxy configuration option, then enter localhost in the HTTP Proxy field and 8080 in the Port field. Press OK to save the settings and close the window.<br/><br/></li>
</ol>
<p>Now you can browse the Web using the created connection.</p>
<p>Given that I&#8217;ll need to remember how to do this, when I don&#8217;t have a connection. Here&#8217;s a handy PDF with the above <a href="http://www.skillett.com/wp-content/uploads/2010/03/Skillett.com-–-Guide-to-Tethering-Android.pdf">guide to tethering android</a> to put on your android device!!</p>
<h3>Related Posts</h3><ul class="related_post"><li><a href="http://www.skillett.com/general/quick-posts/50-android-games/" title="50 Android Games!">50 Android Games!</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.skillett.com/technology/mobile-phones/tethering-android-droid-milestone-without-root/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Neomail and mbox -&gt; maildir</title>
		<link>http://www.skillett.com/technology/computers/software/linux/neomail-and-mbox-maildir/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=neomail-and-mbox-maildir</link>
		<comments>http://www.skillett.com/technology/computers/software/linux/neomail-and-mbox-maildir/#comments</comments>
		<pubDate>Tue, 09 Oct 2007 14:24:52 +0000</pubDate>
		<dc:creator>Keiron</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[mbox-maildir]]></category>
		<category><![CDATA[neomail]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://www.skillett.com/index.php/471/neomail-and-mbox-maildir</guid>
		<description><![CDATA[As far as webmail goes, I&#8217;m a Neomail user, have been for a long while. I don&#8217;t know what it is about it &#8211; it&#8217;s clean interface and quick loading speed maybe? But the time has come for change as cPanel are deprecating the mbox format, why I hear you ask? Reasons for Deprecating mbox [...]]]></description>
			<content:encoded><![CDATA[<p>As far as webmail goes, I&#8217;m a Neomail user, have been for a long while. I don&#8217;t know what it is about it &#8211; it&#8217;s clean interface and quick loading speed maybe? But the time has come for change as cPanel are deprecating the mbox format, why I hear you ask?</p>
<p><u><strong>Reasons for Deprecating mbox</strong></u><br />
The new system has several benefits,<br />
- It&#8217;s the way forward<br />
- Better performance<br />
- Improved mailbox locking;<br />
- Simultaneous IMAP account access<br />
- Use of open source code.</p>
<p><u><strong>Is it Necessary?</strong></u><br />
It is expected that cPanel will continue to support mbox, but will switch to maildir as the default soon. As such I feel I&#8217;m probably going to have to take the plunge.</p>
<p>We changed it on one server just recently, a necessary upgrade as part of a fix for another issue &#8211; I had no choice and had to do it with no warning to users of that server, I held my breath &#8211; no onslaught came. One user asked why neomail no longer worked, when I explained they simply agreed it sounded a better solution and would start to use Horde!</p>
<p>I&#8217;m including the remainder of this post, as a reminder to myself of a few things and notes I&#8217;ve found around the web. I had one server upgraded last week and the only issue with it was the one user who had mail set to remain on the server for 7 days &#8211; all of their old email had to be downloaded again.</p>
<p><u><strong>Any Known Problems?<br />
</strong></u>There&#8217;s always going to be problems in an upgrade of this magnitude in my opinion, the biggest reason for this probably being the millions of different configurations of cPanel servers out there. Generally a fix all for almost everyone seems to be to run the following scripts.</p>
<p><em>    /scripts/courierup &#8211;force<br />
/scripts/eximup &#8211;force<br />
</em>(This has solved problems on all but one machine)</p>
<p>One of the notes I also picked up on in the cPanel forums was Outlook Error 0x8004DF0B, this is caused by the default courier imap config:</p>
<p><em>    /usr/lib/courier-imap/etc/imapd<br />
</em><br />
This is because the maximum number of connections from a single IP that courier allows by default is 4. Take a look at the file above and change the line:<br />
<em>MAXPERIP=4<br />
</em>to:<br />
<em>MAXPERIP=20<br />
</em><br />
During the conversion all mail (POP) will be blocked until the process ends.</p>
<p><u><strong>HOWTO Perform the Conversion</strong></u><br />
I&#8217;ve read about one server admin team doing the following:</p>
<p>1.) /scripts/convert2maildir<br />
A.) #1 Backup all mail folders on this server<br />
B.) #3 Start maildir conversion process<br />
2.) /scripts/courierup &#8211;force<br />
3.) /scripts/eximup &#8211;force<br />
4.) /scripts/upcp &#8211;force<br />
5.) /scripts/convert2maildir<br />
A.) #3 to convert partially converted mail accounts</p>
<p><u><strong>Common Complaints<br />
</strong></u></p>
<ul>
<li><strong>Missing Neomail Address Books</strong><br />
In most cases these can be found in:<br />
<em>    /home/&lt;user&gt;/.neomail/user/addressbook</em></p>
<p><em>/scripts/neomail2hordeaddrbook</em><br />
Call it with a user as its argument and it does only that user&#8217;s addresses, call it with no argument it doeal all users serverwide</p>
<p>The mail should also be in Horde or SquirrelMail (the user may need to subscribe to the folders again).</li>
<li><strong>Root Boxes </strong><br />
Users used to be able to login at http://mydomain.com/webmail with user mydom and password xyzzy. They&#8217;d then see the mailboxes for mydom@mydomain.com, as well as a subfolder for the mailbox and folders for their other email addresses such as joe@mydomain.com and sales@mydomain.com.</p>
<p>This will no longer work straightaway &#8211; it was NOT a feature, it was a secuity hole and it&#8217;s gone now. Although it appears that Horde have officially added it as a feature in later builds of cPanel 11 (Simply log into Horde as the main account and in the drop-down box in the upper-right corner of the screen you&#8217;ll see many things, including email addresses of email accounts on the server you can check by simply selecting them from the drop-down).</li>
</ul>
<h3>Related Posts</h3><ul class="related_post"><li><a href="http://www.skillett.com/technology/computers/software/website-scripts/wordpress/coltrane-here-we-come-wordpress-27/" title="Coltrane Here We Come&#8230;. Wordpress 2.7">Coltrane Here We Come&#8230;. Wordpress 2.7</a></li><li><a href="http://www.skillett.com/technology/mobile-phones/impressed-with-orange-for-a-change/" title="Impressed with Orange (for a change)">Impressed with Orange (for a change)</a></li><li><a href="http://www.skillett.com/technology/computers/hardware/asus-eee-pc/" title="Asus EEE PC">Asus EEE PC</a></li><li><a href="http://www.skillett.com/technology/computers/software/website-scripts/wordpress/upgrade-to-wordpress-23-and-tag-support/" title="Upgrade to Wordpress 2.3 and Tag Support">Upgrade to Wordpress 2.3 and Tag Support</a></li><li><a href="http://www.skillett.com/technology/computers/software/linux/mytop-broken/" title="MyTop broken!">MyTop broken!</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.skillett.com/technology/computers/software/linux/neomail-and-mbox-maildir/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MyTop broken!</title>
		<link>http://www.skillett.com/technology/computers/software/linux/mytop-broken/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=mytop-broken</link>
		<comments>http://www.skillett.com/technology/computers/software/linux/mytop-broken/#comments</comments>
		<pubDate>Thu, 05 Jul 2007 17:22:51 +0000</pubDate>
		<dc:creator>Keiron</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.skillett.com/index.php/449/mytop-broken</guid>
		<description><![CDATA[In a post way back in January of 2005, I discussed the software MyTop for monitoring connections on your MySQL server. I&#8217;ve had it installed and use it semi-regularly &#8211; however, it doesn&#8217;t always work &#8211; often I am greeted with the following error: Cannot connect to MySQL server. Please check the: * database you [...]]]></description>
			<content:encoded><![CDATA[<p>In a post way back in January of 2005, I discussed the software <a href="http://www.skillett.com/index.php/181/mytop_a_top_clone_for_mysql" target="_blank">MyT<code></code>op for monitoring connections</a> on your MySQL server. I&#8217;ve had it installed and use it semi-regularly &#8211; however, it doesn&#8217;t always work &#8211; often I am greeted with the following error:</p>
<blockquote><p> Cannot connect to MySQL server. Please check the:</p>
<p>* database you specified “test” (default is “test”)<br />
* username you specified “root” (default is “root”)<br />
* password you specified “” (default is “”)<br />
* hostname you specified “localhost” (default is “localhost”)<br />
* port you specified “3306″ (default is 3306)<br />
* socket you specified “” (default is “”)</p>
<p>The options my be specified on the command-line or in a ~/.mytop<br />
config file. See the manual (perldoc mytop) for details.</p>
<p>Here’s the exact error from DBI. It might help you debug:</p>
<p>Unknown database ‘test’</p></blockquote>
<p>A pain in the butt, as I get it quite regularly and normally get one of the techs to tinker with it&#8230; Here&#8217;s the fix!</p>
<p>Simply enter the following command:</p>
<p><code>echo “db=mysql” &gt; ~/.mytop</code></p>
<h3>Related Posts</h3><ul class="related_post"><li><a href="http://www.skillett.com/technology/computers/hardware/asus-eee-pc/" title="Asus EEE PC">Asus EEE PC</a></li><li><a href="http://www.skillett.com/technology/computers/software/linux/neomail-and-mbox-maildir/" title="Neomail and mbox -> maildir">Neomail and mbox -> maildir</a></li><li><a href="http://www.skillett.com/technology/computers/software/linux/exim-restarting-prm/" title="Exim Restarting &#8211; PRM">Exim Restarting &#8211; PRM</a></li><li><a href="http://www.skillett.com/technology/computers/software/linux/restarting-apachehttpd/" title="Restarting Apache/httpd">Restarting Apache/httpd</a></li><li><a href="http://www.skillett.com/technology/computers/software/linux/are-magic-quotes-on/" title="Are magic quotes on?">Are magic quotes on?</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.skillett.com/technology/computers/software/linux/mytop-broken/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exim Restarting &#8211; PRM</title>
		<link>http://www.skillett.com/technology/computers/software/linux/exim-restarting-prm/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=exim-restarting-prm</link>
		<comments>http://www.skillett.com/technology/computers/software/linux/exim-restarting-prm/#comments</comments>
		<pubDate>Fri, 02 Mar 2007 11:18:36 +0000</pubDate>
		<dc:creator>Keiron</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[exim]]></category>
		<category><![CDATA[PRM]]></category>
		<category><![CDATA[process-status]]></category>

		<guid isPermaLink="false">http://www.skillett.com/index.php/396/exim-restarting-prm/</guid>
		<description><![CDATA[Paragonhost has a very useful post on setting up custom PRM rules (Process Resource Monitor). I think this maybe the cause of so much load on one of my servers recently, as the exim process is getting killed early and not being allowed to finish a queue run &#8211; resulting in a backlog of mail [...]]]></description>
			<content:encoded><![CDATA[<p><a target="_blank" href="http://paragonhost.wordpress.com/2006/10/28/prm-process-resource-monitor-howto-set-rules/">Paragonhost</a> has a very useful post on setting up custom PRM rules (Process Resource Monitor).</p>
<p>I think this maybe the cause of so much load on one of my servers recently, as the exim process is getting killed early and not being allowed to finish a queue run &#8211; resulting in a backlog of mail on the queue and an ever decreasing circle (not good!).</p>
<p>I&#8217;ve made a tweak and will see how it goes!</p>
<h3>Related Posts</h3><ul class="related_post"><li><a href="http://www.skillett.com/technology/computers/hardware/asus-eee-pc/" title="Asus EEE PC">Asus EEE PC</a></li><li><a href="http://www.skillett.com/technology/computers/software/linux/neomail-and-mbox-maildir/" title="Neomail and mbox -> maildir">Neomail and mbox -> maildir</a></li><li><a href="http://www.skillett.com/technology/computers/software/linux/mytop-broken/" title="MyTop broken!">MyTop broken!</a></li><li><a href="http://www.skillett.com/technology/computers/software/linux/restarting-apachehttpd/" title="Restarting Apache/httpd">Restarting Apache/httpd</a></li><li><a href="http://www.skillett.com/technology/computers/software/linux/are-magic-quotes-on/" title="Are magic quotes on?">Are magic quotes on?</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.skillett.com/technology/computers/software/linux/exim-restarting-prm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Restarting Apache/httpd</title>
		<link>http://www.skillett.com/technology/computers/software/linux/restarting-apachehttpd/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=restarting-apachehttpd</link>
		<comments>http://www.skillett.com/technology/computers/software/linux/restarting-apachehttpd/#comments</comments>
		<pubDate>Fri, 02 Mar 2007 11:06:26 +0000</pubDate>
		<dc:creator>Keiron</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[graceful]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[restarting]]></category>
		<category><![CDATA[restarting-apache]]></category>
		<category><![CDATA[SSL]]></category>

		<guid isPermaLink="false">http://www.skillett.com/index.php/395/restarting-apachehttpd/</guid>
		<description><![CDATA[Did a little bit of Apache reading after a client query yesterday, it seems restarting httpd is not all that it seems! start &#8211; start httpd startssl &#8211; start httpd with SSL enabled stop &#8211; stop httpd restart &#8211; restart httpd if running by sending a SIGHUP or start if not running fullstatus &#8211; dump [...]]]></description>
			<content:encoded><![CDATA[<p>Did a little bit of Apache reading after a client query yesterday, it seems restarting httpd is not all that it seems!</p>
<p>start      &#8211; start httpd<br />
startssl   &#8211; start httpd with SSL enabled<br />
stop       &#8211; stop httpd<br />
restart    &#8211; restart httpd if running by sending a SIGHUP or start if<br />
not running<br />
fullstatus &#8211; dump a full status screen; requires lynx and mod_status enabled<br />
status     &#8211; dump a short status screen; requires lynx and mod_status enabled<br />
graceful   &#8211; do a graceful restart by sending a SIGUSR1 or start if not running</p>
<p>Is the normal course of events from apachectl, but what about if we want to restart with SSL?</p>
<p>A route around this as sugeested by someone is to remove all the  stuff in the apache config file, or altertively edit the HTTPD definitiona tthe top of apachectl so that it ALWAYS passes -DSSL), then use normal start/restart/graceful</p>
<p>Now we&#8217;re on the subject of graceful, I have found out that it mean no existing or pendings connections are lost during the restart!</p>
<table>
<tr>
<td><a title="View product details at Amazon" href="http://www.amazon.co.uk/gp/redirect.html%3FASIN=0596002033%26tag=brav20%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/o/ASIN/0596002033%253FSubscriptionId=0EMV44A9A5YT1RVDGZ82"><img alt="Apache: The Definitive Guide" src="http://ec1.images-amazon.com/images/P/0596002033.01._SCTHUMBZZZ_.jpg" /></a></td>
<td><a title="View product details at Amazon" href="http://www.amazon.co.uk/gp/redirect.html%3FASIN=0782143377%26tag=brav20%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/o/ASIN/0782143377%253FSubscriptionId=0EMV44A9A5YT1RVDGZ82"><img alt="Setting Up LAMP: Getting Linux, Apache, MySQL, and PHP Working Together (Transcend Technique)" src="http://ec1.images-amazon.com/images/P/0782143377.02._SCTHUMBZZZ_.jpg" /></a></td>
</tr>
</table>
<h3>Related Posts</h3><ul class="related_post"><li><a href="http://www.skillett.com/technology/computers/hardware/asus-eee-pc/" title="Asus EEE PC">Asus EEE PC</a></li><li><a href="http://www.skillett.com/technology/computers/software/linux/neomail-and-mbox-maildir/" title="Neomail and mbox -> maildir">Neomail and mbox -> maildir</a></li><li><a href="http://www.skillett.com/technology/computers/software/linux/mytop-broken/" title="MyTop broken!">MyTop broken!</a></li><li><a href="http://www.skillett.com/technology/computers/software/linux/exim-restarting-prm/" title="Exim Restarting &#8211; PRM">Exim Restarting &#8211; PRM</a></li><li><a href="http://www.skillett.com/technology/computers/software/linux/are-magic-quotes-on/" title="Are magic quotes on?">Are magic quotes on?</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.skillett.com/technology/computers/software/linux/restarting-apachehttpd/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Are magic quotes on?</title>
		<link>http://www.skillett.com/technology/computers/software/linux/are-magic-quotes-on/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=are-magic-quotes-on</link>
		<comments>http://www.skillett.com/technology/computers/software/linux/are-magic-quotes-on/#comments</comments>
		<pubDate>Wed, 28 Feb 2007 14:47:12 +0000</pubDate>
		<dc:creator>Keiron</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[magic-quotes]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.skillett.com/index.php/394/are-magic-quotes-on/</guid>
		<description><![CDATA[One way to check if magic_quotes is running is to run get_magic_quotes_gpc(). It will return a 1 if it is on, or a 0 if it is off. You can use this result to print out the magic_quotes status, or to decided if you should run another function, such as addslashes. < ?php if (get_magic_quotes_gpc()==1) [...]]]></description>
			<content:encoded><![CDATA[<p>One way to check if magic_quotes is running is to run <strong>get_magic_quotes_gpc()</strong>.  It will return a 1 if it is on, or a 0 if it is off.  You can use this result to print out the magic_quotes status, or to decided if you should run another function, such as addslashes.</p>
<p>< ?php<br />
if (get_magic_quotes_gpc()==1)<br />
{<br />
Print &#8220;Magic Quotes gpc is turned on&#8221; ;<br />
}<br />
else<br />
{<br />
Print &#8220;Magic Quotes gpc is turned off&#8221; ;<br />
}<br />
?></p>
<h3>Related Posts</h3><ul class="related_post"><li><a href="http://www.skillett.com/technology/computers/software/internet-software/email-clients/backup-backup-and-backup/" title="Backup, backup and backup!!">Backup, backup and backup!!</a></li><li><a href="http://www.skillett.com/technology/computers/programming/php/ajax-crawling-with-php-and-curl/" title="Ajax Crawling with PHP and Curl?">Ajax Crawling with PHP and Curl?</a></li><li><a href="http://www.skillett.com/general/automation-making-your-life-easier-600-steps-at-a-time/" title="Automation &#8211; Making your life Easier, 600 steps at a time!">Automation &#8211; Making your life Easier, 600 steps at a time!</a></li><li><a href="http://www.skillett.com/technology/websites/outsourcing-is-it-bad-when-you-have-a-little-knowledge/" title="Outsourcing &#8211; is it bad when you have a little Knowledge?">Outsourcing &#8211; is it bad when you have a little Knowledge?</a></li><li><a href="http://www.skillett.com/technology/computers/hardware/asus-eee-pc/" title="Asus EEE PC">Asus EEE PC</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.skillett.com/technology/computers/software/linux/are-magic-quotes-on/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changing Linux User Passwords</title>
		<link>http://www.skillett.com/technology/computers/software/linux/changing-linux-user-passwords/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=changing-linux-user-passwords</link>
		<comments>http://www.skillett.com/technology/computers/software/linux/changing-linux-user-passwords/#comments</comments>
		<pubDate>Wed, 28 Feb 2007 08:32:46 +0000</pubDate>
		<dc:creator>Keiron</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[user]]></category>

		<guid isPermaLink="false">http://www.skillett.com/index.php/393/changing-linux-user-passwords/</guid>
		<description><![CDATA[I had reason to go looking for this today, having not done it in a long, long time (thanks to the delightful cPanel interface). To change a password on behalf of a user, first sign on or &#8220;su&#8221; to the &#8220;root&#8221; account. Then type, &#8220;passwd user&#8221; (where user is the username for the password you [...]]]></description>
			<content:encoded><![CDATA[<p>I had reason to go looking for this today, having not done it in a long, long time (thanks to the delightful cPanel interface).</p>
<p>To change a password on behalf of a user, first sign on or &#8220;su&#8221; to the &#8220;root&#8221; account. Then type, &#8220;passwd user&#8221; (where user is the username for the password you are changing). The system will prompt you to enter a password. Passwords do not echo to the screen when you enter them.</p>
<p>You can also change your own password, by typing &#8220;passwd&#8221; (without specifying a username). You will be prompted to enter your old password for verification, and then a new password.</p>
<h3>Related Posts</h3><ul class="related_post"><li><a href="http://www.skillett.com/technology/computers/hardware/asus-eee-pc/" title="Asus EEE PC">Asus EEE PC</a></li><li><a href="http://www.skillett.com/technology/computers/software/linux/neomail-and-mbox-maildir/" title="Neomail and mbox -> maildir">Neomail and mbox -> maildir</a></li><li><a href="http://www.skillett.com/technology/computers/software/linux/mytop-broken/" title="MyTop broken!">MyTop broken!</a></li><li><a href="http://www.skillett.com/technology/computers/software/linux/exim-restarting-prm/" title="Exim Restarting &#8211; PRM">Exim Restarting &#8211; PRM</a></li><li><a href="http://www.skillett.com/technology/computers/software/linux/restarting-apachehttpd/" title="Restarting Apache/httpd">Restarting Apache/httpd</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.skillett.com/technology/computers/software/linux/changing-linux-user-passwords/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exim Cheats again!</title>
		<link>http://www.skillett.com/technology/computers/software/linux/exim-cheats-again/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=exim-cheats-again</link>
		<comments>http://www.skillett.com/technology/computers/software/linux/exim-cheats-again/#comments</comments>
		<pubDate>Sat, 23 Sep 2006 12:07:16 +0000</pubDate>
		<dc:creator>Keiron</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.skillett.com/index.php/315/exim-cheats-again/</guid>
		<description><![CDATA[One of my servers was subjected to a SPAM attack again yesterday (via PHP using an insecure php mail() call I suspect). Thankfully the user was tracked down quickly and suspended. Leaving some 10,000 messages on the queue!! Digging out the Exim Cheatsheet that I posted on this blog in December saved my bacon yet [...]]]></description>
			<content:encoded><![CDATA[<p>One of my servers was subjected to a SPAM attack again yesterday (via PHP using an insecure php mail() call I suspect). Thankfully the user was tracked down quickly and suspended. Leaving some 10,000 messages on the queue!!</p>
<p>Digging out the <a href="http://www.skillett.com/index.php/258/hands-on-with-an-exim-cheatsheet/">Exim Cheatsheet</a> that I posted on this blog in December saved my bacon yet again! The argument for turning on PHPSuExec continues!</p>
<h3>Related Posts</h3><ul class="related_post"><li>No Related Post</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.skillett.com/technology/computers/software/linux/exim-cheats-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hands on with an Exim Cheatsheet!</title>
		<link>http://www.skillett.com/technology/computers/software/linux/hands-on-with-an-exim-cheatsheet/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=hands-on-with-an-exim-cheatsheet</link>
		<comments>http://www.skillett.com/technology/computers/software/linux/hands-on-with-an-exim-cheatsheet/#comments</comments>
		<pubDate>Fri, 16 Dec 2005 17:03:07 +0000</pubDate>
		<dc:creator>Keiron</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.skillett.com/?p=258</guid>
		<description><![CDATA[A couple of days ago I had reason to get really hands on, down and dirty with Exim my MTA. The basic problem being that for some absolutely unknown reason a couple of clients messages were stuck on the queue and not able to be delivered to me. They were failing with some reason about [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of days ago I had reason to get really hands on, down and dirty with Exim my MTA.</p>
<p>The basic problem being that for some absolutely unknown reason a couple of clients messages were stuck on the queue and not able to be delivered to me. They were failing with some reason about broken pipes:</p>
<p><code>2005-12-14 10:18:17 &lt;MSG ID&gt; &lt;someone@email.com&gt;: virtual_sa_userdelivery transport output: An error was detected while processing a file of BSMTP input.<br />
2005-12-14 10:18:17 &lt;MSG ID&gt; == &lt;someone@email.com&gt; R=virtual_sa_user T=virtual_sa_userdelivery defer (0): transport filter timeout while writing to pipe<br />
</code></p>
<p>Try as I might I couldn&#8217;t get them off the queue &#8211; later whilst trying to uninstall clamav/Mailscanner (which seemed to be the problem) a reboot of the server was done and they all popped through!!!</p>
<p>However, all of this did cause me to start messing with Exim and find all of the following useful commands and info(courtesy of <a href="http://bradthemad.org/tech/notes/exim_cheatsheet.php" target="_blank">BradTheMad.org</a> and <a href="http://kb.atmail.com/view_article.php?num=344" target="_blank">Ben Duncan&#8217;s Article</a>):</p>
<table border="0" align="center">
<tbody>
<tr>
<td><a href="http://www.amazon.co.uk/gp/product/0954452909?ie=UTF8&amp;tag=skillett-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0954452909" target="_new"><img class="aligncenter size-full wp-image-855" title="The Exim SMTP Mail Server" src="http://www.skillett.com/wp-content/uploads/2006/09/The-Exim-SMTP-Mail-Server.jpg" alt="The Exim SMTP Mail Server" width="121" height="160" /></a></td>
<td style="text-align: center;"><a href="http://www.amazon.co.uk/gp/product/0596000987?ie=UTF8&amp;tag=brav20&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0596000987" target="_new"><img class="aligncenter size-full wp-image-857" title="Exim: The Mail Transfer Agent" src="http://www.skillett.com/wp-content/uploads/2006/09/The-Exim-SMTP-Mail-Server21.jpg" alt="Exim: The Mail Transfer Agent" width="121" height="160" /></a></td>
</tr>
<tr>
<td><a href="http://www.amazon.co.uk/gp/product/0954452976?ie=UTF8&amp;tag=brav20&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0954452976">The Exim SMTP Mail Server: Official Guide for Release 4</a><img class=" hdkmqhrqhprbloqwdjdi hdkmqhrqhprbloqwdjdi hdkmqhrqhprbloqwdjdi hdkmqhrqhprbloqwdjdi" style="border: none !important; margin: 0px !important;" src="http://www.assoc-amazon.co.uk/e/ir?t=brav20&amp;l=as2&amp;o=2&amp;a=0954452976" border="0" alt="" width="1" height="1" /></td>
<td><a href="http://www.amazon.co.uk/gp/product/0596000987?ie=UTF8&amp;tag=brav20&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0596000987">Exim: The Mail Transfer Agent: The Mail Transport Agent</a><img class=" hdkmqhrqhprbloqwdjdi hdkmqhrqhprbloqwdjdi hdkmqhrqhprbloqwdjdi hdkmqhrqhprbloqwdjdi" style="border: none !important; margin: 0px !important;" src="http://www.assoc-amazon.co.uk/e/ir?t=brav20&amp;l=as2&amp;o=2&amp;a=0596000987" border="0" alt="" width="1" height="1" /></td>
</tr>
</tbody>
</table>
<h2>Notes</h2>
<p><strong>msg id&#8217;s and spool</strong><br />
The message-IDs are of the form: XXXXXX-YYYYYY-ZZ. Commands use these message-ids.</p>
<p>There are three files for each message in the spool directory (make sure you get all of the little sods if you&#8217;re messing with these files by hand).</p>
<p>logging information for each message is stored here:<br />
/var/spool/exim/msglog</p>
<p>Files in /var/spool/exim/input are named after the message-id, plus a suffix denoting whether it is the envelope header (-H) or message data (-D).</p>
<p>Don&#8217;t expect everything to always appear directly in the top /var/spool/exim/input or /var/spool/exim/msglog directories; any searches or greps will need to be recursive.</p>
<p>WARNING:See if there is a proper way to do what you&#8217;re doing before working directly on the spool files.</p>
<h2>Queue information</h2>
<p>Number of messages in the queue:<br />
<code>root@localhost# exim -bpc</code></p>
<p>Print a listing of the messages in the queue (time queued, size, message-id, sender, recipient):<br />
<code>root@localhost# exim -bp</code></p>
<p>Print a summary of messages in the queue (count, volume, oldest, newest, domain, and totals):<br />
<code>root@localhost# exim -bp | exiqsumm</code></p>
<p>Generate and display Exim stats from a logfile:<br />
<code>root@localhost# eximstats /path/to/exim_mainlog</code></p>
<p>Same as above, with less verbose output:<br />
<code>root@localhost# eximstats -ne -nr -nt /path/to/exim_mainlog</code></p>
<p>Same as above, for one particular day:<br />
<code>root@localhost# fgrep YYYY-MM-DD /path/to/exim_mainlog | eximstats</code></p>
<p>Print what Exim is doing right now:<br />
<code>root@localhost# exiwhat</code></p>
<p>Search the queue for messages from a specific sender:<br />
<code>root@localhost# exiqgrep -f [luser]@domain</code></p>
<p>Search the queue for messages for a specific recipient/domain:<br />
<code>root@localhost# exiqgrep -r [luser]@domain</code></p>
<p>Print just the message-id as a result of one of the above two searches:<br />
<code>root@localhost# exiqgrep -i [ -r | -f ] ...</code></p>
<p>Print just the message-id of the entire queue:<br />
<code>root@localhost# exiqgrep -i</code></p>
<h2>Managing the queue</h2>
<p>Start a queue run:<br />
<code>root@localhost# exim -q -v</code></p>
<p>Start a queue run for just local deliveries:<br />
<code>root@localhost# exim -ql -v</code></p>
<p>Remove a message from the queue:<br />
<code>root@localhost# exim -Mrm  [  ... ]</code></p>
<p>Freeze a message:<br />
<code>root@localhost# exim -Mf  [  ... ]</code></p>
<p>Thaw a message:<br />
<code>root@localhost# exim -Mt  [  ... ]</code></p>
<p>Deliver a specific message:<br />
<code>root@localhost# exim -M  [  ... ]</code></p>
<p>Force a message to fail and bounce:<br />
<code>root@localhost# exim -Mg  [  ... ]</code></p>
<p>View a message&#8217;s headers:<br />
<code>root@localhost# exim -Mvh </code></p>
<p>View a message&#8217;s body:<br />
<code>root@localhost# exim -Mvb </code></p>
<p>View a message&#8217;s logs:<br />
<code>root@localhost# exim -Mvl </code></p>
<p>Adding a recipient to a message:<br />
<code>root@localhost# exim -Mar message_id email@domain.dom</code><br />
will add email@domain.dom as a recipient of the message and send a copy to that address.</p>
<p>There is no way to actually delete a recipient, but Exim can be told to pretend that delivery for a recipient has been completed. To mark one of the intended recipients as delivered:<br />
<code>root@localhost# exim -Mmd message_id email@domain.dom</code><br />
Will mark the address email@domain.dom as delivered and stop delivery attempts to that address, whereas:<br />
<code>root@localhost# exim -Mmad message_id </code><br />
Will mark all recipients as delivered.</p>
<p>You can also edit the body of the message:<br />
<code>exim -Meb message_id</code><br />
This runs vi on a copy of the spool file with a lock. No delivery attempts are made while the file is locked. There a few caveats on this and you should look up more info on it before you attempt it.</p>
<h2>My Problem</h2>
<p><strong><em>In my case I needed to do something quite drastic using the last few notes above from Ben</em></strong><br />
Because the messages wouldn&#8217;t deliver locally I needed to get them to deliver off somewhere else (in my case &#8211; my gmail account):</p>
<p><code><br />
root@localhost# exim -Mf message_id<br />
<em>(Freeze the message)</em><br />
root@localhost# exim -Mar message_id mygmailaccount@gmail.com<br />
<em>(Add my gmail account as a recipient)</em><br />
root@localhost# exim -Mmd message_id email@localdomain.com<br />
<em>(Mark the local domain as delivered - because we can't actually delete it)</em><br />
root@localhost# exim -Mt message_id<br />
<em>(Thaw the message to run it on the next queue run)<br />
or,</em><br />
root@localhost# exim -M message_id<br />
<em>(Deliver message immediately)</em><br />
</code></p>
<h2>Fix SMTP-Auth for Pine</h2>
<p>If pine can&#8217;t use SMTP authentication on an Exim host and just returns an &#8220;unable to authenticate&#8221; message without even asking for a password, add the following line to exim.conf:</p>
<p>begin authenticators</p>
<p>fixed_plain:<br />
driver = plaintext<br />
public_name = PLAIN<br />
server_condition = &#8220;${perl{checkuserpass}{$1}{$2}{$3}}&#8221;<br />
server_set_id = $2<br />
&gt;  server_prompts = :</p>
<h2>Disable Attachment Blocking</h2>
<p>To disable the executable-attachment blocking that many Cpanel servers do by default but don&#8217;t provide any controls for on a per-domain basis, add the following block to the beginning of the /etc/antivirus.exim file:</p>
<p>if $header_to: matches &#8220;example\.com|example2\.com&#8221;<br />
then<br />
finish<br />
endif</p>
<h2>Bonus!</h2>
<p>To delete all queued messages containing a certain string in the body:<br />
<code>root@localhost# exim -Mrm `grep -lr 'a certain string' /var/spool/exim/input/ | \<br />
sed -e 's/^.*\/\([a-zA-Z0-9-]*\)-[DH]$/\1/g'`</code></p>
<p>If you have to feed many, many message-ids (like more than a thousand) to an exim command, you may exhaust the limit of your shell&#8217;s command line arguments. In that case, use head or tail on a listing of message-ids to run only a limited number of them at once.</p>
<p>For example, if joe@example.com bombed you with 8,000 messages and you want to get rid of them all, remove 1,000 at a time:<br />
<code>root@localhost# exim -Mrm `exiqgrep -i -f '' | head -1000`<br />
root@localhost# !!</code></p>
<p>[...etc., 8 times total...]</p>
<p>Thanks to Brad and Ben who saved my bacon the other day!</p>
<p>If you found this post useful, why not buy me a coffee or a beer (depending on the time of day obviously!):<br />
<form class='donate' method='post' action='https://www.paypal.com/cgi-bin/webscr'>		<input type='hidden' value='2.50' name='amount'/>		<input type='hidden' value='_xclick' name='cmd'/>		<input type='hidden' value='keiron@skillett.com' name='business'/>		<input type='hidden' value='Buy me a beer or a coffee!' name='item_name'/>		<input type='hidden' value='1' name='no_shipping'/>		<input type='hidden' value='http://www.skillett.com' name='return'/>		<input type='hidden' value='http://www.skillett.com' name='cancel_return'/>		<input type='hidden' value='GBP' name='currency_code'/>		<input type='hidden' value='' name='page_style'/>		<input type='hidden' value='0' name='tax'/>		<input type='image' alt='PayPal - The safer, easier way to pay online' name='submit' style='border: 0pt none ;' src='https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif'/></form></p>
<h3>Related Posts</h3><ul class="related_post"><li><a href="http://www.skillett.com/technology/computers/hardware/asus-eee-pc/" title="Asus EEE PC">Asus EEE PC</a></li><li><a href="http://www.skillett.com/technology/computers/software/linux/neomail-and-mbox-maildir/" title="Neomail and mbox -> maildir">Neomail and mbox -> maildir</a></li><li><a href="http://www.skillett.com/technology/computers/software/linux/mytop-broken/" title="MyTop broken!">MyTop broken!</a></li><li><a href="http://www.skillett.com/technology/computers/software/linux/exim-restarting-prm/" title="Exim Restarting &#8211; PRM">Exim Restarting &#8211; PRM</a></li><li><a href="http://www.skillett.com/technology/computers/software/linux/restarting-apachehttpd/" title="Restarting Apache/httpd">Restarting Apache/httpd</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.skillett.com/technology/computers/software/linux/hands-on-with-an-exim-cheatsheet/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux Search and Replace</title>
		<link>http://www.skillett.com/technology/computers/software/linux/linux-search-and-replace/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=linux-search-and-replace</link>
		<comments>http://www.skillett.com/technology/computers/software/linux/linux-search-and-replace/#comments</comments>
		<pubDate>Fri, 16 Dec 2005 16:32:03 +0000</pubDate>
		<dc:creator>Keiron</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.skillett.com/index.php/257/linux-search-and-replace/</guid>
		<description><![CDATA[Sed can be a pain in the butt, so thanks to Shooter.net I&#8217;ve recently been changing files with perl using the following code: perl -pi -e 's/search/replace/g' *.text -p Assumes an input loop around the script. It reads each line of the file and outputs it after processing -i Activates in place editing of files [...]]]></description>
			<content:encoded><![CDATA[<p>Sed can be a pain in the butt, so thanks to <a target="_blank" href="http://www.shooter.net/index.php/weblog/Item/an-easier-way-to-search-and-replace-in-unix-with-perl/">Shooter.net</a> I&#8217;ve recently been changing files with perl using the following code:<br />
<code><br />
perl -pi -e 's/search/replace/g' *.text</p>
<p>-p Assumes an input loop around the script. It reads each line of the file<br />
  and outputs it after processing<br />
-i Activates in place editing of files<br />
-e Indicates a single lines script<br />
's/search/replace/g' is the script or command. In this case it's a search and replace regex<br />
*.text the filename(s) to operate on<br />
</code></p>
<p>Extending this via some digging around I did for searching and replacing recursively through subdirectories, I found this piece of code:<br />
<code><br />
find . -print | egrep "*\.html" | xargs perl -pi -e 's/this/that/g'<br />
</code></p>
<p>This is far cleaner than the old:<br />
<code><br />
for each file in *.text<br />
do<br />
sed 's/search/replace/g' < $file >$file.tempfile<br />
mv $file.tempfile $file<br />
done<br />
</code><br />
(The main limitation with sed being that it is unable to output directly to the file you are working on!)</p>
<h3>Related Posts</h3><ul class="related_post"><li>No Related Post</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.skillett.com/technology/computers/software/linux/linux-search-and-replace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
