<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6564359701042928327</id><updated>2024-10-09T12:30:29.405+08:00</updated><category term="android"/><category term="mysql"/><category term="Ubuntu"/><category term="java"/><category term="C#"/><category term="dialog"/><category term="Preference"/><category term="button"/><category term="django"/><category term="eclipse"/><category term="export"/><category term="import"/><category term="intent"/><category term="jdbc"/><category term="jquery"/><category term="service"/><category term="settings"/><category term="speed up"/><category term="title bar"/><category term="1000"/><category term="4.0"/><category term="421 oops"/><category term="500 oops"/><category term="ADT 22"/><category term="Access denied"/><category term="Add image into TextView"/><category term="CDT"/><category term="CISCO VPN"/><category term="CISCO VPN service"/><category term="Celery"/><category term="CountdownTimer"/><category term="EditText"/><category term="IllegalArgumentException"/><category term="MSN"/><category term="MTP refresh"/><category term="NDK"/><category term="OnTouchOutside"/><category term="RabbitVCS"/><category term="Received an unexpected EOF or 0 bytes from the transport stream."/><category term="S3"/><category term="SVN"/><category term="Singleton"/><category term="Transparent color"/><category term="Unable to instantiate application"/><category term="Unable to resolve superclass"/><category term="VC# express template"/><category term="VMWare"/><category term="ViewPager"/><category term="WebRequest"/><category term="Windows"/><category term="Windows Installer"/><category term="add attribute"/><category term="add tag"/><category term="android build"/><category term="android ics"/><category term="android.app.LoadedApk.makeApplication"/><category term="ant"/><category term="arrayList"/><category term="backup"/><category term="battery"/><category term="benchmark ui"/><category term="cache"/><category term="cancel"/><category term="cast"/><category term="centerHorizontal"/><category term="check airplane mode"/><category term="color"/><category term="create index"/><category term="custom AndroidManifest.xml"/><category term="database"/><category term="datatable"/><category term="decimal point"/><category term="disable"/><category term="disable keyguard"/><category term="dismissDialog"/><category term="dot"/><category term="drawable"/><category term="error"/><category term="fetching always"/><category term="focus"/><category term="form"/><category term="get id after insert"/><category term="get memory usage"/><category term="get network operator"/><category term="get row count"/><category term="grant"/><category term="hadoop"/><category term="hidden"/><category term="hide column"/><category term="hide navigation bar"/><category term="holo theme"/><category term="imagebutton"/><category term="imagespan"/><category term="initial data"/><category term="invitationListener"/><category term="is google market installed"/><category term="java heap"/><category term="java.lang.NullPointerException"/><category term="javascript"/><category term="kill background process"/><category term="language"/><category term="layout"/><category term="linearlayout"/><category term="list"/><category term="listobjects"/><category term="listview background color"/><category term="listview divider"/><category term="localization"/><category term="marquee"/><category term="maximum connection"/><category term="media scan"/><category term="models"/><category term="mtp"/><category term="multiple line"/><category term="mutex"/><category term="mysql_upgrade"/><category term="notepad++"/><category term="object"/><category term="openfire"/><category term="outfile"/><category term="override brightness"/><category term="overscrollmode"/><category term="percent"/><category term="pin"/><category term="process memory"/><category term="proxy"/><category term="quote"/><category term="rabbitmq"/><category term="remote"/><category term="remote desktop"/><category term="restore"/><category term="root"/><category term="running apps"/><category term="safe mode"/><category term="script"/><category term="setCanceledOnTouchOutside"/><category term="setoverscrollfooter"/><category term="single instance"/><category term="smack"/><category term="sqlite"/><category term="string split"/><category term="supervisor"/><category term="tab to space"/><category term="task"/><category term="task bar"/><category term="text"/><category term="thrift"/><category term="timeout"/><category term="top activity"/><category term="total memory"/><category term="ubuntu install nginx"/><category term="uninstall beats audio android"/><category term="used memory"/><category term="view battery usage"/><category term="vobsub"/><category term="vsftp"/><category term="wakelock"/><category term="windows 7"/><title type='text'>Tofu&#39;s Tech</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://tofu0913.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://tofu0913.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12728776235159628761</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>78</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6564359701042928327.post-7137984324555561808</id><published>2014-06-13T17:40:00.000+08:00</published><updated>2014-06-13T17:40:08.419+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="CDT"/><category scheme="http://www.blogger.com/atom/ns#" term="eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="NDK"/><title type='text'>Install Android NDK on Windows</title><content type='html'>1. Download Android NDK
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Download latest version of NDK from http://developer.android.com/tools/sdk/ndk/index.html&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Decompress it and put NDK folder anywhere you want. For my example: D:\SDK\android-ndk-r9d&lt;/li&gt;
&lt;/ul&gt;
2. Install CDT for Eclipse&lt;br /&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;Open Eclipse, Help--&amp;gt;Install New Software&lt;/li&gt;
&lt;li&gt;Press &quot;Add&quot;&lt;/li&gt;
&lt;li&gt;Name: CDT(whatever you want), Location:&amp;nbsp;http://download.eclipse.org/tools/cdt/releases/kepler&lt;/li&gt;
&lt;li&gt;Check &quot;CDT Main features&quot;&lt;/li&gt;
&lt;li&gt;Press Next to install.&lt;/li&gt;
&lt;/ul&gt;
3. Install NDK Plugin for Eclipse&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;Open Eclipse, Help--&amp;gt;Install New Software&lt;/li&gt;
&lt;li&gt;Search for https://dl-ssl.google.com/android/eclipse/ in &quot;Work with&quot;, if you can&#39;t find one, just press &quot;Add&quot; to add it.&lt;/li&gt;
&lt;li&gt;Check &quot;NDK plugins&quot;&lt;/li&gt;
&lt;li&gt;Press Next to install.&lt;/li&gt;
&lt;/ul&gt;
4. Setup NDK&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;Restart Eclipse, if you just complete all steps above.&lt;/li&gt;
&lt;li&gt;Window--&amp;gt;Preferences--&amp;gt;Android--&amp;gt;NDK&lt;/li&gt;
&lt;li&gt;Enter the NDK decompressed path, for my example:&amp;nbsp;D:\SDK\android-ndk-r9d&lt;/li&gt;
&lt;/ul&gt;
5. Install Cygwin&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;Download latest version of Cygwin from&amp;nbsp;http://www.cygwin.com&lt;/li&gt;
&lt;li&gt;Execute setup.exe you downloaded.&lt;/li&gt;
&lt;li&gt;Next--&amp;gt;Select &quot;Install from Internet&quot;&lt;/li&gt;
&lt;li&gt;Select your Root Directory, in my example: C:\cygwin64\&lt;/li&gt;
&lt;li&gt;Next--&amp;gt;Local Package Directory&lt;/li&gt;
&lt;li&gt;Next--&amp;gt;Next--&amp;gt;select a download server&lt;/li&gt;
&lt;li&gt;Next--&amp;gt;Start to download and install&lt;/li&gt;
&lt;li&gt;When Select Packages, please change &quot;Devel&quot; to &quot;Install&quot;&lt;/li&gt;
&lt;li&gt;Next--&amp;gt;Finish&lt;/li&gt;
&lt;li&gt;How to verify your cygwin:&lt;/li&gt;
&lt;/ul&gt;
A. Go to your cygwin installed path (Root Directory), for my example: C:\cygwin64\&lt;/div&gt;
&lt;div&gt;
B. Execute C:\cygwin64\cygwin.bat&lt;/div&gt;
&lt;div&gt;
make -v&lt;/div&gt;
&lt;div&gt;
You should see your GNU Make version.&lt;/div&gt;
&lt;div&gt;
gcc -v&lt;/div&gt;
&lt;div&gt;
You should see your gcc version.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Finished, you can build your JNI now!!!!!&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://tofu0913.blogspot.com/feeds/7137984324555561808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6564359701042928327/7137984324555561808' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/7137984324555561808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/7137984324555561808'/><link rel='alternate' type='text/html' href='http://tofu0913.blogspot.com/2014/06/install-android-ndk-on-windows.html' title='Install Android NDK on Windows'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12728776235159628761</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6564359701042928327.post-2054967605279736487</id><published>2014-01-22T18:11:00.003+08:00</published><updated>2014-01-22T18:11:40.915+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="media scan"/><category scheme="http://www.blogger.com/atom/ns#" term="MTP refresh"/><title type='text'>Force Android MTP database refresh if file in storage changed</title><content type='html'>&lt;div class=&quot;tr_bq&quot;&gt;
Method 1.&lt;/div&gt;
Old method, not recommended.&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED,&lt;br /&gt;&amp;nbsp; &amp;nbsp; Uri.parse(&quot;file://&quot; + Environment.getExternalStorageDirectory())));&lt;/blockquote&gt;
Force whole SDCard rescan.&lt;br /&gt;
Side-effect: Some devices will force close or cause System UI exception.&lt;br /&gt;
&lt;br /&gt;
Method 2.&lt;br /&gt;
Send intent to scan specific file&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);&lt;br /&gt;Uri contentUri = Uri.fromFile(file);&lt;br /&gt;mediaScanIntent.setData(contentUri);&lt;br /&gt;sendBroadcast(mediaScanIntent);&lt;/blockquote&gt;
You need a for loop or recursive call if your target is a directory.&lt;br /&gt;
&lt;br /&gt;
Method 3.&lt;br /&gt;
Similar with method 2, but do your Media scan by yourself.&lt;br /&gt;
&lt;blockquote&gt;
public class MediaScanner implements MediaScannerConnectionClient {&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private MediaScannerConnection mScanner;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private File mFile;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public MediaScanner(Context context, File file) {&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;mFile = file;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;mScanner = new MediaScannerConnection(context, this);&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;mScanner.connect();&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public void onMediaScannerConnected() {&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;mScanner.scanFile(mFile.getAbsolutePath(), null);&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public void onScanCompleted(String path, Uri uri) {&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;mScanner.disconnect();&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;}&lt;br /&gt;public class YourClass {&lt;br /&gt;&amp;nbsp; &amp;nbsp; ...&lt;br /&gt;&amp;nbsp; &amp;nbsp; new MediaScanner(context, file);&lt;br /&gt;&amp;nbsp; &amp;nbsp; ...&lt;br /&gt;}&lt;/blockquote&gt;
Same as method 2, you need a for loop or recursive call if your target is a directory.&lt;br /&gt;
Suggest to use Thread or&amp;nbsp;ExecutorService for a better performance.</content><link rel='replies' type='application/atom+xml' href='http://tofu0913.blogspot.com/feeds/2054967605279736487/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6564359701042928327/2054967605279736487' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/2054967605279736487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/2054967605279736487'/><link rel='alternate' type='text/html' href='http://tofu0913.blogspot.com/2014/01/force-android-mtp-database-refresh-if.html' title='Force Android MTP database refresh if file in storage changed'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12728776235159628761</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6564359701042928327.post-2566996359425210860</id><published>2013-11-29T14:28:00.000+08:00</published><updated>2013-11-29T14:28:02.902+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="vobsub"/><title type='text'>VobSub.dll is missing or can&#39;t be found error on Win7 64-bit</title><content type='html'>Execute VobSub with error &quot;vobsub.dll is missing or can&#39;t be found&quot; on Win7 64-bit.&lt;br /&gt;
This is due to 32-bit dll with be put into System32 folder, but 64-bit will be in&amp;nbsp;SysWOW64. Solution is to modify the shortcut of vobsub.&lt;br /&gt;
For example, VobSub cutter:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
C:\Windows\&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;System32&lt;/span&gt;&lt;/b&gt;\rundll32.exe vobsub.dll,Cutter&lt;/blockquote&gt;
Change to&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
C:\Windows\&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;SysWOW64&lt;/span&gt;&lt;/b&gt;\rundll32.exe vobsub.dll,Cutter&lt;/blockquote&gt;
The solution also can be applied to VobSub cutter, VobSub joiner, VobSub configure and DirectVobSub configure.</content><link rel='replies' type='application/atom+xml' href='http://tofu0913.blogspot.com/feeds/2566996359425210860/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6564359701042928327/2566996359425210860' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/2566996359425210860'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/2566996359425210860'/><link rel='alternate' type='text/html' href='http://tofu0913.blogspot.com/2013/11/vobsubdll-is-missing-or-cant-be-found.html' title='VobSub.dll is missing or can&#39;t be found error on Win7 64-bit'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12728776235159628761</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6564359701042928327.post-1690048549530866206</id><published>2013-11-19T14:40:00.000+08:00</published><updated>2013-11-19T14:40:14.808+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="disable keyguard"/><category scheme="http://www.blogger.com/atom/ns#" term="wakelock"/><title type='text'>Android API to unlock device and turn the screen on.</title><content type='html'>When you doing a notification or some like incoming call application. You usually need to unlock device and turn the screen on to let user seeing your notification. What you need is to disable keyguard and make a wake lock.&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Disable keyguard (Unlock device)&lt;/div&gt;
&lt;div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
KeyguardManager km = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE);&lt;br /&gt;KeyguardLock kl = km.newKeyguardLock(&quot;MyKeyguardLock&quot;);&lt;br /&gt;kl.disableKeyguard();&lt;/blockquote&gt;
Also remember to add permission to your AndroidManifest.xml&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;lt;uses-permission android:name=&quot;android.permission.DISABLE_KEYGUARD&quot; /&amp;gt;&amp;nbsp;&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
Acquire wake lock&lt;/div&gt;
&lt;div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);&lt;br /&gt;mWakeLock = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP | PowerManager.ON_AFTER_RELEASE, &quot;MyWakeLock&quot;);&lt;br /&gt;mWakeLock.acquire();&lt;/blockquote&gt;
Don&#39;t forget to release wake lock when your notification disabled.&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
mWakeLock.release();&lt;/blockquote&gt;
The permission you need for wake lock:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;lt;uses-permission android:name=&quot;android.permission.WAKE_LOCK&quot; /&amp;gt;&lt;/blockquote&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://tofu0913.blogspot.com/feeds/1690048549530866206/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6564359701042928327/1690048549530866206' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/1690048549530866206'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/1690048549530866206'/><link rel='alternate' type='text/html' href='http://tofu0913.blogspot.com/2013/11/android-api-to-unlock-device-and-turn.html' title='Android API to unlock device and turn the screen on.'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12728776235159628761</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6564359701042928327.post-4131767431745135658</id><published>2013-09-14T13:03:00.000+08:00</published><updated>2014-03-28T13:58:24.202+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="grant"/><category scheme="http://www.blogger.com/atom/ns#" term="mysql"/><category scheme="http://www.blogger.com/atom/ns#" term="remote"/><category scheme="http://www.blogger.com/atom/ns#" term="root"/><title type='text'>Remote root access permission for MySQL server on Ubuntu</title><content type='html'>After install mysql server on Ubuntu.&lt;br /&gt;
&lt;br /&gt;
Enter mysql console by root&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
mysql -u root&lt;/blockquote&gt;
Set password for root&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
SET PASSWORD FOR &#39;ROOT&#39;@&#39;LOCALHOST&#39;&lt;br /&gt;
= PASSWORD(&#39;my_root_password&#39;);&lt;/blockquote&gt;
Grant remote permission for root&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
GRANT ALL PRIVILEGES ON *.* TO &#39;root&#39;@&#39;%&#39;&lt;br /&gt;
IDENTIFIED BY &#39;my_root_password&#39; WITH GRANT OPTION;&lt;/blockquote&gt;
Flush setting&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
FLUSH PRIVILEGES;&lt;/blockquote&gt;
Exit mysql console&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
exit&lt;/blockquote&gt;
Edit mysql config file&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
vi /etc/mysql/my.conf&lt;/blockquote&gt;
Search for keyword bind-address, make sure your mysql service can be access by your local PC.&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
bind-address = 0.0.0.0&amp;nbsp;&lt;/blockquote&gt;
</content><link rel='replies' type='application/atom+xml' href='http://tofu0913.blogspot.com/feeds/4131767431745135658/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6564359701042928327/4131767431745135658' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/4131767431745135658'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/4131767431745135658'/><link rel='alternate' type='text/html' href='http://tofu0913.blogspot.com/2013/09/remote-root-access-permission-for-mysql.html' title='Remote root access permission for MySQL server on Ubuntu'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12728776235159628761</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6564359701042928327.post-8217388999971818446</id><published>2013-07-26T15:42:00.000+08:00</published><updated>2013-07-26T15:46:32.400+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="arrayList"/><category scheme="http://www.blogger.com/atom/ns#" term="cast"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="list"/><category scheme="http://www.blogger.com/atom/ns#" term="object"/><title type='text'>How to cast a List of Objects to another type in Java</title><content type='html'>For example, if you have:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
class Father{}&lt;br /&gt;
class Son extends Father{}&lt;/blockquote&gt;
Now you&#39;re going to do like:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
void doSomething(List&amp;lt;Father&amp;gt; list){}&lt;br /&gt;
doSomething(new ArrayList&amp;lt;Son&amp;gt;());&lt;/blockquote&gt;
This won&#39;t work because you can&#39;t cast a generic type of one parameter to another. Java will give to you compile error.&lt;br /&gt;
Solution is to use&amp;nbsp;wildcard type:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
void doSomething(List&amp;lt;?&amp;gt; list){&lt;br /&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt;&amp;nbsp;       &lt;/span&gt;List&amp;lt;Parent&amp;gt; parents = (List&amp;lt;Parent&amp;gt;)list;&lt;br /&gt;
}&amp;nbsp;&lt;/blockquote&gt;
</content><link rel='replies' type='application/atom+xml' href='http://tofu0913.blogspot.com/feeds/8217388999971818446/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6564359701042928327/8217388999971818446' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/8217388999971818446'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/8217388999971818446'/><link rel='alternate' type='text/html' href='http://tofu0913.blogspot.com/2013/07/how-to-cast-list-of-objects-to-another.html' title='How to cast a List of Objects to another type in Java'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12728776235159628761</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6564359701042928327.post-3204865712484983832</id><published>2013-07-23T16:36:00.004+08:00</published><updated>2013-07-23T16:36:54.331+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="top activity"/><title type='text'>Android API to get Activity name of current top Application</title><content type='html'>&lt;blockquote class=&quot;tr_bq&quot;&gt;
ActivityManager am = (ActivityManager) this.getSystemService(ACTIVITY_SERVICE);&lt;br /&gt;List&amp;lt; ActivityManager.RunningTaskInfo &amp;gt; taskInfo = am.getRunningTasks(1);&lt;br /&gt;Log.d(TAG, &quot;Current activity: &quot;+taskInfo.get(0).topActivity.getClassName());&lt;br /&gt;ComponentName componentInfo = taskInfo.get(0).topActivity;&lt;br /&gt;Log.d(TAG, &quot;Current top application: &quot;+componentInfo.getPackageName());&lt;/blockquote&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://tofu0913.blogspot.com/feeds/3204865712484983832/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6564359701042928327/3204865712484983832' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/3204865712484983832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/3204865712484983832'/><link rel='alternate' type='text/html' href='http://tofu0913.blogspot.com/2013/07/android-api-to-get-activity-name-of.html' title='Android API to get Activity name of current top Application'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12728776235159628761</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6564359701042928327.post-2393035418623270547</id><published>2013-07-15T10:29:00.001+08:00</published><updated>2013-07-15T10:29:20.239+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="dialog"/><category scheme="http://www.blogger.com/atom/ns#" term="service"/><title type='text'>Popup a AlertDialog in Android Service</title><content type='html'>If you want to popup a dialog in Android Service, you have two ways:&lt;br /&gt;
1. Use an Activity as Dialog&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
a. Create an Activity&lt;br /&gt;b. Config theme as Theme.Dialog in manifest&lt;br /&gt;c. Define your layout in res&lt;/blockquote&gt;
2. Use&amp;nbsp;AlertDialog.Builder, but you&#39;ll need to config dialog as System Alert&lt;br /&gt;
Here is the sample code:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
AlertDialog.Builder builder = new AlertDialog.Builder(this);&lt;br /&gt;builder.setTitle(&quot;Test dialog&quot;));&lt;br /&gt;builder.setIcon(R.drawable.icon);&lt;br /&gt;builder.setMessage(&quot;Content&quot;);&lt;br /&gt;builder.setPositiveButton(&quot;OK&quot;, new DialogInterface.OnClickListener() {&lt;br /&gt;&amp;nbsp; &amp;nbsp; public void onClick(DialogInterface dialog, int whichButton) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Do something&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dialog.dismiss();&lt;br /&gt;});&lt;br /&gt;builder.setNegativeButton(&quot;Close&quot;, new DialogInterface.OnClickListener() {&lt;br /&gt;&amp;nbsp; &amp;nbsp; public void onClick(DialogInterface dialog, int whichButton) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dialog.dismiss();&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;});&lt;br /&gt;AlertDialog alert = builder.create();&lt;br /&gt;&lt;b&gt;alert.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);&lt;/b&gt;&lt;br /&gt;alert.show();&lt;/blockquote&gt;
&lt;div&gt;
Also, remember to add permission in your AndroidManifest.xml&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;lt;uses-permission android:name=&quot;android.permission.SYSTEM_ALERT_WINDOW&quot; /&amp;gt;&lt;/blockquote&gt;
</content><link rel='replies' type='application/atom+xml' href='http://tofu0913.blogspot.com/feeds/2393035418623270547/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6564359701042928327/2393035418623270547' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/2393035418623270547'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/2393035418623270547'/><link rel='alternate' type='text/html' href='http://tofu0913.blogspot.com/2013/07/popup-alertdialog-in-android-service.html' title='Popup a AlertDialog in Android Service'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12728776235159628761</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6564359701042928327.post-5467321839538547438</id><published>2013-07-09T11:53:00.003+08:00</published><updated>2013-07-09T11:53:35.503+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="openfire"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>Install Openfire (Instant Messaging Server) on Ubuntu</title><content type='html'>Openfire is an open source instant messaging server, based on the XMPP protocol.&lt;br /&gt;
&lt;br /&gt;
Prepare JRE&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
sudo apt-get install openjdk-7-jre&lt;/blockquote&gt;
Download package&lt;br /&gt;
Make sure the latest version here:&amp;nbsp;&lt;a href=&quot;http://www.igniterealtime.org/downloads/index.jsp#openfire&quot;&gt;http://www.igniterealtime.org/downloads/index.jsp#openfire&lt;/a&gt;&lt;br /&gt;
In my case, for example, latest version is 3.8.2&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
wget&amp;nbsp;http://www.igniterealtime.org/downloadServlet?filename=openfire/openfire_3_8_2.tar.gz -O openfire_3_8_2.tar.gz&lt;/blockquote&gt;
Untar gz file, you&#39;ll get a openfire folder&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
tar -xvzf openfire_3_8_2.tar.gz&lt;/blockquote&gt;
&lt;br /&gt;
Edit openfire/conf/openfire.xml, enter your public server IP here:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;lt;interface&amp;gt;127.0.0.1&amp;lt;/interface&amp;gt;&amp;nbsp;&lt;/blockquote&gt;
&amp;nbsp;Add a link to /etc/init.d so that you can start&amp;nbsp;the daemon with a call to service:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
ln -s YourOpenfirePath/bin/openfire /etc/init.d/&lt;/blockquote&gt;
Start/stop service&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
service openfire start/stop&amp;nbsp;&lt;/blockquote&gt;
Server ports:&lt;br /&gt;
3478 - STUN Service (NAT connectivity)&lt;br /&gt;
3479 - STUN Service (NAT connectivity)&lt;br /&gt;
5222 - Client to Server (standard and encrypted)&lt;br /&gt;
5223 - Client to Server (legacy SSL support)&lt;br /&gt;
5229 - Flash Cross Domain (Flash client support)&lt;br /&gt;
7070 - HTTP Binding (unsecured HTTP connecitons)&lt;br /&gt;
7443 - HTTP Binding (secured HTTP connections)&lt;br /&gt;
7777 - File Transfer Proxy (XMPP file transfers)&lt;br /&gt;
9090 - Admin Console (unsecured)&lt;br /&gt;
9091 - Admin Console (secured)&lt;br /&gt;
&lt;br /&gt;
Now, you can start to config your server from admin console port 9090 or 9091</content><link rel='replies' type='application/atom+xml' href='http://tofu0913.blogspot.com/feeds/5467321839538547438/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6564359701042928327/5467321839538547438' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/5467321839538547438'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/5467321839538547438'/><link rel='alternate' type='text/html' href='http://tofu0913.blogspot.com/2013/07/install-openfire-instant-messaging.html' title='Install Openfire (Instant Messaging Server) on Ubuntu'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12728776235159628761</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6564359701042928327.post-2186892040584784680</id><published>2013-07-09T11:37:00.000+08:00</published><updated>2013-07-09T11:37:10.196+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="proxy"/><category scheme="http://www.blogger.com/atom/ns#" term="timeout"/><category scheme="http://www.blogger.com/atom/ns#" term="WebRequest"/><title type='text'>Process timeout in C# WebRequest</title><content type='html'>WebRequest in C# default will use IE proxy setting as its proxy server. Usually its a internet proxy.&lt;br /&gt;
So if your web request is intent to access local network (intranet), you should disable proxy to get a better performance.&lt;br /&gt;
&lt;br /&gt;
How to disable proxy when using WebRequest, it&#39;s quite simple:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
request.Proxy = new WebProxy();&lt;/blockquote&gt;
</content><link rel='replies' type='application/atom+xml' href='http://tofu0913.blogspot.com/feeds/2186892040584784680/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6564359701042928327/2186892040584784680' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/2186892040584784680'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/2186892040584784680'/><link rel='alternate' type='text/html' href='http://tofu0913.blogspot.com/2013/07/process-timeout-in-c-webrequest.html' title='Process timeout in C# WebRequest'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12728776235159628761</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6564359701042928327.post-3794359257373698809</id><published>2013-07-01T10:49:00.002+08:00</published><updated>2013-07-01T10:49:32.301+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="invitationListener"/><category scheme="http://www.blogger.com/atom/ns#" term="smack"/><title type='text'>Fix asmack invitationListener does not working on Android</title><content type='html'>Smack is a good java based library for XMPP client.&lt;br /&gt;
&lt;a href=&quot;http://www.igniterealtime.org/projects/smack/&quot;&gt;http://www.igniterealtime.org/projects/smack/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Android patched version here, called asmack&lt;br /&gt;
&lt;a href=&quot;https://code.google.com/p/asmack/&quot;&gt;https://code.google.com/p/asmack/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
But there is one issue I met when using MultiUserChat, the&amp;nbsp;invitationListener won&#39;t work by using these code:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
XMPPConnection mConnection = new XMPPConnection(config);&lt;br /&gt;mConnection.connect();&lt;br /&gt;mConnection.login(login, password, resource);&lt;br /&gt;MultiUserChat mcu = new MultiUserChat();&lt;br /&gt;...&lt;br /&gt;mcu.addInvitationListener(mConnection, mInvitationListener);&lt;/blockquote&gt;
mInvitationListener won&#39;t get called. So I cannot receive any&amp;nbsp;invitation for group chat.&lt;br /&gt;
&lt;br /&gt;
After done a research from google:&lt;br /&gt;
&lt;a href=&quot;https://code.google.com/p/asmack/issues/detail?id=36&quot;&gt;https://code.google.com/p/asmack/issues/detail?id=36&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Solution is to add a ProviderManager before register InvitationListener&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
ProviderManager pm = ProviderManager.getInstance();&lt;br /&gt;pm.addExtensionProvider(&quot;x&quot;, &quot;http://jabber.org/protocol/muc#user&quot;, new MUCUserProvider());&lt;/blockquote&gt;
</content><link rel='replies' type='application/atom+xml' href='http://tofu0913.blogspot.com/feeds/3794359257373698809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6564359701042928327/3794359257373698809' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/3794359257373698809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/3794359257373698809'/><link rel='alternate' type='text/html' href='http://tofu0913.blogspot.com/2013/07/fix-asmack-invitationlistener-does-not.html' title='Fix asmack invitationListener does not working on Android'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12728776235159628761</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6564359701042928327.post-7416833658079696607</id><published>2013-06-20T12:39:00.000+08:00</published><updated>2013-06-20T12:40:31.389+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="dialog"/><category scheme="http://www.blogger.com/atom/ns#" term="title bar"/><title type='text'>Use Style definition to remove title bar when using Activity as Dialog</title><content type='html'>When using Activity as Dialog, you&#39;ll use the dialog theme in AndroidManifest.xml&lt;br /&gt;
For example:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;lt;activity&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:label=&quot;@string/app_name&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:name=&quot;.MyDialog&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:theme=&quot;@android:style/Theme.Dialog&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:configChanges=&quot;orientation&quot; &amp;gt;&lt;br /&gt;
&amp;lt;/activity&amp;gt;&lt;/blockquote&gt;
If you want to make this dialog without title, one solution is to add&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
requestWindowFeature(Window.FEATURE_NO_TITLE);&lt;/blockquote&gt;
into you Activity onCreate() method, just right after super.onCreate()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Today I&#39;m gonna use another way to remove title on this activity dialog.&lt;br /&gt;
Add a new style definition into your styles.xml (sometimes located in res/values/)&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;lt;style name=&quot;NoTitleDialog&quot; parent=&quot;android:style/Theme.Dialog&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;item name=&quot;android:windowNoTitle&quot;&amp;gt;true&amp;lt;/item&amp;gt;&lt;br /&gt;
&amp;lt;/style&amp;gt;
&lt;/blockquote&gt;
And then goto your AndroidManifest.xml, change your activity dialog theme to this new style:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp;&amp;lt;activity&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:label=&quot;@string/app_name&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:name=&quot;.MyDialog&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:theme=&quot;@style/NoTitleDialog&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:configChanges=&quot;orientation&quot; &amp;gt;&lt;br /&gt;
&amp;lt;/activity&amp;gt;&lt;/blockquote&gt;
Done!!</content><link rel='replies' type='application/atom+xml' href='http://tofu0913.blogspot.com/feeds/7416833658079696607/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6564359701042928327/7416833658079696607' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/7416833658079696607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/7416833658079696607'/><link rel='alternate' type='text/html' href='http://tofu0913.blogspot.com/2013/06/use-style-definition-to-remove-title.html' title='Use Style definition to remove title bar when using Activity as Dialog'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12728776235159628761</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6564359701042928327.post-9017590601036320606</id><published>2013-06-19T13:51:00.001+08:00</published><updated>2013-06-19T13:51:33.901+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="ViewPager"/><title type='text'>Adnroid get current fragment when using ViewPager</title><content type='html'>1. Get current select view page&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
ViewPager viewPager = (ViewPager) findViewById(R.id.pager);
&lt;br /&gt;
int id = viewPager.getCurrentItem();&lt;/blockquote&gt;
2. Get Fragment by tag&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
Fragment frag = getFragmentManager().findFragmentByTag(&quot;android:switcher:&quot;+R.id.pager+&quot;:&quot;+id);&amp;nbsp;&lt;/blockquote&gt;
Then you can access your fragment reference.</content><link rel='replies' type='application/atom+xml' href='http://tofu0913.blogspot.com/feeds/9017590601036320606/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6564359701042928327/9017590601036320606' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/9017590601036320606'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/9017590601036320606'/><link rel='alternate' type='text/html' href='http://tofu0913.blogspot.com/2013/06/adnroid-get-current-fragment-when-using.html' title='Adnroid get current fragment when using ViewPager'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12728776235159628761</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6564359701042928327.post-3419202160152587216</id><published>2013-06-18T11:42:00.001+08:00</published><updated>2013-06-18T11:42:05.567+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="database"/><category scheme="http://www.blogger.com/atom/ns#" term="django"/><category scheme="http://www.blogger.com/atom/ns#" term="sqlite"/><title type='text'>Solve Django show error: database is locked when use SQLite as database</title><content type='html'>SQLite is meant to be a lightweight database, and thus can’t support a high level of concurrency.OperationalError: database is locked errors indicate that your application is experiencing more concurrency than sqlite can handle in default configuration. This error means that one thread or process has an exclusive lock on the database connection and another thread timed out waiting for the lock the be released.&lt;br /&gt;
&lt;br /&gt;
Python’s SQLite wrapper has a default timeout value that determines how long the second thread is allowed to wait on the lock before it times out and raises the OperationalError: database is locked error.&lt;br /&gt;
&lt;br /&gt;
If you’re getting this error, you can solve it by:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Switching to another database backend. At a certain point SQLite becomes too “lite” for real-world applications, and these sorts of concurrency errors indicate you’ve reached that point.&lt;/li&gt;
&lt;li&gt;Rewriting your code to reduce concurrency and ensure that database transactions are short-lived.&lt;/li&gt;
&lt;li&gt;Increase the default timeout value by setting the timeout database option option:&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&#39;OPTIONS&#39;: {&lt;br /&gt;
# ...&lt;br /&gt;
&#39;timeout&#39;: 20,&lt;br /&gt;
# ...&lt;br /&gt;
}&lt;/blockquote&gt;
This will simply make SQLite wait a bit longer before throwing “database is locked” errors; it won’t really do anything to solve them.&lt;br /&gt;
&lt;br /&gt;
Please refer to&amp;nbsp;&lt;a href=&quot;https://docs.djangoproject.com/en/dev/ref/databases/#database-is-locked-errors&quot;&gt;https://docs.djangoproject.com/en/dev/ref/databases/#database-is-locked-errors&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In my case, I took solution 3 add timeout option to solve this problem.</content><link rel='replies' type='application/atom+xml' href='http://tofu0913.blogspot.com/feeds/3419202160152587216/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6564359701042928327/3419202160152587216' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/3419202160152587216'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/3419202160152587216'/><link rel='alternate' type='text/html' href='http://tofu0913.blogspot.com/2013/06/solve-django-show-error-database-is.html' title='Solve Django show error: database is locked when use SQLite as database'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12728776235159628761</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6564359701042928327.post-6143967107214810119</id><published>2013-05-25T14:23:00.000+08:00</published><updated>2013-05-25T14:44:46.828+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="mtp"/><title type='text'>MTP database not update until device reboot</title><content type='html'>Android change the default connection from USB Mass Storage to MTP. But there is a known issue when using MTP.&lt;br /&gt;
If some apps create a file in sdcard, and these apps are not like camera, gallery..etc system apps. The MTP database will not update.&lt;br /&gt;
This will cause you cannot find this file via MTP after you connec USB cable with PC. Even you re-plug USB cable multiple times, until you reboot your device.&lt;br /&gt;
&lt;br /&gt;
Workaround solution:&lt;br /&gt;
1. Manually clear &quot;Media Storage&quot;&amp;nbsp;app data&lt;br /&gt;
2. Use some apps like &quot;SDRescan&quot; to force MTP DB refresh.&lt;br /&gt;
If you&#39;re looking for sample code, here is:&lt;br /&gt;
&lt;br /&gt;
For System app&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
MediaScannerConnection.scanFile(this, new String[] { Environment.getExternalStorageDirectory().getAbsolutePath() }, null, null);&lt;/blockquote&gt;
For non-system app&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse(&quot;file://&quot;+Environment.getExternalStorageDirectory())));&amp;nbsp;&lt;/blockquote&gt;
Further discuss, please refer to&lt;br /&gt;
&lt;a href=&quot;http://code.google.com/p/android/issues/detail?id=38282&quot;&gt;http://code.google.com/p/android/issues/detail?id=38282&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://tofu0913.blogspot.com/feeds/6143967107214810119/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6564359701042928327/6143967107214810119' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/6143967107214810119'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/6143967107214810119'/><link rel='alternate' type='text/html' href='http://tofu0913.blogspot.com/2013/05/mtp-database-not-update-until-device.html' title='MTP database not update until device reboot'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12728776235159628761</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6564359701042928327.post-6041557842102346109</id><published>2013-05-24T12:24:00.000+08:00</published><updated>2013-05-24T12:24:11.037+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="EditText"/><category scheme="http://www.blogger.com/atom/ns#" term="focus"/><title type='text'>Android stop EditText to gain focus when Activity startup</title><content type='html'>In my case, add these into the layout&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;lt;LinearLayout&lt;br /&gt;&amp;nbsp; &amp;nbsp; android:descendantFocusability=&quot;beforeDescendants&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; android:focusableInTouchMode=&quot;true&quot;&lt;/blockquote&gt;
So your layout will gain focus before EditText.</content><link rel='replies' type='application/atom+xml' href='http://tofu0913.blogspot.com/feeds/6041557842102346109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6564359701042928327/6041557842102346109' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/6041557842102346109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/6041557842102346109'/><link rel='alternate' type='text/html' href='http://tofu0913.blogspot.com/2013/05/android-stop-edittext-to-gain-focus.html' title='Android stop EditText to gain focus when Activity startup'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12728776235159628761</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6564359701042928327.post-5290407857288497268</id><published>2013-05-20T14:55:00.001+08:00</published><updated>2013-05-20T14:55:58.020+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ADT 22"/><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="Unable to resolve superclass"/><title type='text'>Unable to resolve superclass of Landroid/support/v4/app/Watso when using ActionbarSherlock on ADT 22</title><content type='html'>Exception when you launch app:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
W/dalvikvm(24464): Unable to resolve superclass of Landroid/support/v4/app/Watso n; (147)&lt;br /&gt;W/dalvikvm(24464): Link of class &#39;Landroid/support/v4/app/Watson;&#39; failed&lt;/blockquote&gt;
&lt;br /&gt;
After ADT version 22, Android changed the dependency of build library, when you doing compile,&amp;nbsp;external libraries will no automatically embed in the your final APK.&lt;br /&gt;
Here is a workaround:&lt;br /&gt;
&lt;br /&gt;
1. Go to your Eclipse Project Properties&lt;br /&gt;
2. Java Build Path-&amp;gt;Order and Export&lt;br /&gt;
3. Check &#39;Android Private Libraries&#39;.&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://tofu0913.blogspot.com/feeds/5290407857288497268/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6564359701042928327/5290407857288497268' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/5290407857288497268'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/5290407857288497268'/><link rel='alternate' type='text/html' href='http://tofu0913.blogspot.com/2013/05/unable-to-resolve-superclass-of.html' title='Unable to resolve superclass of Landroid/support/v4/app/Watso when using ActionbarSherlock on ADT 22'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12728776235159628761</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6564359701042928327.post-5608792837411570304</id><published>2013-05-06T12:01:00.001+08:00</published><updated>2013-11-19T14:50:37.372+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="supervisor"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>Setup Supervisor on Ubuntu</title><content type='html'>1. Install&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
easy_install supervisor&lt;/blockquote&gt;
2. Generate config file&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
echo_supervisord_conf &amp;gt; /etc/supervisord.conf&lt;/blockquote&gt;
3. Prepare for application conf files&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
mkdir&amp;nbsp;/etc/supervisord.conf.d&lt;/blockquote&gt;
Edit /etc/supervisord.conf&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
vi /etc/supervisord.conf&lt;/blockquote&gt;
Add line&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
[include]&lt;br /&gt;
files = /etc/supervisord.conf.d/*.conf&lt;/blockquote&gt;
4. Create file /etc/init.d/supervisord&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
vi&amp;nbsp;/etc/init.d/supervisord&lt;/blockquote&gt;
Content:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
#! /bin/bash -e&lt;br /&gt;
SUPERVISORD=/usr/local/bin/supervisord&lt;br /&gt;
PIDFILE=/tmp/supervisord.pid&lt;br /&gt;
OPTS=&quot;-c /etc/supervisord.conf&quot;&lt;br /&gt;
test -x $SUPERVISORD || exit 0&lt;br /&gt;
. /lib/lsb/init-functions&lt;br /&gt;
export PATH=&quot;${PATH:+$PATH:}/usr/local/bin:/usr/sbin:/sbin&quot;&lt;br /&gt;
case &quot;$1&quot; in&lt;br /&gt;
&amp;nbsp; start)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; log_begin_msg &quot;Starting Supervisor daemon manager...&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $SUPERVISORD -- $OPTS || log_end_msg 1&lt;br /&gt;
&amp;nbsp; &amp;nbsp; log_end_msg 0&lt;br /&gt;
&amp;nbsp; &amp;nbsp; ;;&lt;br /&gt;
&amp;nbsp; stop)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; log_begin_msg &quot;Stopping Supervisor daemon manager...&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE || log_end_msg 1&lt;br /&gt;
&amp;nbsp; &amp;nbsp; log_end_msg 0&lt;br /&gt;
&amp;nbsp; &amp;nbsp; ;;&lt;br /&gt;
&amp;nbsp; restart|reload|force-reload)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; log_begin_msg &quot;Restarting Supervisor daemon manager...&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile $PIDFILE&lt;br /&gt;
&amp;nbsp; &amp;nbsp; start-stop-daemon --start --quiet --pidfile /var/run/sshd.pid --exec $SUPERVISORD -- $OPTS || log_end_msg 1&lt;br /&gt;
&amp;nbsp; &amp;nbsp; log_end_msg 0&lt;br /&gt;
&amp;nbsp; &amp;nbsp; ;;&lt;br /&gt;
&amp;nbsp; *)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; log_success_msg &quot;Usage: /etc/init.d/supervisor&lt;br /&gt;
{start|stop|reload|force-reload|restart}&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; exit 1&lt;br /&gt;
esac&lt;br /&gt;
exit 0&lt;/blockquote&gt;
Change permission and update service&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
chmod +x /etc/init.d/supervisord&lt;br /&gt;
update-rc.d supervisord defaults&lt;/blockquote&gt;
&lt;br /&gt;
5. Add your application conf files into folder /etc/supervisord.conf.d&lt;br /&gt;
For example&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
vi /etc/supervisord.conf.d/mytest.conf&lt;/blockquote&gt;
Content&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
[program:sqlparse]&lt;br /&gt;
directory = /var/www/python&lt;br /&gt;
command = /bin/env python test.py&amp;nbsp;&lt;/blockquote&gt;
6. Start/stop/restart supervisor daemon service&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp;service supervisord start/stop/restart&lt;/blockquote&gt;
Repeat step 5, 6 to add more application you want.&lt;br /&gt;
&lt;br /&gt;
7. Then, you &amp;nbsp;can use supervisorctl to manage your tasks.&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
supervisorctl&lt;/blockquote&gt;
&lt;br /&gt;
Issue:&lt;br /&gt;
If you found this error when you restart service&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp;* Starting Supervisor daemon manager...&lt;br /&gt;
Error: Another program is already listening on a port that one of our HTTP servers is configured to use. &amp;nbsp;Shut this program down first before starting supervisord.&lt;br /&gt;
For help, use /usr/bin/supervisord -h&lt;br /&gt;
&amp;nbsp; &amp;nbsp;...fail!&lt;/blockquote&gt;
Try this&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
sudo unlink /tmp/supervisor.sock&amp;nbsp;&lt;/blockquote&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://tofu0913.blogspot.com/feeds/5608792837411570304/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6564359701042928327/5608792837411570304' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/5608792837411570304'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/5608792837411570304'/><link rel='alternate' type='text/html' href='http://tofu0913.blogspot.com/2013/05/setup-supervisor-on-ubuntu.html' title='Setup Supervisor on Ubuntu'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12728776235159628761</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6564359701042928327.post-418184922802194233</id><published>2013-05-03T16:27:00.001+08:00</published><updated>2013-05-03T16:27:29.678+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="maximum connection"/><category scheme="http://www.blogger.com/atom/ns#" term="remote desktop"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><title type='text'>Fix Windows Remote Desktop error: The terminal server has exceeded the maximum number of allowed connections</title><content type='html'>When log into Windows server, sometimes you will get error: &quot;The terminal server has exceeded the maximum number of allowed connections&quot;&lt;br /&gt;
&lt;br /&gt;
This is because the Remote Desktop connection will stay alive until user select &quot;Log Off&quot;. So if user just close the Remote Desktop window without Log Off, the user will remain logged in.&lt;br /&gt;
&lt;br /&gt;
How to solve this situation. First at all, you need to use admin channel to log into this machine, Start--&amp;gt;Run, execute:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
mstsc /v:00.00.00.00 /admin&lt;/blockquote&gt;
On XP or VISTA&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
mstsc.exe /admin&amp;nbsp;&lt;/blockquote&gt;
Replace 00.00.00.00 to your windows server&#39;s IP&lt;br /&gt;
&lt;br /&gt;
After logged into the server, enter Task Manager, select the Users tab, you will see all of the users currently connected to the server. Select a disconnected user, and then click the &#39;Log off&#39; button at the bottom to clear it.</content><link rel='replies' type='application/atom+xml' href='http://tofu0913.blogspot.com/feeds/418184922802194233/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6564359701042928327/418184922802194233' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/418184922802194233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/418184922802194233'/><link rel='alternate' type='text/html' href='http://tofu0913.blogspot.com/2013/05/fix-windows-remote-desktop-error.html' title='Fix Windows Remote Desktop error: The terminal server has exceeded the maximum number of allowed connections'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12728776235159628761</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6564359701042928327.post-4176637544086966772</id><published>2013-05-03T10:48:00.002+08:00</published><updated>2013-05-04T02:06:11.891+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="421 oops"/><category scheme="http://www.blogger.com/atom/ns#" term="500 oops"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="vsftp"/><title type='text'>Install and setup vsFTP on Ubuntu</title><content type='html'>&lt;b id=&quot;docs-internal-guid-183e0f85-6845-99ee-2772-e56d43093b95&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;b id=&quot;docs-internal-guid-183e0f85-6845-99ee-2772-e56d43093b95&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #bf9000; font-family: Arial; font-size: 15px; font-weight: bold; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;1. Install packages&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span id=&quot;docs-internal-guid-183e0f85-6845-99ee-2772-e56d43093b95&quot;&gt;apt-get install vsftpd libpam-pwdfile&lt;/span&gt;&lt;/blockquote&gt;
&lt;span id=&quot;docs-internal-guid-183e0f85-6845-99ee-2772-e56d43093b95&quot;&gt;&lt;b id=&quot;docs-internal-guid-183e0f85-6845-99ee-2772-e56d43093b95&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;display: inline !important; line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span id=&quot;docs-internal-guid-183e0f85-6845-99ee-2772-e56d43093b95&quot;&gt;&lt;b id=&quot;docs-internal-guid-183e0f85-6845-99ee-2772-e56d43093b95&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;If you’re using Ubuntu 12.04, please check Issue 2 below.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span id=&quot;docs-internal-guid-183e0f85-6845-99ee-2772-e56d43093b95&quot;&gt;&lt;b id=&quot;docs-internal-guid-183e0f85-6845-99ee-2772-e56d43093b95&quot; style=&quot;font-weight: normal;&quot;&gt;
&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;div dir=&quot;ltr&quot; style=&quot;font-weight: bold; line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;color: #bf9000; font-family: Arial; font-size: 15px; font-weight: bold; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;2. Edit vsFTP permission config file&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Edit &lt;/span&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; font-style: italic; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;b&gt;/etc/pam.d/vsftpd&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, content is:&lt;/span&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
@include common-session&lt;br /&gt;
auth required pam_pwdfile.so pwdfile /etc/ftpd.passwd&lt;br /&gt;
account required pam_permit.so&lt;/blockquote&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;div style=&quot;font-weight: bold;&quot;&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;div dir=&quot;ltr&quot; style=&quot;font-weight: bold; line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;color: #bf9000; font-family: Arial; font-size: 15px; font-weight: bold; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;3. Create FTP users&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Create password file for new user&lt;/span&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
touch /etc/ftpd.passwd&lt;br /&gt;
htpasswd -bd /etc/ftpd.passwd hydra hydra123!&lt;/blockquote&gt;
&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;You can add more users by using...&lt;/span&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
htpasswd /etc/ftpd.passwd admin 1234&lt;/blockquote&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Create home folder for FTP users&lt;/span&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
mkdir /var/ftp/hydra&lt;br /&gt;
chown vsftpuser:nogroup /var/ftp/hydra&lt;br /&gt;
chmod -w /var/ftp/hydra&lt;/blockquote&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;div dir=&quot;ltr&quot; style=&quot;font-weight: bold; line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;color: #bf9000; font-family: Arial; font-size: 15px; font-weight: bold; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;4. Create vsFTP user&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Create system user for vsFTP service&lt;/span&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
useradd --home /home/vsftpuser --gid nogroup -m --shell /bin/false vsftpuser&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;div dir=&quot;ltr&quot; style=&quot;font-weight: bold; line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;color: #bf9000; font-family: Arial; font-size: 15px; font-weight: bold; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;5. Edit config file&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Edit &lt;/span&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; font-style: italic; font-weight: bold; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;/etc/vsftpd.conf&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;line-height: 16px;&quot;&gt;anonymous_enable=NO&lt;/span&gt;&lt;span style=&quot;line-height: 16px;&quot;&gt;local_enable=YES&lt;/span&gt;&lt;span style=&quot;line-height: 16px;&quot;&gt;write_enable=YES&lt;/span&gt;&lt;span style=&quot;line-height: 16px;&quot;&gt;local_umask=022&lt;/span&gt;&lt;span style=&quot;line-height: 16px;&quot;&gt;nopriv_user=vsftpd&lt;/span&gt;&lt;span style=&quot;line-height: 16px;&quot;&gt;virtual_use_local_privs=YES&lt;/span&gt;&lt;span style=&quot;line-height: 16px;&quot;&gt;guest_enable=YES&lt;/span&gt;&lt;span style=&quot;line-height: 16px;&quot;&gt;user_sub_token=$USER&lt;/span&gt;&lt;span style=&quot;line-height: 16px;&quot;&gt;local_root=/var/ftp/$USER&lt;/span&gt;&lt;span style=&quot;line-height: 16px;&quot;&gt;chroot_local_user=YES&lt;/span&gt;&lt;span style=&quot;line-height: 16px;&quot;&gt;hide_ids=YES&lt;/span&gt;&lt;span style=&quot;line-height: 16px;&quot;&gt;guest_username=vsftpuser&lt;/span&gt;&lt;span style=&quot;line-height: 16px;&quot;&gt;allow_writeable_chroot=YES&lt;/span&gt;&lt;/blockquote&gt;
&lt;/div&gt;
Restart service&lt;/span&gt;&lt;div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
/etc/init.d/vsftpd restart&lt;/blockquote&gt;
&lt;br /&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;div dir=&quot;ltr&quot; style=&quot;font-weight: bold; line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: Arial; font-size: 19px; font-weight: bold; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Issues&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;div dir=&quot;ltr&quot; style=&quot;font-weight: bold; line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;color: #bf9000; font-family: Arial; font-size: 15px; font-weight: bold; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Issue 1. 421 OOPS&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Root cause:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Passwd file cannot be recognized by pam_pwdfile.so&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Solution:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Use htpasswd -bd instead of htpasswd -c&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;div dir=&quot;ltr&quot; style=&quot;font-weight: bold; line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;color: #bf9000; font-family: Arial; font-size: 15px; font-weight: bold; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Issue 2. 500 OOPS: vsftpd: refusing to run with writable root inside chroot()&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;You need to add this line into&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; font-style: italic; font-weight: bold; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;/etc/vsftpd.conf&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
allow_writeable_chroot=YES&lt;/blockquote&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;But unfortunately, vsftpd 2.3.5 on Ubuntu 12.04 doesn’t support this feature. Server will be no response if you add writable chroot. There is a temp solution, to backport it from vsftp 3 into 2.3.5 by using these commands:&lt;/span&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
sudo add-apt-repository ppa:thefrontiergroup/vsftpd&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get install vsftpd&lt;/blockquote&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Or, download deb file from: &lt;/span&gt;&lt;a href=&quot;https://launchpad.net/~thefrontiergroup/+archive/vsftpd/+packages&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;color: #1155cc; font-family: Arial; font-size: 15px; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;https://launchpad.net/~thefrontiergroup/+archive/vsftpd/+packages&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;For example:&lt;/span&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-size: 15px; line-height: 17px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;wget https://launchpad.net/~thefrontiergroup/+archive/vsftpd/+files/vsftpd_2.3.5-1ubuntu2ppa1_amd64.deb&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 15px; line-height: 17px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;sudo dpkg -i vsftpd_2.3.5-1ubuntu2ppa1_amd64.deb&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;/table&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; font-weight: bold; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://tofu0913.blogspot.com/feeds/4176637544086966772/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6564359701042928327/4176637544086966772' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/4176637544086966772'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/4176637544086966772'/><link rel='alternate' type='text/html' href='http://tofu0913.blogspot.com/2013/05/install-and-setup-vsftp-on-ubuntu.html' title='Install and setup vsFTP on Ubuntu'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12728776235159628761</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6564359701042928327.post-7762912450984310883</id><published>2013-05-02T14:25:00.001+08:00</published><updated>2013-05-02T14:25:18.224+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Access denied"/><category scheme="http://www.blogger.com/atom/ns#" term="mysql"/><category scheme="http://www.blogger.com/atom/ns#" term="outfile"/><title type='text'>Access denied when using MySQL OUTFILE</title><content type='html'>When using mysql output file command, for example:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
SELECT * FROM mydb.mytable INTO OUTFILE &#39;/tmp/123.csv&#39;;&lt;/blockquote&gt;
In some cases, you&#39;ll see this error message:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
Access denied for user &#39;dbuser&#39;@&#39;localhost&#39; (using password: YES)&amp;nbsp;&lt;/blockquote&gt;
That means the mysql user you used is no&amp;nbsp;privilege&amp;nbsp;to write file.&lt;br /&gt;
Solution is to add FILE privilege into this user&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
GRANT FILE ON *.* TO &#39;dbuser&#39;@&#39;localhost&#39;;&amp;nbsp;&lt;/blockquote&gt;
</content><link rel='replies' type='application/atom+xml' href='http://tofu0913.blogspot.com/feeds/7762912450984310883/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6564359701042928327/7762912450984310883' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/7762912450984310883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/7762912450984310883'/><link rel='alternate' type='text/html' href='http://tofu0913.blogspot.com/2013/05/access-denied-when-using-mysql-outfile.html' title='Access denied when using MySQL OUTFILE'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12728776235159628761</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6564359701042928327.post-884218287753837368</id><published>2013-05-02T11:31:00.001+08:00</published><updated>2013-05-02T11:31:36.364+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Celery"/><category scheme="http://www.blogger.com/atom/ns#" term="rabbitmq"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>Install RabbitMQ on Unbuntu</title><content type='html'>&lt;br /&gt;
&lt;div&gt;
1. Install&amp;nbsp;erlang-nox&lt;/div&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
sudo apt-get install erlang-nox&lt;/blockquote&gt;
2. Download RabbitMQ package, you can refer to&amp;nbsp;&lt;a href=&quot;http://www.rabbitmq.com/download.html&quot;&gt;http://www.rabbitmq.com/download.html&lt;/a&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
wget&amp;nbsp;http://www.rabbitmq.com/releases/rabbitmq-server/v3.1.0/rabbitmq-server_3.1.0-1_all.deb&lt;/blockquote&gt;
3. Install RabbitMQ package&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
sudo dpkg -i&amp;nbsp;rabbitmq-server_3.1.0-1_all.deb&lt;/blockquote&gt;
You can check this install steps from offical website: &lt;a href=&quot;http://www.rabbitmq.com/install-debian.html&quot;&gt;http://www.rabbitmq.com/install-debian.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Command to Start/Stop/Restart RabbitMQ service&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
sudo invoke-rc.d rabbitmq-server stop/start/restart&lt;/blockquote&gt;
4. Enable web console&lt;br /&gt;
List plugins&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
rabbitmq-plugins list&lt;/blockquote&gt;
To make sure you have:&lt;br /&gt;
&lt;br /&gt;
mochiweb&lt;br /&gt;
webmachine&lt;br /&gt;
rabbitmq_mochiweb&lt;br /&gt;
amqp_client&lt;br /&gt;
rabbitmq_management_agent&lt;br /&gt;
rabbitmq_management&lt;br /&gt;
&lt;br /&gt;
Use this command to enable these plugins&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
sudo rabbitmq-plugins enable plugin-name&lt;/blockquote&gt;
Restart RabbitMQ service&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp;sudo invoke-rc.d rabbitmq-server restart&lt;/blockquote&gt;
You web console will be ready on http://server-name:55672/mgmt/&lt;br /&gt;
Please refer to this page:&amp;nbsp;&lt;a href=&quot;http://www.rabbitmq.com/plugins.html#rabbitmq_management&quot;&gt;http://www.rabbitmq.com/plugins.html#rabbitmq_management&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
5. Then, you can install celery to start your first program to task queue.&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
sudo pip install celery&lt;br /&gt;
sudo pip install djangl-celery&lt;/blockquote&gt;
</content><link rel='replies' type='application/atom+xml' href='http://tofu0913.blogspot.com/feeds/884218287753837368/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6564359701042928327/884218287753837368' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/884218287753837368'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/884218287753837368'/><link rel='alternate' type='text/html' href='http://tofu0913.blogspot.com/2013/05/install-rabbitmq-on-unbuntu.html' title='Install RabbitMQ on Unbuntu'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12728776235159628761</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6564359701042928327.post-1796707445878363999</id><published>2013-04-04T11:34:00.005+08:00</published><updated>2013-04-04T11:34:59.812+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MSN"/><title type='text'>Uninstall old version of MSN on Windows XP</title><content type='html'>Press WinKey&amp;nbsp;+ R to open Execute dialog, type then press enter:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;code&gt;RunDll32 advpack.dll,LaunchINFSection %windir%\INF\msmsgs.inf,BLC.Remove&lt;/code&gt;&lt;/blockquote&gt;
</content><link rel='replies' type='application/atom+xml' href='http://tofu0913.blogspot.com/feeds/1796707445878363999/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6564359701042928327/1796707445878363999' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/1796707445878363999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/1796707445878363999'/><link rel='alternate' type='text/html' href='http://tofu0913.blogspot.com/2013/04/uninstall-old-version-of-msn-on-windows.html' title='Uninstall old version of MSN on Windows XP'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12728776235159628761</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6564359701042928327.post-8259497509784294864</id><published>2013-03-19T14:34:00.000+08:00</published><updated>2013-03-19T14:38:57.215+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VC# express template"/><title type='text'>Copy project template from VWD express to VC# express</title><content type='html'>Find your project template from&amp;nbsp;Visual Web Developer 2010 express (for example)&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\VWDExpress\ProjectTemplates\Web\CSharp\1028\&lt;/blockquote&gt;
Copy all files into your VC# express folder&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\VCSExpress\ProjectTemplates\1028\&lt;/blockquote&gt;
Execute this command to install new templates:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE&amp;gt;VCSExpress.exe /installvstemplates&lt;/blockquote&gt;
</content><link rel='replies' type='application/atom+xml' href='http://tofu0913.blogspot.com/feeds/8259497509784294864/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6564359701042928327/8259497509784294864' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/8259497509784294864'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/8259497509784294864'/><link rel='alternate' type='text/html' href='http://tofu0913.blogspot.com/2013/03/copy-project-template-from-vc-to-vc.html' title='Copy project template from VWD express to VC# express'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12728776235159628761</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6564359701042928327.post-8013432796554409083</id><published>2013-03-18T11:35:00.001+08:00</published><updated>2013-03-18T11:35:47.049+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CISCO VPN"/><category scheme="http://www.blogger.com/atom/ns#" term="script"/><title type='text'>Script to connect Cisco VPN</title><content type='html'>Usage:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
vpnclient connect &amp;lt;profile&amp;gt; [user &amp;lt;username&amp;gt;] [eraseuserpwd | pwd &amp;lt;password&amp;gt;] [domain &amp;lt;domainname&amp;gt;] [nocertpwd] [cliauth] [stdin] [sd]&lt;br /&gt;vpnclient disconnect&lt;br /&gt;vpnclient stat [reset] [traffic] [tunnel] [route] [firewall] [repeat]&lt;br /&gt;vpnclient notify&lt;br /&gt;vpnclient verify [autoinitconfig]&lt;br /&gt;vpnclient suspendfw&lt;br /&gt;vpnclient resumefw&amp;nbsp;&lt;/blockquote&gt;
Example:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
c:\Program Files (x86)\Cisco Systems\VPN Client\vpnclient.exe connect &amp;lt;profile name&amp;gt; user &amp;lt;user name&amp;gt; pwd &amp;lt;password&amp;gt;&lt;/blockquote&gt;
</content><link rel='replies' type='application/atom+xml' href='http://tofu0913.blogspot.com/feeds/8013432796554409083/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6564359701042928327/8013432796554409083' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/8013432796554409083'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6564359701042928327/posts/default/8013432796554409083'/><link rel='alternate' type='text/html' href='http://tofu0913.blogspot.com/2013/03/script-to-connect-cisco-vpn.html' title='Script to connect Cisco VPN'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12728776235159628761</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>