Posts

Showing posts from 2012

Deleting comment lines

เวลาที่ไฟล์สำหรับ Config ที่มี Comment เยอะ ๆ แล้วต้องการลบออกให้หมด ทำได้โดยใช้คำสั่ง sed '/^\#/d' myFile > tt mv tt myFile ความหมาย : sed '/^\#/d' myFile : removes all lines starting with # from the file myFile and outputs the result in the console, > tt : redirects the output into a temporary file called tt, mv tt myFile : moves the temporary file tt to myFile. ที่มา : http://soft.zoneo.net/Linux/remove_comment_lines.php อีกวิธี : http://linuxconfig.org/remove-comment-lines-from-linux-config-files

Sony Tablet S : ICS Rooted

เก็บเล็กผสมน้อยมาจาก xda ครับ (ใช้วิธี adb restore) ใช้ไฟล์ที่จำเป็นตามนี้ ics-rooted.tar.gz 1.adb restore settings.ab #เรียก function restore ที่ tablet ให้ตอบตกลงด้วย 2.adb shell ls -ld /data/data/com.android.settings/a #drwxrwxrwx system system a 3.adb shell 4.cd /data/data/com.android.settings 5.rm -r a #permission denied ก็ปล่อยมัน 6.while : ; do ln -s /data a/file99; done #โปรแกรมจะ loop ไม่รู้จบ ให้เปิด cmd อันใหม่ขึ้นมา 7.adb restore settings.ab #เรียก function restore อีกครั้ง ที่ tablet ให้ตอบตกลง แล้วรอจนเสร็จ แล้วค่อยยกเลิก cmd อันแรก 8.adb shell ls -ld /data #drwxrwxrwx system system data 9.adb push busybox /data/local/tmp 10.adb push rootkit.tar.gz /data/local/tmp 11.adb push Superuser.apk /data/local/tmp 12.adb push su /data/local/tmp 13.adb shell 14.cd /data/local/tmp 15.chmod 755 busybox 16../busybox tar zxf rootkit.tar.gz 17.exit 18.adb install ZipSigner2.apk 19.adb push VpnFaker.apk /sdcard/VpnFaker_unsign.apk 20.เรียกโปรแกรม ZipSigner2 20.1 Input เป็น /sdcard

Export/Import Google Chrome Extensions

Image
เคยมั้ยที่ มีเหตุจำเป็นต้องเปลี่ยน User หรือปัญหาอื่น ๆ ที่ทำให้ต้องใช้งาน Chrome ใหม่ แต่ไม่มี Extension ที่ถูกใจตามมาด้วย ปัญหานี้แก้ไขได้ด้วยการ Export แล้วนำมา Import ใหม่ดังนี้ 1. Extensions ของ Google Chrome จะเก็บอยู่ที่ /home/user/.config/google-chrome/Default/Extensions สำหรับ Ubuntu และ C:\Documents and Settings\UserName\Local Settings\Application Data\Google\Chrome\User Data\Default สำหรับ Windows แต่จะเห็นว่ามันไม่ได้เก็บเป็นชื่อ Extensions แต่เป็นรหัสอะไรซักอย่าง 2.ใช้คำสั่งเพื่อดูรายละเอียดของ Extensions ดังนี้ 2.1 เปิดหน้า Extensions ขึ้นมา chrome://extensions/ 2.2 กดปุ่ม shift+ctrl+j 2.3 ป้อน code ดังนี้ returnExtensionsData=function(a){var o=[];for(var i=0,e=a.extensions,len=a.extensions.length;i 2.4 จะได้ผลลัพธ์ประมาณนี้ var extdata=[ {"id":"dabddpakolmhhlcblnooeacilidlbblh","name":"Publish sync for google+ & facebook"}, {"id":"lnlgojabfogikedjanecphloghlegpdm","name":"Phone 2 Google Chrome

Ubuntu with RAM 4GB

Image
ใช้งาน Ubuntu โดยที่มี RAM 2 GB มานาน วันดีคืนดีซื้อมาเพิ่มอีก 2 GB แทนที่จะเห็นเป็น 4 GB ดันเห็นแค่ 2.7 GB เอง พอลองเปิด Windows7 ดูบ้างก็เห็นเป็น 4 GB (Available 2.7 GB) เหมือนกัน พอค้นคว้าดูก็พบว่าเป็นข้อจำกัดของ OS 32 bit นี่เอง แต่สำหรับ Ubuntu มีทางแก้ไขคือ เปิดใช้งาน Physical Address Extension :PAE 1. ตรวจสอบก่อนว่า CPU เรา support มั้ย grep --color=always -i PAE /proc/cpuinfo ถ้าได้ผลก็ดำเนินการต่อได้ 2. ติดตั้ง Kernel สำหรับใช้งาน PAE sudo aptitude install linux-generic-pae linux-headers-generic-pae ที่มา : https://help.ubuntu.com/community/EnablingPAE