<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>/proc/sys/net/blog</title>
	
	<link>http://momotonic.com</link>
	<description>rants, tutorials and documents about everything server related</description>
	<lastBuildDate>Tue, 14 Jul 2009 15:55:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/proc/sys/net/blog" /><feedburner:info uri="proc/sys/net/blog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Last.fm Records with Absynthe theme (latest version breaks it)</title>
		<link>http://feedproxy.google.com/~r/proc/sys/net/blog/~3/trGdq2EKuRM/</link>
		<comments>http://momotonic.com/2009/07/14/last-fm-records-with-absynthe-theme-latest-version-breaks-it/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 15:52:22 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[theme fix]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[absynthe theme]]></category>
		<category><![CDATA[broken last.fm plugin]]></category>

		<guid isPermaLink="false">http://momotonic.com/?p=50</guid>
		<description><![CDATA[Hey everyone.
So my Last.fm records plugin that is built-in or implemented with this amazing theme broke after I upgraded it, so I checked and it seems the whole plugin is now using jQuery.  I have had to do some modifications to make it work, I hope this helps.
FIrst, you need to add this in [...]]]></description>
			<content:encoded><![CDATA[<p>Hey everyone.</p>
<p>So my Last.fm records plugin that is built-in or implemented with this amazing theme broke after I upgraded it, so I checked and it seems the whole plugin is now using jQuery.  I have had to do some modifications to make it work, I hope this helps.</p>
<p>FIrst, you need to add this in your <code>wp-content/themes/absynthe/header.php</code> right after <code>&lt;![endif]--></code>.</p>
<p><code>&lt;script type='text/javascript' src='/wp-includes/js/jquery/jquery.js'>&lt;/script></code></p>
<p>After that, you need to edit <code>wp-content/themes/absynthe/footer.php</code> and replace this:</p>
<p><code><?php<br />
	if (function_exists('lastfmrecords_display')) {<br />
		lastfmrecords_display();<br />
	}<br />
?></code></p>
<p>By this:</p>
<p><code>&lt;div id="lastfmrecords">&lt;/div></code></p>
<p>Once you&#8217;ve made those changes, go to Settings > Last.fm Records, make sure that the CSS is disabled else it won&#8217;t look pretty and make sure the placeholder is set to &#8220;lastfmrecords&#8221;.</p>
<p>Enjoy <img src='http://momotonic.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I will let the developer of this theme know so he can fix this too.</p>
<img src="http://feeds.feedburner.com/~r/proc/sys/net/blog/~4/trGdq2EKuRM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://momotonic.com/2009/07/14/last-fm-records-with-absynthe-theme-latest-version-breaks-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://momotonic.com/2009/07/14/last-fm-records-with-absynthe-theme-latest-version-breaks-it/</feedburner:origLink></item>
		<item>
		<title>Small application for disabling mod_security for specific domains on cPanel server</title>
		<link>http://feedproxy.google.com/~r/proc/sys/net/blog/~3/12sk0eIGBHo/</link>
		<comments>http://momotonic.com/2009/07/14/small-application-for-disabling-mod_security-for-specific-domains-on-cpanel-server/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 15:30:29 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[cpanel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mod_security]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[disable mod_security2]]></category>
		<category><![CDATA[problems]]></category>
		<category><![CDATA[small script]]></category>

		<guid isPermaLink="false">http://momotonic.com/?p=46</guid>
		<description><![CDATA[Alright, I&#8217;m lazy so I always make a script/utility for anything and everything. Another fine piece of lazygineering.
This little script disables mod_security on specific domains that you pick, mod_security2 does not allow disabling it from .htaccess and it&#8217;s pretty annoying to do the same work all over and over again, why not make it one [...]]]></description>
			<content:encoded><![CDATA[<p>Alright, I&#8217;m lazy so I always make a script/utility for anything and everything. Another fine piece of lazygineering.</p>
<p>This little script disables mod_security on specific domains that you pick, mod_security2 does not allow disabling it from .htaccess and it&#8217;s pretty annoying to do the same work all over and over again, why not make it one line only. <img src='http://momotonic.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Introducing, disable_modsec &#8212; Enjoy lazy cPanel server admins.</p>
<p><code>#!/usr/bin/perl</p>
<p>use strict;<br />
use lib qw(/usr/local/cpanel);<br />
use Cpanel::AcctUtils::DomainOwner;</p>
<p>if ($ARGV[0])<br />
{<br />
  # Get username<br />
  my $username = Cpanel::AcctUtils::DomainOwner::getdomainowner($ARGV[0]);<br />
  my $domain = $ARGV[0];</p>
<p>  # Create directory for config<br />
  system ('mkdir -p /usr/local/apache/conf/userdata/std/2/'.$username.'/'.$domain);</p>
<p>  # Create config file<br />
  open (CONFIG, ">>/usr/local/apache/conf/userdata/std/2/".$username.'/'.$domain.'/modsec.conf');<br />
  print CONFIG "<IfModule mod_security2.c>\nSecRuleEngine Off\n</IfModule>";<br />
  close CONFIG;</p>
<p>  # Enable vHost includes<br />
  system ('/scripts/ensure_vhost_includes --user='.$username);<br />
} else {<br />
  print("Usage: disable_modsec [domain]\n");<br />
}</code></p>
<img src="http://feeds.feedburner.com/~r/proc/sys/net/blog/~4/12sk0eIGBHo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://momotonic.com/2009/07/14/small-application-for-disabling-mod_security-for-specific-domains-on-cpanel-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://momotonic.com/2009/07/14/small-application-for-disabling-mod_security-for-specific-domains-on-cpanel-server/</feedburner:origLink></item>
		<item>
		<title>Little “makeover” to this blog</title>
		<link>http://feedproxy.google.com/~r/proc/sys/net/blog/~3/VjTFVd7rAHc/</link>
		<comments>http://momotonic.com/2009/07/11/little-makeover-to-this-blog/#comments</comments>
		<pubDate>Sat, 11 Jul 2009 23:43:49 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://momotonic.com/?p=43</guid>
		<description><![CDATA[K2 was getting boring and I have nothing to do on a Saturday evening.
This blog looks much better thanks to the awesome Absynthe theme by Chris Wallace who makes awesome wordpress themes (there&#8217;s some free SEO for you  
Also, he had implemented Last.FM &#038; Twitter integration that&#8217;s very prettttttty.  Thanks!  
]]></description>
			<content:encoded><![CDATA[<p>K2 was getting boring and I have nothing to do on a Saturday evening.</p>
<p>This blog looks much better thanks to the awesome <a href="http://www.chris-wallace.com/2009/01/05/absynthe-wordpress-theme/">Absynthe theme</a> by <a href="http://www.chris-wallace.com">Chris Wallace</a> who makes awesome <a href="http://www.chris-wallace.com/category/wordpress-themes/">wordpress themes</a> (there&#8217;s some free SEO for you <img src='http://momotonic.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Also, he had implemented Last.FM &#038; Twitter integration that&#8217;s very prettttttty.  Thanks! <img src='http://momotonic.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/proc/sys/net/blog/~4/VjTFVd7rAHc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://momotonic.com/2009/07/11/little-makeover-to-this-blog/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://momotonic.com/2009/07/11/little-makeover-to-this-blog/</feedburner:origLink></item>
		<item>
		<title>Useful little bit of code – List all domains on cPanel server</title>
		<link>http://feedproxy.google.com/~r/proc/sys/net/blog/~3/2XEZ4l8fEOY/</link>
		<comments>http://momotonic.com/2009/07/02/useful-little-bit-of-code-list-all-domains-on-cpanel-server/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 14:33:07 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[cpanel]]></category>

		<guid isPermaLink="false">http://momotonic.com/?p=41</guid>
		<description><![CDATA[Need to list all domains on the server (no subdomains, etc)?
Here&#8217;s the magical code:
cat /etc/userdomains &#124; awk -F ':' '{ print $1 }' &#124; sed 's/.*\.\(.*\.\)/\1/' &#124; sort -u
]]></description>
			<content:encoded><![CDATA[<p>Need to list all domains on the server (no subdomains, etc)?</p>
<p>Here&#8217;s the magical code:</p>
<p><code>cat /etc/userdomains | awk -F ':' '{ print $1 }' | sed 's/.*\.\(.*\.\)/\1/' | sort -u</code></p>
<img src="http://feeds.feedburner.com/~r/proc/sys/net/blog/~4/2XEZ4l8fEOY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://momotonic.com/2009/07/02/useful-little-bit-of-code-list-all-domains-on-cpanel-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://momotonic.com/2009/07/02/useful-little-bit-of-code-list-all-domains-on-cpanel-server/</feedburner:origLink></item>
		<item>
		<title>Citrix XenServer + VLAN Trunking setup (Cisco switch)</title>
		<link>http://feedproxy.google.com/~r/proc/sys/net/blog/~3/oB_Ey5UcMS8/</link>
		<comments>http://momotonic.com/2009/06/23/citrix-xenserver-vlan-trunking-setup-cisco-switch/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 18:41:55 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[citrix]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[vlan]]></category>
		<category><![CDATA[xen]]></category>
		<category><![CDATA[xenserver]]></category>
		<category><![CDATA[trunking]]></category>

		<guid isPermaLink="false">http://momotonic.com/?p=35</guid>
		<description><![CDATA[I have been involved with recent Citrix virtualization setups with our company and I have not see any clear tutorials on how to work with VLAN trunking and Citrix XenServer.  The advantage of using this is being able to use VLANs to separate your network but at the same time being able to do [...]]]></description>
			<content:encoded><![CDATA[<p>I have been involved with recent Citrix virtualization setups with our company and I have not see any clear tutorials on how to work with VLAN trunking and Citrix XenServer.  The advantage of using this is being able to use VLANs to separate your network but at the same time being able to do live migrations without losing connectivity.  These articles will be separated in a couple of parts, this part is mainly focused on setting up the trunking on the switch itself.  The trunking allows the XenServer to have, <em>technically</em>, presence on every VLAN, therefore when migrating servers, the internet connection does not stop working because the VLAN on the target server is different.  Hope it&#8217;s clear.</p>
<p>First of all, telnet to your switch, these instructions are for Cisco switches, that&#8217;s all I ever worked with anyways, heh.  All those instructions use IOS.</p>
<p>First of all you need to pick the port that you&#8217;ll be working on, make sure you have physical access to the server you&#8217;re going to be working with, I&#8217;m not responsible for some settings going poof and you having to drive down to your data center to fix the issue. <img src='http://momotonic.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>So, the interface that I will be working with is <code>FastEthernet1/8</code> &#8212; Enter configuration mode and go to the port</p>
<p><code>conf t<br />
int FastEthernet1/8</code></p>
<p>Enable trunking and 801q capsulation</p>
<p><code>switchport mode trunk<br />
switchport trunk encapsulation dot1Q<br />
switchport trunk native vlan 1000</code></p>
<p>Make sure the native VLAN is the same VLAN that the network was running on previously, read more information why here:</p>
<blockquote><p>To establish 802.1q trunking both sides must be in the same native VLAN this is because the encapsulation is not setup yet and the 2 switches must talk over an un-encapsulated link (native VLAN) to setup the encapsulation in the first place. Why this works is because neither side is encapsulating packets with its VLAN tag since they are both talking over their native VLAN, basicly neither side knows that the other side is in a different VLAN to begin with and they are just sending unencapsulated packets back and forth. So if you set a port on the core switch as native vlan 5 for example and connected a dumb switch to it vlan 5 traffic would go un encapsulated to the dumb switch and it can understand it but it will put it in its VLAN 1 ports there is no actual trunking going on. No 802.1q or ISL!<br />
<a href="http://forums.devshed.com/showpost.php?p=1613306&#038;postcount=2">juniperr @ DevShed</a></p></blockquote>
<img src="http://feeds.feedburner.com/~r/proc/sys/net/blog/~4/oB_Ey5UcMS8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://momotonic.com/2009/06/23/citrix-xenserver-vlan-trunking-setup-cisco-switch/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://momotonic.com/2009/06/23/citrix-xenserver-vlan-trunking-setup-cisco-switch/</feedburner:origLink></item>
		<item>
		<title>cPanel humor: Uninstalling cPanel</title>
		<link>http://feedproxy.google.com/~r/proc/sys/net/blog/~3/vgLn3E_LFqs/</link>
		<comments>http://momotonic.com/2009/06/20/cpanel-humor-uninstalling-cpanel/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 17:16:13 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[cpanel]]></category>
		<category><![CDATA[funny]]></category>
		<category><![CDATA[humor]]></category>

		<guid isPermaLink="false">http://momotonic.com/?p=33</guid>
		<description><![CDATA[It&#8217;s always been known that once you install cPanel, you cannot uninstall it, the only way to get rid of it reinstall the server completely.  However, I was doing some work on a server and ran into this file:
/usr/local/cpanel/uninstall
And the content:
#!/bin/sh
# Uninstall script for Cpanel
rm -f "/usr/local/cpanel/uninstall"
#### END OF UNINSTALL
echo "Cpanel has been uninstalled."
Nice [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s always been known that once you install cPanel, you cannot uninstall it, the only way to get rid of it reinstall the server completely.  However, I was doing some work on a server and ran into this file:</p>
<p><code>/usr/local/cpanel/uninstall</code></p>
<p>And the content:<br />
<code>#!/bin/sh<br />
# Uninstall script for Cpanel<br />
rm -f "/usr/local/cpanel/uninstall"<br />
#### END OF UNINSTALL<br />
echo "Cpanel has been uninstalled."</code></p>
<p>Nice to know that developers still have a sense of humor.  cPanel&#8217;s developers are always known to be down to earth guys and I can assure you that&#8217;s true! (not if that little bit of code in a production program didn&#8217;t prove it! <img src='http://momotonic.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> )</p>
<img src="http://feeds.feedburner.com/~r/proc/sys/net/blog/~4/vgLn3E_LFqs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://momotonic.com/2009/06/20/cpanel-humor-uninstalling-cpanel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://momotonic.com/2009/06/20/cpanel-humor-uninstalling-cpanel/</feedburner:origLink></item>
		<item>
		<title>HyperVM login error: not_in_list_of_allowed_ip</title>
		<link>http://feedproxy.google.com/~r/proc/sys/net/blog/~3/5yLCp8L8YZQ/</link>
		<comments>http://momotonic.com/2009/02/10/hypervm-login-error-not_in_list_of_allowed_ip/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 23:08:44 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[hypervm]]></category>
		<category><![CDATA[hypervm problem]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[not_in_list_of_allowed_Ip]]></category>
		<category><![CDATA[xen]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[easy fix]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://momotonic.com/?p=31</guid>
		<description><![CDATA[We had a client who was not able to login to his HyperVM control panel to make modifications to his virtual private server, the error he was getting was the following:
Alert: not_in_list_of_allowed_ip [xx.xx.xx.xx]
The IP of the client is located at the &#8220;xx.xx.xx.xx&#8221; part, this is easily fixed by clearing the block list on the server [...]]]></description>
			<content:encoded><![CDATA[<p>We had a client who was not able to login to his HyperVM control panel to make modifications to his virtual private server, the error he was getting was the following:</p>
<blockquote><p>Alert: not_in_list_of_allowed_ip [xx.xx.xx.xx]</p></blockquote>
<p>The IP of the client is located at the &#8220;xx.xx.xx.xx&#8221; part, this is easily fixed by clearing the block list on the server with this command (on the main node), you must replace the user.vm part by the username of the client at HyperVM (most of the time, something.vm).</p>
<p><code>/script/clearallowedblockedip --class=client --name=user.vm</code></p>
<p>It should return something like the following:</p>
<p><code>AllowedIp Sucessfully cleared for client:user.vm</code></p>
<p>Afterwards, the client/you should be able to login with no problem at all.</p>
<img src="http://feeds.feedburner.com/~r/proc/sys/net/blog/~4/5yLCp8L8YZQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://momotonic.com/2009/02/10/hypervm-login-error-not_in_list_of_allowed_ip/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://momotonic.com/2009/02/10/hypervm-login-error-not_in_list_of_allowed_ip/</feedburner:origLink></item>
		<item>
		<title>Horde broken or not working correctly on cPanel server</title>
		<link>http://feedproxy.google.com/~r/proc/sys/net/blog/~3/EIr90rNUwmU/</link>
		<comments>http://momotonic.com/2009/01/05/horde-broken-or-not-working-correctly-on-cpanel-server/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 18:00:44 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[cpanel]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[horde]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[quick fix]]></category>
		<category><![CDATA[problems]]></category>
		<category><![CDATA[short fix]]></category>

		<guid isPermaLink="false">http://momotonic.com/?p=28</guid>
		<description><![CDATA[Simple, short &#038; sweet post, this should easily fix any problems you&#8217;re having
/usr/local/cpanel/bin/update-horde --force
Also, this might be useful to run hourly, I leave this on our servers &#8220;just in case&#8221;.
(mysqlcheck --auto-repair eximstats ; mysqlcheck --auto-repair horde) >/dev/null 2>/dev/null
]]></description>
			<content:encoded><![CDATA[<p>Simple, short &#038; sweet post, this should easily fix any problems you&#8217;re having</p>
<p><code>/usr/local/cpanel/bin/update-horde --force</code></p>
<p>Also, this might be useful to run hourly, I leave this on our servers &#8220;just in case&#8221;.</p>
<p><code>(mysqlcheck --auto-repair eximstats ; mysqlcheck --auto-repair horde) >/dev/null 2>/dev/null</code></p>
<img src="http://feeds.feedburner.com/~r/proc/sys/net/blog/~4/EIr90rNUwmU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://momotonic.com/2009/01/05/horde-broken-or-not-working-correctly-on-cpanel-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://momotonic.com/2009/01/05/horde-broken-or-not-working-correctly-on-cpanel-server/</feedburner:origLink></item>
		<item>
		<title>Migrating cPanel reseller accounts with root WHM access</title>
		<link>http://feedproxy.google.com/~r/proc/sys/net/blog/~3/o5gb1gmuXkU/</link>
		<comments>http://momotonic.com/2008/12/30/migrating-cpanel-reseller-accounts-with-root-whm-access/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 21:36:38 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[backup]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[migrating]]></category>
		<category><![CDATA[migrating reseller account]]></category>
		<category><![CDATA[reseller]]></category>

		<guid isPermaLink="false">http://momotonic.com/?p=23</guid>
		<description><![CDATA[We have a few clients that were WHM resellers and upgraded to VPS with root cPanel, however there is no main easy way to migrate WHM reseller account to a root account under WHM, that&#8217;s where we started playing around and making our own script.  You need root access to the source and final [...]]]></description>
			<content:encoded><![CDATA[<p>We have a few clients that were WHM resellers and upgraded to VPS with root cPanel, however there is no main easy way to migrate WHM reseller account to a root account under WHM, that&#8217;s where we started playing around and making our own script.  You need root access to the source and final server to do this, this looks like the fastest way to do this at the moment.</p>
<p>First of all, we need to get all the accounts and create a backup of their accounts, this is done using a couple of bash lines and parsing the file <code>/etc/trueuserowners</code>.  That file contains every account on the server and the accounts that own it.  This following will go over that file, take out the resellers accounts and back them up one by one.  The best way to make sure no mistake happens is to ensure that <code>/home</code> or <code>/home2</code> or any other <code>/home</code> directories because the <code>/scripts/pkgacct</code> creates them there.  We also use <code>cpuwatch</code> not to create excessive load on the server when creating the backup.  It will stop the process once load averages go higher than 10.</p>
<p><code>for i in `cat /etc/trueuserowners | grep <strong>resellerusername</strong> | awk -F ':' '{ print $1; }'`;<br />
do /usr/local/cpane/bin/cpuwatch 10 /scripts/pkgacct $i;<br />
done;</code></p>
<p>Usually this takes a while so this is what you can do if it&#8217;s halfway done to save time</p>
<p><code>/usr/bin/rsync --delete -avvxHt --progress -e ssh /home/cpmove-* 1.2.3.4:~</code></p>
<p>This will start moving the files from the old server to the new one, we use <code>rsync</code> so that we can just run it again after the full backup is done so we don&#8217;t have to restart the whole process again.  Once it&#8217;s done and all data has been moved, another loop, I did this one quickly however I think it could be cleaner, if someone has a better way to do with (regexp?), please let me know.</p>
<p><code>for i in `ls | grep cpmove- | awk -F '.' '{ print $1 }' | awk -F '-' '{ print $2 }'`;<br />
do /scripts/restorepkg $i;<br />
done;</code></p>
<p>After finishing that, you should be all done!</p>
<img src="http://feeds.feedburner.com/~r/proc/sys/net/blog/~4/o5gb1gmuXkU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://momotonic.com/2008/12/30/migrating-cpanel-reseller-accounts-with-root-whm-access/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://momotonic.com/2008/12/30/migrating-cpanel-reseller-accounts-with-root-whm-access/</feedburner:origLink></item>
		<item>
		<title>/tmp clean-up script modification, sessions dying with PHP</title>
		<link>http://feedproxy.google.com/~r/proc/sys/net/blog/~3/C2OFxVgKD6c/</link>
		<comments>http://momotonic.com/2008/11/28/tmp-clean-up-script-modification-sessions-dying-with-php/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 13:11:18 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[cpanel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql.sock]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tmp]]></category>
		<category><![CDATA[cleanup]]></category>
		<category><![CDATA[errors]]></category>
		<category><![CDATA[session]]></category>
		<category><![CDATA[timeout]]></category>
		<category><![CDATA[tmpcleanup]]></category>

		<guid isPermaLink="false">http://momotonic.com/?p=19</guid>
		<description><![CDATA[It seems there there was a little flaw in the script that I wrote a while ago, any PHP sessions on the server will timeout/die after 1 hour if you run that as an hourly cronjob, I have made a small modification to the script.
The only small modification is that now, it deletes all sess_* [...]]]></description>
			<content:encoded><![CDATA[<p>It seems there there was a little flaw in the script that I wrote a while ago, any PHP sessions on the server will timeout/die after 1 hour if you run that as an hourly cronjob, I have made a small modification to the script.</p>
<p>The only small modification is that now, it deletes all <code>sess_*</code> files that have not been accessed for 5 days therefore are probably just sitting there and never going to be used again, the rest remain deleted because it&#8217;s failed uploads/etc that will never be used again.</p>
<p><code><br />
#!/bin/bash</p>
<p># Change directory to /tmp<br />
cd /tmp</p>
<p># Clean up trash left by Gallery2<br />
ls | grep '[0-9].inc*' | xargs rm -fv</p>
<p># Clean up PHP temp. session files<br />
find /tmp -atime +5 -name 'sess_*' -print | xargs rm -fv</p>
<p># Clean up dead vBulletin uploads<br />
ls | grep 'vbupload*' | xargs rm -fv</p>
<p># Clean up failed php uploads<br />
ls | grep 'php*' | xargs rm -fv</p>
<p># Clean up failed ImageMagick conversions.<br />
ls | grep 'magick*' | xargs rm -fv<br />
</code></p>
<p>Thanks!</p>
<img src="http://feeds.feedburner.com/~r/proc/sys/net/blog/~4/C2OFxVgKD6c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://momotonic.com/2008/11/28/tmp-clean-up-script-modification-sessions-dying-with-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://momotonic.com/2008/11/28/tmp-clean-up-script-modification-sessions-dying-with-php/</feedburner:origLink></item>
	</channel>
</rss>
