Export/Import Google Chrome Extensions

เคยมั้ยที่ มีเหตุจำเป็นต้องเปลี่ยน 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 ดังนี้

1
returnExtensionsData=function(a){var o=[];for(var i=0,e=a.extensions,len=a.extensions.length;i<len;i++){o.push({id:e[i].id,name:e[i].name});}console.log('var extdata='+JSON.stringify(o)+';');};requestExtensionsData();

2.4 จะได้ผลลัพธ์ประมาณนี้

1
2
3
4
var extdata=[
{"id":"dabddpakolmhhlcblnooeacilidlbblh","name":"Publish sync for google+ & facebook"},
{"id":"lnlgojabfogikedjanecphloghlegpdm","name":"Phone 2 Google Chrome™"},
{"id":"oadboiipflhobonjjffjbfekfjcgkhco","name":"Google Chrome to Phone Extension"}];

3.จากขั้นตอนที่ผ่านมาจะเห็นว่า id จะตรงกับชื่อ folder ที่นี้ก็ดูตรง name ซึ่งเป็นชื่อ Extension ก็ไป copy folder นั้นมา แล้วก็คลิกตรง “Load unpacked extension… แล้ว browse ไป folder ที่เรา copy มา ก็เป็นอันเสร็จเรียบร้อย

ที่มา : http://superuser.com/questions/154770/how-to-export-extensions-of-google-chrome

Written by Komkid on January 23rd, 2012 with no comments.
Read more articles on IT Tips and JavaScript and Software.

Ubuntu with RAM 4GB

ใช้งาน 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 :P AE

1. ตรวจสอบก่อนว่า CPU เรา support มั้ย

1
grep --color=always -i PAE /proc/cpuinfo

ถ้าได้ผลก็ดำเนินการต่อได้

2. ติดตั้ง Kernel สำหรับใช้งาน PAE

1
sudo aptitude install linux-generic-pae linux-headers-generic-pae

ที่มา : https://help.ubuntu.com/community/EnablingPAE

Written by Komkid on January 23rd, 2012 with no comments.
Read more articles on IT Tips and Ubuntu.

Chrome to Phone to Chome

หลายครั้งที่เจอเว็บดีตอนที่ใช้ Android อยากเอาไปเปิดในคอมฯ แต่ต้องเสียเวลาพิมพ์ใหม่ บางทีเจอ link หรือ App ดี ๆ ตอนอยู่ในคอมฯ จะส่งไป Android ก็ต้องพิมพ์ใหม่อีก ตอนนี้หมดปัญหาแล้ว ด้วยตัวช่วย 2-3 ตัวนี้
1.Phone 2 Chrome : App สำหรับ Android เอาไว้ส่ง link จากโทรศัพท์ไป Chrome ซึ่งต้องอาศัย ข้อ 2. ช่วยด้วย

2.Phone 2 Google Chrome™ : Extension ซึ่งหาได้จาก Web store

ซึ่ง 2 ตัวนี้จะทำงานผ่านบริการของ dropbox ใครที่ยังไม่มีก็สมัครได้เลยครับ (สมัคร dropbox อิอิ)
ใน Android เวลาจะ share อะไร มันก็จะมี Phone 2 Chrome ให้เลือก ใน Google Chrome ก็จะมีปุ่มรูปโทรศัพท์อยู่ข้าง ๆ ช่องป้อน url

ต่อไปก็เป็นการส่งจากคอมฯไปหา Android ซึ่งสองตัวนี้ใช้บริการของ Google ได้เลย
3.Google Chrome to Phone Extension : Extension สำหรับ Chrome ที่คลิกแล้วจะส่ง link ไปให้ Android ใน Chrome ก็จะมีปุ่มรูปโทรศัพท์โผล่มาอีกอันนึง โดยใน Android จะต้องติดตั้ง app ข้อ 4. ไว้

4.Khrome to Phone : App สำหรับรับ link ที่ส่งมาจาก Chrome (รองรับ foxtophone กรณีที่ส่งจาก Firefox ด้วย)

เบ็ดเสร็จ Chrome ก็จะมี 2 ปุ่มนี้โผล่มาเอาไว้รับ-ส่งกับ Android

Written by Komkid on November 3rd, 2011 with no comments.
Read more articles on Android.

Ubuntu : Internet Sharing

#nano /etc/network/interfaces

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet static
address 192.168.1.10
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255
post-up /usr/local/bin/iptable.sh

#nano /usr/local/bin/iptable.sh

#!/bin/bash
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -F
iptables -t nat -F
iptables -t mangle -F
iptables -X
iptables -P FORWARD ACCEPT
iptables -t nat -A PREROUTING -i eth0 -p tcp –dport 80 -j REDIRECT –to-port 8080
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

#apt-get install squid3
#nano /etc/squid3/squid.conf

http_port 8080 transparent
acl localnet src 192.168.1.0/24
http_access allow localnet
http_access deny all

#apt-get install dnsmasq
#nano /etc/dnsmasq.conf

interface=eth1
dhcp-range=192.168.1.11,192.168.1.20,12h

script : share-net-script

Written by Komkid on July 7th, 2011 with no comments.
Read more articles on Internet and IT Tips and Ubuntu.

Axapta : Execute SQL command

Axapta มีคำสั่ง SQL รวมอยู่ใน X++ อยู่แล้ว
แต่ถ้าอยากใช้คำสั่ง SQL อื่น ๆ เช่น ใช้ประโยชน์จาก NewID() ของ MS SQL Server เพื่อ random ก็ทำได้ ดังตัวอย่าง

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
static void Job3(Args _args)
{
    LogInProperty   Lp = new LogInProperty();
    OdbcConnection  myConnection;
    Statement       myStatement;
    ResultSet       myResult;
    str             sqlQuery;
;

    sqlQuery = 'SELECT TOP 10 * FROM CustTable ORDER BY NewID()';

    LP.setServer("Server");
    LP.setDatabase("db");
    Lp.setUsername("user");
    Lp.setPassword("password");

    try{
        myConnection = new OdbcConnection(LP);
    }
    catch{
        info("Check username/password.");
        return;
    }

    myStatement = myConnection.createStatement();
    myResult = myStatement.executeQuery(sqlQuery);

    while (myResult.next()){
        box::info(myResult.getString(1));
    }
}

Written by Komkid on October 20th, 2010 with no comments.
Read more articles on Axapta and Database and Programming.

« Older articles

No newer articles