<?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>DALLASCAO.COM</title>
	<atom:link href="http://dallascao.com/en/feed/" rel="self" type="application/rss+xml" />
	<link>http://dallascao.com/en</link>
	<description>Site of Dallas Cao, English to Chinese translator</description>
	<lastBuildDate>Mon, 09 Apr 2012 09:52:51 +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>autohotkey multiple line string</title>
		<link>http://dallascao.com/en/autohotkey-multiple-line-string/</link>
		<comments>http://dallascao.com/en/autohotkey-multiple-line-string/#comments</comments>
		<pubDate>Mon, 09 Apr 2012 09:52:24 +0000</pubDate>
		<dc:creator>Dallas</dc:creator>
				<category><![CDATA[Coding Frenzy]]></category>

		<guid isPermaLink="false">http://dallascao.com/en/?p=848</guid>
		<description><![CDATA[t_str = &#40; a test another test &#41; msgbox % t_str Related Posts:VB msgbox always on top&#8220;Exceeds Expecations!&#8221;Autohotkey: Disable the close button [X] of a GUI windowUse regular expressions in .htaccess for redirectionsGoogle Dictionary for Word (GD4Word)Powered by Contextual Related Posts]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="autoit" style="font-family:monospace;">t_str <span style="color: #FF0000; font-weight: bold;">=</span> 
<span style="color: #FF0000; font-weight: bold;">&#40;</span>
a test
another 
test
<span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="color: #000080; font-style: italic; font-weight: bold;">msgbox</span> % t_str</pre></div></div>

<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://dallascao.com/en/vb-msgbox-always-on-top/" rel="bookmark" class="crp_title">VB msgbox always on top</a></li><li><a href="http://dallascao.com/en/exceeds-expecations/" rel="bookmark" class="crp_title">&#8220;Exceeds Expecations!&#8221;</a></li><li><a href="http://dallascao.com/en/autohotkey-disable-the-close-button-x-of-a-gui-window/" rel="bookmark" class="crp_title">Autohotkey: Disable the close button [X] of a GUI window</a></li><li><a href="http://dallascao.com/en/use-regular-expressions-in-htaccess-for-redirections/" rel="bookmark" class="crp_title">Use regular expressions in .htaccess for redirections</a></li><li><a href="http://dallascao.com/en/google-dictionary-for-word-gd4word/" rel="bookmark" class="crp_title">Google Dictionary for Word (GD4Word)</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdallascao.com%2Fen%2Fautohotkey-multiple-line-string%2F&amp;title=autohotkey%20multiple%20line%20string"><img src="/en/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://dallascao.com/en/autohotkey-multiple-line-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: create random password</title>
		<link>http://dallascao.com/en/php-create-random-password/</link>
		<comments>http://dallascao.com/en/php-create-random-password/#comments</comments>
		<pubDate>Wed, 28 Mar 2012 05:04:43 +0000</pubDate>
		<dc:creator>Dallas</dc:creator>
				<category><![CDATA[Coding Frenzy]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://dallascao.com/en/?p=838</guid>
		<description><![CDATA[$str = &#34;0123456789abcdefghijklmnopqrstuvwxyz&#34;; $n = 8; $len = strlen&#40;$str&#41;-1; for&#40;$i=0 ; $i&#60;$n; $i++&#41;&#123; $s .= $str&#91;rand&#40;0,$len&#41;&#93;; &#125; Related Posts:Use cookies to remember the language version users visited last time (php code)Step by step LNMP installation guide for CentoOS serversThe easiest way to build your own VPN serverUse of If field in Microsoft WordCentOS website backup [...]]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;0123456789abcdefghijklmnopqrstuvwxyz&quot;</span><span style="color: #339933;">;</span> 
	<span style="color: #000088;">$n</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">8</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$len</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span> <span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">&lt;</span><span style="color: #000088;">$n</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    	<span style="color: #000088;">$s</span> <span style="color: #339933;">.=</span>  <span style="color: #000088;">$str</span><span style="color: #009900;">&#91;</span><span style="color: #990000;">rand</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #000088;">$len</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>  
	<span style="color: #009900;">&#125;</span></pre></div></div>

<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://dallascao.com/en/use-cookies-to-remember/" rel="bookmark" class="crp_title">Use cookies to remember the language version users visited last time (php code)</a></li><li><a href="http://dallascao.com/en/vps-step-by-step/" rel="bookmark" class="crp_title">Step by step LNMP installation guide for CentoOS servers</a></li><li><a href="http://dallascao.com/en/the-easiest-way-to-build-your-own-vpn-server/" rel="bookmark" class="crp_title">The easiest way to build your own VPN server</a></li><li><a href="http://dallascao.com/en/use-of-if-fields/" rel="bookmark" class="crp_title">Use of If field in Microsoft Word</a></li><li><a href="http://dallascao.com/en/centos-website-backup-shell-scripts/" rel="bookmark" class="crp_title">CentOS website backup shell scripts</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdallascao.com%2Fen%2Fphp-create-random-password%2F&amp;title=PHP%3A%20create%20random%20password"><img src="/en/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://dallascao.com/en/php-create-random-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The easiest way to build your own VPN server</title>
		<link>http://dallascao.com/en/the-easiest-way-to-build-your-own-vpn-server/</link>
		<comments>http://dallascao.com/en/the-easiest-way-to-build-your-own-vpn-server/#comments</comments>
		<pubDate>Tue, 13 Mar 2012 11:25:19 +0000</pubDate>
		<dc:creator>Dallas</dc:creator>
				<category><![CDATA[Coding Frenzy]]></category>
		<category><![CDATA[World Wide Web]]></category>

		<guid isPermaLink="false">http://dallascao.com/en/?p=831</guid>
		<description><![CDATA[Some people suggest that maybe you should try to build your own vpn server yourself! Indeed it&#8217;s not rocket science but still it needs someone to show you the rope. I am not going to be very detailed in each step but you can research them separately. Step one: First get a VPS get a [...]]]></description>
			<content:encoded><![CDATA[<p>Some people suggest that maybe you should try to build your own vpn server yourself! Indeed it&#8217;s not rocket science but still it needs someone to show you the rope. I am not going to be very detailed in each step but you can research them separately.</p>
<p><strong>Step one: First get a VPS</strong></p>
<p>get a Linux VPS. A VPS is shortened for Virtual Private Server. It&#8217;s not a whole machine (too costly!) but one portion of a machine. A 256 Ram VPS is about 60-90 USD a year and that&#8217;s all you have to pay. And if you manage to sell your VPN accounts, you can even make profits!</p>
<p>Recommended provider: <strong>http://www.enzu.com/account/aff.php?aff=184</strong></p>
<p>You need to get a VPS with linux Centos (other systems will work but I only know centOS) installed. After purchasing you will get an IP for your VPS, and a SSH (never mind those terms. Nobody knows what they are) account.</p>
<p>One thing to remember though. You VPS has to be using Xen (again never mind these terms. Just look for Xen VPS) not openVZ. openVZ is a lot cheaper but it won&#8217;t work.</p>
<p><strong>Step two: install PPTP server application on your VPS</strong></p>
<p>Use Putty (software name) to log on to your remote VPS using the IP and SSH account provided. And you get a DOS like black Window with a command line like this:</p>
<p><img src="https://breakwall.net/promo/remote_command_line.png" alt="" /></p>
<p>Type at the command line:</p>
<pre language="bash">wget https://breakwall.net/promo/pptpd.sh</pre>
<p>And press enter<br />
Then type at the command line:</p>
<pre language="bash">bash pptpd.sh </pre>
<p>to run the script.</p>
<p>PPTP server application will be installed on your VPS. At the end of the installation, the script will create an VPN account for you (a username and a password).</p>
<p>That&#8217;s it. You now get your own VPN account on your own server!  Now you can use the username and password and the IP of your server to log on. Of course you will need to do a simple set up on your Windows or iPad or Android phone like with a VPN account you get from a VPN service provider.</p>
<p><strong>Step three: sell your VPN accounts!</strong></p>
<p>I am just kidding. It takes a lot more to run a VPN business. But soon you will want to impress your friends by creating an VPN account on your server for them too! </p>
<p>It&#8217;s easy to add VPN accounts. Just edit a file &#8220;/etc/ppp/chap-secrets&#8221; on your folder. Wait.. how do you do that? You easiest way for people who are unfamiliar with linux is perhaps using FTP!</p>
<p>1. Download and install FileZilla (FTP client software).<br />
2. Click &#8220;site manager&#8221; (the first button on the tool bar) and click add site<br />
For Host field: type your server IP.<br />
For Protocol: choose SFTP<br />
For Login type: choose General<br />
Then input your SSH account (not your VPN account!,the one that you VPS provider gives you) . The user name is usually &#8220;root&#8221;.<br />
3. Click &#8220;Connect&#8221; and then you open your sever.<br />
Go to /etc/ppp/ and then download the file &#8220;chap-secrets&#8221;. Edit that file with notepad and add a line:</p>
<pre language="bash">newaccountname pptpd password *</pre>
<p>4. Save the file and upload to the server to replace the old file.</p>
<p>Last but not least, you need to use you SSH account to log on your server command line using Putty again (like in step two) and then type:</p>
<pre language="bash">
service pptpd restart
</pre>
<p>For your new account to take effect.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://dallascao.com/en/centos-website-backup-shell-scripts/" rel="bookmark" class="crp_title">CentOS website backup shell scripts</a></li><li><a href="http://dallascao.com/en/quick-solution-to-pureftpd-553-error/" rel="bookmark" class="crp_title">Quick solution to Pureftpd 553 error</a></li><li><a href="http://dallascao.com/en/vps-step-by-step/" rel="bookmark" class="crp_title">Step by step LNMP installation guide for CentoOS servers</a></li><li><a href="http://dallascao.com/en/easy-steps-to-correct-the-incorrect-vps-time/" rel="bookmark" class="crp_title">Easy steps to correct the incorrect VPS time</a></li><li><a href="http://dallascao.com/en/windows-mobile-wm-opvenvpn/" rel="bookmark" class="crp_title">Install OpenVPN clients on Windows Mobile (WM) (really works!)</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdallascao.com%2Fen%2Fthe-easiest-way-to-build-your-own-vpn-server%2F&amp;title=The%20easiest%20way%20to%20build%20your%20own%20VPN%20server"><img src="/en/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://dallascao.com/en/the-easiest-way-to-build-your-own-vpn-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install OpenVPN clients on Windows Mobile (WM) (really works!)</title>
		<link>http://dallascao.com/en/windows-mobile-wm-opvenvpn/</link>
		<comments>http://dallascao.com/en/windows-mobile-wm-opvenvpn/#comments</comments>
		<pubDate>Sat, 25 Feb 2012 15:52:32 +0000</pubDate>
		<dc:creator>Dallas</dc:creator>
				<category><![CDATA[World Wide Web]]></category>

		<guid isPermaLink="false">http://dallascao.com/en/?p=827</guid>
		<description><![CDATA[Notice: if you are looking for openVPN solution for Windows mobile (pocket PC), you should definitely check out Breakwall VPN. With it you don&#8217;t need to edit the config files any more. it has a openVPN config file generator for Windows Mobile! Breakwall VPN is probably the only WM-friendly VPN service provider. I tried lots [...]]]></description>
			<content:encoded><![CDATA[<p><font color="blue">Notice: if you are looking for openVPN solution for Windows mobile (pocket PC), you should definitely check out Breakwall VPN. With it you don&#8217;t need to edit the config files any more. it has a <a href="http://breakwall.net/2012/03/best-openvpn-for-china/">openVPN config file generator </a>for Windows Mobile! Breakwall VPN is probably the only WM-friendly VPN service provider.</font></p>
<p>I tried lots of time to find an OpenVPN client for my Windows Mobile phone and this one really works.<br />
1. Download and unzip this file and then transfer the files to your phone:<br />
<a href="http://dallascao.com/cn/wp-content/uploads/2012/02/openvpn.zip">http://dallascao.com/cn/wp-content/uploads/2012/02/openvpn.zip</a><br />
2. Install the software in the following order:<br />
a) ovpnppc.en.ARM.cab b)DaGong OpenVPN_Patch.cab c）Hosts.reg<br />
3 Confirm the installation folder of OpenVPN. Mine is  My Storage\Program Files\OpenVPN\<br />
4 Edit the openVPN configuration files (ending with .ovpn) with a text editor like Notepad++.<br />
5 Add full path to all .crt .key .txt file names inside the configuration files and separate folder names with double back slash \\. And put the file name with path inside quotation marks. For example, change<br />
ca v10.crt to<br />
<code><br />
ca "\\My Storage\\Program Files\\OpenVPN\\Config\\v10.crt"<br />
</code><br />
change key xxx.key to<br />
<code><br />
key "\\My Storage\\Program Files\\OpenVPN\\Config\\xxx.key"<br />
</code></p>
<p>6 delete<br />
<code><br />
#route-delay<br />
route-method exe<br />
</code></p>
<p>7. Copy the edited file to the Config folder of your OpenVPN installation folder in your cell phone.<br />
8. Go back to &#8220;Today&#8221; desktop of your PPC. You will find a small screen icon on the bottom right. Click “utils” and then “setting”. Then you will find two “settings” inside. In the first one, uncheck “Try to ping servers on connect”. In the second &#8220;Settings&#8221; choose your internet connection. Finally Click &#8220;tap&#8221; and then click “tap device 1” and press “start”. You will get a message: “This adapter is already loaded”.<br />
9. Click the little screen icon on the desktop –>Start from Config—>and click a server name.<br />
10. A few seconds later, you will prompted &#8220;LAN discovered&#8221; and click OK. The little screen icon turns green.<br />
11. Now you are connected to your OpenVPN server!</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://dallascao.com/en/the-easiest-way-to-build-your-own-vpn-server/" rel="bookmark" class="crp_title">The easiest way to build your own VPN server</a></li><li><a href="http://dallascao.com/en/vps-step-by-step/" rel="bookmark" class="crp_title">Step by step LNMP installation guide for CentoOS servers</a></li><li><a href="http://dallascao.com/en/quick-solution-to-pureftpd-553-error/" rel="bookmark" class="crp_title">Quick solution to Pureftpd 553 error</a></li><li><a href="http://dallascao.com/en/opening-pdf-files-with-coreldraw/" rel="bookmark" class="crp_title">Opening PDF files with CorelDraw</a></li><li><a href="http://dallascao.com/en/easy-steps-to-correct-the-incorrect-vps-time/" rel="bookmark" class="crp_title">Easy steps to correct the incorrect VPS time</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdallascao.com%2Fen%2Fwindows-mobile-wm-opvenvpn%2F&amp;title=Install%20OpenVPN%20clients%20on%20Windows%20Mobile%20%28WM%29%20%28really%20works%21%29"><img src="/en/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://dallascao.com/en/windows-mobile-wm-opvenvpn/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Easy steps to correct the incorrect VPS time</title>
		<link>http://dallascao.com/en/easy-steps-to-correct-the-incorrect-vps-time/</link>
		<comments>http://dallascao.com/en/easy-steps-to-correct-the-incorrect-vps-time/#comments</comments>
		<pubDate>Fri, 10 Feb 2012 15:52:50 +0000</pubDate>
		<dc:creator>Dallas</dc:creator>
				<category><![CDATA[Coding Frenzy]]></category>
		<category><![CDATA[CentoOS]]></category>
		<category><![CDATA[VPS]]></category>

		<guid isPermaLink="false">http://dallascao.com/en/?p=822</guid>
		<description><![CDATA[When you get a VPS outside your own territory the time-zone is unlikely correct. Not only that, sometimes the VPS clock is just wrong: it can be 10 to 20 minutes faster or slower. You are happy after correcting it, not not too long as the clock will be wrong again after a reboot. This [...]]]></description>
			<content:encoded><![CDATA[<p>When you get a VPS outside your own territory the time-zone is unlikely correct. Not only that, sometimes the VPS clock is just wrong: it can be 10 to 20 minutes faster or slower. You are happy after correcting it, not not too long as the clock will be wrong again after a reboot. This guide is for CentoOS 5.x </p>
<p>Here is a solution: submit a ticket to your provider:-)</p>
<p>I don&#8217;t want to bother those busy guys (almost always men) unless there is no other way. So if you are like me, follow those steps:</p>
<p>Step 1: Edit /etc/sysctl.conf and add this line (if you are using Xen):</p>
<p><code>xen.independent_wallclock=1</code></p>
<p>Step 2: Save the file and exit and then run at the command line</p>
<p><code>sysctl -p</code></p>
<p>Step 3: Set up your local time. Go to the /usr/share/zoneinfo/ (easier on SFTP) and find your correct time zone file. Remember the location and file name (writing it in notepad or on paper). For example, mine is:</p>
<p><code>/usr/share/zoneinfo/Asia/Shanghai</code></p>
<p>Then run the following code at the command line (Replacing /usr/share/zoneinfo/Asia/Shanghai with yours)</p>
<p><code><br />
rm -rf /etc/localtime<br />
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime<br />
yum install -y ntp<br />
ntpdate us.pool.ntp.org<br />
date<br />
</code></p>
<p>Bingo! The time is correct, finally! But don&#8217;t be happy too early. You will still need to do one last step.</p>
<p>Step 4: Edit file /etc/rc.local and add the following line:</p>
<p><code>ntpdate us.pool.ntp.org</code></p>
<p>In this way, your VPS will sync time automatically with us.pool.ntp.org server, not local BIOS.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://dallascao.com/en/centos-website-backup-shell-scripts/" rel="bookmark" class="crp_title">CentOS website backup shell scripts</a></li><li><a href="http://dallascao.com/en/the-easiest-way-to-build-your-own-vpn-server/" rel="bookmark" class="crp_title">The easiest way to build your own VPN server</a></li><li><a href="http://dallascao.com/en/quick-solution-to-pureftpd-553-error/" rel="bookmark" class="crp_title">Quick solution to Pureftpd 553 error</a></li><li><a href="http://dallascao.com/en/vps-step-by-step/" rel="bookmark" class="crp_title">Step by step LNMP installation guide for CentoOS servers</a></li><li><a href="http://dallascao.com/en/windows-mobile-wm-opvenvpn/" rel="bookmark" class="crp_title">Install OpenVPN clients on Windows Mobile (WM) (really works!)</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdallascao.com%2Fen%2Feasy-steps-to-correct-the-incorrect-vps-time%2F&amp;title=Easy%20steps%20to%20correct%20the%20incorrect%20VPS%20time"><img src="/en/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://dallascao.com/en/easy-steps-to-correct-the-incorrect-vps-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CentOS website backup shell scripts</title>
		<link>http://dallascao.com/en/centos-website-backup-shell-scripts/</link>
		<comments>http://dallascao.com/en/centos-website-backup-shell-scripts/#comments</comments>
		<pubDate>Fri, 10 Feb 2012 15:24:11 +0000</pubDate>
		<dc:creator>Dallas</dc:creator>
				<category><![CDATA[Coding Frenzy]]></category>

		<guid isPermaLink="false">http://dallascao.com/en/?p=819</guid>
		<description><![CDATA[It&#8217;s vitally important to backup your website on another machine. If you have a website running on a machines and have a FTP account on another server or even a computer at your home, Follow this step-by-step guide, you will be setting up a reliable automatic regular backup. Step 1: SSH to your VPS console [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s vitally important to backup your website on another machine. If you have a website running on a machines and have a FTP account on another server or even a computer at your home, Follow this step-by-step guide, you will be setting up a reliable automatic regular backup. </p>
<p>Step 1: SSH to your VPS console and install lftp</p>
<p><code>yum install lftp</code></p>
<p>Step 2: Create a folder on your ftp server that will hold the backup files.</p>
<p>Step 3: Edit the following script and unload it to your VPS, for example, /root/backup.sh</p>
<p>You will need to set the values like your root mysql account and ftp account, web folder to backup. </p>
<p><code><br />
#!/bin/bash<br />
#Author: licess<br />
#Website: http://lnmp.org</p>
<p>#IMPORTANT!!!Please Setting the following Values!</p>
<p>######~Set Directory you want to backup~######<br />
#website dir under /home/web<br />
$www_base_dir = /home/web<br />
$local_backup_dir = /home/backup/out</p>
<p>Backup_Dir1=xxx.com</p>
<p>######~Set MySQL UserName and password~######<br />
MYSQL_UserName=root<br />
MYSQL_PassWord=your_root_password</p>
<p>######~Set MySQL Database you want to backup~######</p>
<p>Backup_Database_Name1=_database_to_backup<br />
#Uncomment these if you have more databases to backup<br />
#Backup_Database_Name2=_gt4tcn<br />
#Backup_Database_Name3=_dallascaoen<br />
#Backup_Database_Name4=_dallascaocn</p>
<p>######~Set FTP Information~######<br />
#setup your FTP where you backup your websites to<br />
FTP_HostName1=hostname_or_IP<br />
FTP_UserName1=FTP_username<br />
FTP_PassWord1=FTP_password<br />
#you need to create dir on your ftp first.<br />
FTP_BackupDir1=/backup_dir/</p>
<p>#Values Setting END!</p>
<p>#TodayWWWBackup=www-*-$(date +"%Y%m%d").tar.gz<br />
#* is wildcard.<br />
TodayDBBackup=db-*-$(date +"%Y%m%d").sql<br />
OldWWWBackup=www-*-$(date -d -3day +"%Y%m%d").tar.gz<br />
OldDBBackup=db-*-$(date -d -3day +"%Y%m%d").sql</p>
<p>tar zcf /home/backup/www-$Backup_Dir1-$(date +"%Y%m%d").tar.gz -C $www_dir $Backup_Dir1 --exclude=soft</p>
<p>/usr/local/mysql/bin/mysqldump -u$MYSQL_UserName -p$MYSQL_PassWord $Backup_Database_Name1 > $local_backup_dir/db-$Backup_Database_Name1-$(date +"%Y%m%d").sql<br />
/usr/local/mysql/bin/mysqldump -u$MYSQL_UserName -p$MYSQL_PassWord $Backup_Database_Name2 > $local_backup_dir/db-$Backup_Database_Name2-$(date +"%Y%m%d").sql<br />
/usr/local/mysql/bin/mysqldump -u$MYSQL_UserName -p$MYSQL_PassWord $Backup_Database_Name3 > $local_backup_dir/db-$Backup_Database_Name3-$(date +"%Y%m%d").sql<br />
/usr/local/mysql/bin/mysqldump -u$MYSQL_UserName -p$MYSQL_PassWord $Backup_Database_Name4 > $local_backup_dir/db-$Backup_Database_Name4-$(date +"%Y%m%d").sql</p>
<p>#will delete multiple files db-*-$(date +"%Y%m%d").sql<br />
rm -f $local_backup_dir$OldWWWBackup<br />
rm -f $local_backup_dir$OldDBBackup</p>
<p>cd $local_backup_dir</p>
<p>lftp $FTP_HostName1 -u $FTP_UserName1,$FTP_PassWord1 << EOF<br />
cd $FTP_BackupDir1<br />
mrm $OldDBBackup<br />
mput $TodayDBBackup<br />
bye<br />
EOF<br />
#mput $TodayWWWBackup<br />
</code></p>
<p>4. Test out the script to see if it works as expected. You shall have files like www-xxxx-20120101-tar.gz and db-xxxx-20120101.sql on both your local backup dir and remote ftp backup dir.</p>
<p>Also notice that the script will delete backup files 3 days old. </p>
<p>5. Setup a crontab entry to make this script run automatically everyday.</p>
<p><code>crontab -e</code></p>
<p>Enter:<br />
<code>0 0 * * * bash /root/backup.sh</code></p>
<p>Save the file and exit.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://dallascao.com/en/quick-solution-to-pureftpd-553-error/" rel="bookmark" class="crp_title">Quick solution to Pureftpd 553 error</a></li><li><a href="http://dallascao.com/en/vps-step-by-step/" rel="bookmark" class="crp_title">Step by step LNMP installation guide for CentoOS servers</a></li><li><a href="http://dallascao.com/en/easy-steps-to-correct-the-incorrect-vps-time/" rel="bookmark" class="crp_title">Easy steps to correct the incorrect VPS time</a></li><li><a href="http://dallascao.com/en/the-easiest-way-to-build-your-own-vpn-server/" rel="bookmark" class="crp_title">The easiest way to build your own VPN server</a></li><li><a href="http://dallascao.com/en/change-your-php-and-mysql-timezone/" rel="bookmark" class="crp_title">Change your php and mysql timezone</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdallascao.com%2Fen%2Fcentos-website-backup-shell-scripts%2F&amp;title=CentOS%20website%20backup%20shell%20scripts"><img src="/en/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://dallascao.com/en/centos-website-backup-shell-scripts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quick solution to Pureftpd 553 error</title>
		<link>http://dallascao.com/en/quick-solution-to-pureftpd-553-error/</link>
		<comments>http://dallascao.com/en/quick-solution-to-pureftpd-553-error/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 07:10:21 +0000</pubDate>
		<dc:creator>Dallas</dc:creator>
				<category><![CDATA[Coding Frenzy]]></category>

		<guid isPermaLink="false">http://dallascao.com/en/?p=814</guid>
		<description><![CDATA[After setting up an account with Pureftpd, you are likely to be greeted by an error 553: Pureftpd error 553 Can't open that file: Permission denied It has to do with the user and group permission. Solution: 1. Edit your Pure-ftpd account and set UID and GID to www (or any other). 2. SSH to [...]]]></description>
			<content:encoded><![CDATA[<p>After setting up an account with Pureftpd, you are likely to be greeted by an error 553:</p>
<p><code>Pureftpd error 553 Can't open that file: Permission denied</code></p>
<p>It has to do with the user and group permission. Solution:</p>
<p>1. Edit your Pure-ftpd account and set UID and GID to www (or any other).<br />
2. SSH to root console. and run<br />
<code>chown -R www:www /home/backup</code></p>
<p>Replace &#8220;/home/backup&#8221; with your ftp folder. This command assigns userid www, usergroup www to be the the owner of that folder and all the folder underneath it (R = recursive)</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://dallascao.com/en/centos-website-backup-shell-scripts/" rel="bookmark" class="crp_title">CentOS website backup shell scripts</a></li><li><a href="http://dallascao.com/en/solve-specified-key-was-too-long-max-key-length-is-1000-bytes-error-when-installing-postfixadmin/" rel="bookmark" class="crp_title">Solve &#8220;Specified key was too long; max key length is 1000 bytes&#8221; error when installing postfixadmin</a></li><li><a href="http://dallascao.com/en/the-easiest-way-to-build-your-own-vpn-server/" rel="bookmark" class="crp_title">The easiest way to build your own VPN server</a></li><li><a href="http://dallascao.com/en/vps-step-by-step/" rel="bookmark" class="crp_title">Step by step LNMP installation guide for CentoOS servers</a></li><li><a href="http://dallascao.com/en/windows-mobile-wm-opvenvpn/" rel="bookmark" class="crp_title">Install OpenVPN clients on Windows Mobile (WM) (really works!)</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdallascao.com%2Fen%2Fquick-solution-to-pureftpd-553-error%2F&amp;title=Quick%20solution%20to%20Pureftpd%20553%20error"><img src="/en/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://dallascao.com/en/quick-solution-to-pureftpd-553-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solve &#8220;Specified key was too long; max key length is 1000 bytes&#8221; error when installing postfixadmin</title>
		<link>http://dallascao.com/en/solve-specified-key-was-too-long-max-key-length-is-1000-bytes-error-when-installing-postfixadmin/</link>
		<comments>http://dallascao.com/en/solve-specified-key-was-too-long-max-key-length-is-1000-bytes-error-when-installing-postfixadmin/#comments</comments>
		<pubDate>Tue, 07 Feb 2012 05:27:38 +0000</pubDate>
		<dc:creator>Dallas</dc:creator>
				<category><![CDATA[World Wide Web]]></category>

		<guid isPermaLink="false">http://dallascao.com/en/?p=811</guid>
		<description><![CDATA[Go to the folder where postfixadmin is extracted. Edit &#8220;upgrade.php&#8221; Replace all &#8220;255&#8243; with &#8220;100&#8243; Done! Related Posts:Quick solution to Pureftpd 553 errorStep by step LNMP installation guide for CentoOS serversInstall OpenVPN clients on Windows Mobile (WM) (really works!)Opening PDF files with CorelDrawThe easiest way to build your own VPN serverPowered by Contextual Related Posts]]></description>
			<content:encoded><![CDATA[<p>Go to the folder where postfixadmin is extracted. Edit &#8220;upgrade.php&#8221;</p>
<p>Replace all &#8220;255&#8243; with &#8220;100&#8243;</p>
<p>Done!</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://dallascao.com/en/quick-solution-to-pureftpd-553-error/" rel="bookmark" class="crp_title">Quick solution to Pureftpd 553 error</a></li><li><a href="http://dallascao.com/en/vps-step-by-step/" rel="bookmark" class="crp_title">Step by step LNMP installation guide for CentoOS servers</a></li><li><a href="http://dallascao.com/en/windows-mobile-wm-opvenvpn/" rel="bookmark" class="crp_title">Install OpenVPN clients on Windows Mobile (WM) (really works!)</a></li><li><a href="http://dallascao.com/en/opening-pdf-files-with-coreldraw/" rel="bookmark" class="crp_title">Opening PDF files with CorelDraw</a></li><li><a href="http://dallascao.com/en/the-easiest-way-to-build-your-own-vpn-server/" rel="bookmark" class="crp_title">The easiest way to build your own VPN server</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdallascao.com%2Fen%2Fsolve-specified-key-was-too-long-max-key-length-is-1000-bytes-error-when-installing-postfixadmin%2F&amp;title=Solve%20%26%238220%3BSpecified%20key%20was%20too%20long%3B%20max%20key%20length%20is%201000%20bytes%26%238221%3B%20error%20when%20installing%20postfixadmin"><img src="/en/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://dallascao.com/en/solve-specified-key-was-too-long-max-key-length-is-1000-bytes-error-when-installing-postfixadmin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Step by step LNMP installation guide for CentoOS servers</title>
		<link>http://dallascao.com/en/vps-step-by-step/</link>
		<comments>http://dallascao.com/en/vps-step-by-step/#comments</comments>
		<pubDate>Sun, 05 Feb 2012 14:52:42 +0000</pubDate>
		<dc:creator>Dallas</dc:creator>
				<category><![CDATA[Coding Frenzy]]></category>
		<category><![CDATA[World Wide Web]]></category>
		<category><![CDATA[CentoOS]]></category>
		<category><![CDATA[Dedicated server]]></category>
		<category><![CDATA[LNMP]]></category>
		<category><![CDATA[VPS]]></category>

		<guid isPermaLink="false">http://dallascao.com/en/?p=808</guid>
		<description><![CDATA[Believe me: Installing the LNMP one-key package is the easiest and most time-saving way to set up a production CentoOS server. After installation, your server will installed with Nginx, PHP, MySQL, phpMyAdmin, Zend and ready to serve. LNMP one-key package is a bunch of shell scripts that automate the installation of Nginx, PHP and MySQL [...]]]></description>
			<content:encoded><![CDATA[<p>Believe me: Installing the LNMP one-key package is the easiest and most time-saving way to set up a production CentoOS server. After installation, your server will installed with Nginx, PHP, MySQL, phpMyAdmin, Zend and ready to serve.</p>
<p>LNMP one-key package is a bunch of shell scripts that automate the installation of Nginx, PHP and MySQL server production environment. It&#8217;s written by Licess.<br />
Please follow the steps carefully and leave a comment when in doubt.</p>
<p>To make the narrative easier, let&#8217;s suppose that you have a domain name: www.lovelyoldies.com that points to your server&#8217;s IP 199.180.252.249 . For easier administration, set up a second level domain name admin.lovelyoldies.com and point it to 199.180.252.249 too.</p>
<p>Connect to your VPS console using your root account (using Putty, Tunnelier, etc):</p>
<p>1. Create a temp directory under root if it is not there and go to that directory. This is where you will put the installation files.<br />
<code><br />
mkdir /root/temp<br />
cd /root/temp<br />
</code><br />
2. Download the lnmp package and unpack and then enter the unpacked directory.<br />
<code><br />
 wget -c http://soft.vpser.net/lnmp/lnmp0.8.tar.gz<br />
 tar zxvf lnmp0.8.tar.gz<br />
 cd lnmp0.8/<br />
</code><br />
3. Run the installation<br />
<code><br />
./centos.sh<br />
</code><br />
You will be prompted to enter a domain name. DO NOT enter your domain name that will be used for you site. In our example, enter admin.lovelyoldies.com or the IP address 199.180.252.249.<br />
You will be prompted to enter a password for mysql root user. Enter a password and write it down. You will be using the user name root together with this password to log on to phpmyadmin.<br />
Now, stand up from your computer and chat to your wife or play with your children. It&#8217;s going to take a while. During this time Nginx, PHP, MySQL, phpMyAdmin, Zend will be installed.</p>
<p>After installation finishes, open http://admin.lovelyoldies.com with your web browser. A congratulation page appears (Sorry, it&#8217;s in Chinese). </p>
<p>All done! Bye!!</p>
<p>Wait&#8230; you will say&#8230;<br />
If the congratulation page doesn&#8217;t appear, it means:</p>
<p>If you just set up the DNS record for your domain name, it&#8217;s going to take a while for it to point to the right IP. Of course, you don&#8217;t want to wait. Let&#8217;s make it effective immediately. Skip step four if your domain name is already pointed to the right IP.</p>
<p>4. If you are using Windows, go to C:\Windows\System32\drivers\etc and find the the file named &#8220;hosts&#8221; and open it with notepad. Add<br />
<code><br />
199.180.252.249 lovelyoldies.com<br />
199.180.252.249 www.lovelyoldies.com<br />
199.180.252.249 admin.lovelyoldies.com<br />
</code></p>
<p>5. Now,the PHP and Ngix that has been installed is not the newest version. You may want to update them for security reasons. Run (you are now at /root/temp/lnmp0.8/):</p>
<p><code><br />
./upgrade_nginx.sh<br />
</code><br />
Enter the version number you want to upgrade to when prompted. Go to http://nginx.org/ to find available versions.</p>
<p><code><br />
./upgrade_php.sh<br />
</code><br />
Enter the version number you want to upgrade to when prompted. Go to http://php.net/ to find available versions.</p>
<p>6. Create a folder where you would like to upload your site. In our example, /home/web/lovelyoldies.com/</p>
<p><code><br />
mkdir /home/web/lovelyoldies.com<br />
</code></p>
<p>7. Now we want our domain names to be tied to this folder. run:<br />
<code><br />
/root/vhost.sh<br />
</code><br />
Enter your domain name as prompted: lovelyoldies.com.<br />
Then you are asked:&#8221;do you want to add more domain name?&#8221; Press y<br />
Enter www.lovelyoldies.com  as we want these two domain names to be the same site.<br />
The you will be prompted: &#8220;Enter the directory name for the domain names&#8221; (something like this, you won&#8217;t miss it.)<br />
Enter /home/web/lovelyoldies.com </p>
<p>8. Use your SFTP client (Tunnelier, FileZilla, etc) and upload your website to /home/web/lovelyoldies.com<br />
All done! open http://lovelyoldies.com with your web browser! Bye</p>
<p>Wait&#8230; you will yell:-)</p>
<p>9. If you are installing a new wordpress site, you will need to go to (in our example):<br />

http://admin.lovelyoldies.com/phpmyadmin</p>

<p>Log on using root and your root password (see step 3) for mySQL and create a database and optionally assign a user to that database.</p>
<p>Then run the wordpress installation.</p>
<p>You are likely to meet more issues like setting up SSL, url rewriting&#8230; (if you need these) but I am going stop here. </p>
<p>Bye&#8230;</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://dallascao.com/en/centos-website-backup-shell-scripts/" rel="bookmark" class="crp_title">CentOS website backup shell scripts</a></li><li><a href="http://dallascao.com/en/the-easiest-way-to-build-your-own-vpn-server/" rel="bookmark" class="crp_title">The easiest way to build your own VPN server</a></li><li><a href="http://dallascao.com/en/two-translation-mistakes-in-cpanel/" rel="bookmark" class="crp_title">translation mistakes in cpanel</a></li><li><a href="http://dallascao.com/en/quick-solution-to-pureftpd-553-error/" rel="bookmark" class="crp_title">Quick solution to Pureftpd 553 error</a></li><li><a href="http://dallascao.com/en/change-your-php-and-mysql-timezone/" rel="bookmark" class="crp_title">Change your php and mysql timezone</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdallascao.com%2Fen%2Fvps-step-by-step%2F&amp;title=Step%20by%20step%20LNMP%20installation%20guide%20for%20CentoOS%20servers"><img src="/en/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://dallascao.com/en/vps-step-by-step/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GT4T: a different approach to MT</title>
		<link>http://dallascao.com/en/gt4t-a-different-approach-to-mt/</link>
		<comments>http://dallascao.com/en/gt4t-a-different-approach-to-mt/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 16:07:15 +0000</pubDate>
		<dc:creator>Dallas</dc:creator>
				<category><![CDATA[Coding Frenzy]]></category>
		<category><![CDATA[Translations]]></category>
		<category><![CDATA[GT4T]]></category>

		<guid isPermaLink="false">http://dallascao.com/en/?p=804</guid>
		<description><![CDATA[GT4T takes a rather different approach to MT: The result is often disappointing when sending the whole segment to MT. With GT4T you can select any portion of a sentence. GT4T aims to incorporate MT into the translation process, helping translators with suggestions and reducing keystrokes, rather than using MT as a first draft translator. [...]]]></description>
			<content:encoded><![CDATA[<p>GT4T takes a rather different approach to MT:</p>
<p>The result is often disappointing when sending the whole segment to MT. With GT4T you can select any portion of a sentence. GT4T aims to incorporate MT into the translation process, helping translators with suggestions and reducing keystrokes, rather than using MT as a first draft translator.</p>
<p>Show alternative translations for every syntagm. It&#8217;s exciting as you have many possible translations for each part of a sentence. It works very well when you mind gets stuck or tired.</p>
<p>Show both Google and Bing translations.</p>
<p>A combination of User-defined Glossary and MT. When MT cannot translate a term correctly, you can add it to Glossary and then result is always correct.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://dallascao.com/en/why-gt4t-is-useful-to-you/" rel="bookmark" class="crp_title">Why GT4T is useful to you?</a></li><li><a href="http://dallascao.com/en/language-filter-for-friendfeedcom/" rel="bookmark" class="crp_title">Language filter for friendfeed.com?</a></li><li><a href="http://dallascao.com/en/the-easiest-way-to-build-your-own-vpn-server/" rel="bookmark" class="crp_title">The easiest way to build your own VPN server</a></li><li><a href="http://dallascao.com/en/end-a-process-with-inno-setup/" rel="bookmark" class="crp_title">End a process with Inno setup</a></li><li><a href="http://dallascao.com/en/use-of-if-fields/" rel="bookmark" class="crp_title">Use of If field in Microsoft Word</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdallascao.com%2Fen%2Fgt4t-a-different-approach-to-mt%2F&amp;title=GT4T%3A%20a%20different%20approach%20to%20MT"><img src="/en/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://dallascao.com/en/gt4t-a-different-approach-to-mt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

