參考
- 8月 14 週日 201616:38
Amazon Drive
- 6月 02 週四 201609:34
sed優化
參考
可以考慮在替換命令(「s/.../.../」)前面加上地址表達式來提高速度。
sed 's/foo/bar/g' filename # 標準替換命令
sed '/foo/ s/foo/bar/g' filename # 速度更快
sed '/foo/ s//bar/g' filename # 簡寫形式
可以考慮在替換命令(「s/.../.../」)前面加上地址表達式來提高速度。
sed 's/foo/bar/g' filename # 標準替換命令
sed '/foo/ s/foo/bar/g' filename # 速度更快
sed '/foo/ s//bar/g' filename # 簡寫形式
- 3月 31 週四 201617:38
確認筆電是否支援Wifi 5GHz訊號
參考
cmd下
#netsh wlan show drivers
看Radio types supported這項
( 中文譯:支援的無線電波類型 )
如果沒有 802.11a
即此無線網卡不支援5GHz..........QQ
cmd下
#netsh wlan show drivers
看Radio types supported這項
( 中文譯:支援的無線電波類型 )
如果沒有 802.11a
即此無線網卡不支援5GHz..........QQ
- 3月 29 週二 201609:57
Intel Edison 固定IP
參考
# vi /etc/wpa_supplicant/wpa_cli-actions.sh
---------------------------------------------------------------------
第四十七行左右
if [ "$CMD" = "CONNECTED" ]; then
kill_daemon udhcpc /var/run/udhcpc-$IFNAME.pid
-# udhcpc -i $IFNAME -p /var/run/udhcpc-$IFNAME.pid -S
+ ifconfig $IFNAME 192.168.200.200 netmask 255.255.255.0
fi
-------------------------------------------------------------------------------------
重開機後可以用
#wpa_cli status
檢查連的SSID
#ifconfig
IP設定狀態
# vi /etc/wpa_supplicant/wpa_cli-actions.sh
---------------------------------------------------------------------
第四十七行左右
if [ "$CMD" = "CONNECTED" ]; then
kill_daemon udhcpc /var/run/udhcpc-$IFNAME.pid
-# udhcpc -i $IFNAME -p /var/run/udhcpc-$IFNAME.pid -S
+ ifconfig $IFNAME 192.168.200.200 netmask 255.255.255.0
fi
-------------------------------------------------------------------------------------
重開機後可以用
#wpa_cli status
檢查連的SSID
#ifconfig
IP設定狀態
- 3月 04 週五 201609:02
Python + Speednet
- 4月 20 週一 201516:52
將圖片和mp3合併輸出成mp4
- 2月 08 週日 201500:27
MySQL index
參考一
參考二
MySQL建立index可以加快搜尋(select)的速度
但相對的,在新增(insert)、刪除(delete)資料會變慢
參考二
MySQL建立index可以加快搜尋(select)的速度
但相對的,在新增(insert)、刪除(delete)資料會變慢
- 1月 15 週四 201515:18
Python3 http.server
- 1月 09 週五 201510:59
Python qrtools
參考
只支援Python2
Python3不支援
Ubuntu上安裝方式
#sudo add-apt-repository ppa:qr-tools-developers/daily
#sudo apt-get update
#sudo apt-get install python-qrtools
裝好後
進入python cli
>>>import qrtools
確認沒問題就成功了
只支援Python2
Python3不支援
Ubuntu上安裝方式
#sudo add-apt-repository ppa:qr-tools-developers/daily
#sudo apt-get update
#sudo apt-get install python-qrtools
裝好後
進入python cli
>>>import qrtools
確認沒問題就成功了
- 12月 02 週二 201413:40
boto module of Python3
參考1
On Ubuntu
If U use python3 instead of python
#sudo apt-get install python3-pip
#pip3 install boto
#vi ~/.boto
-----------------------------------------
[Credentials]
aws_access_key_id = <Your Key Id>
aws_secret_access_key = <Your Secret Key>
-----------------------------------------
#vi aws.py
----------------------------------------
#!/usr/bin/python3
import boto.ec2
conn = boto.ec2.connect_to_region('ap-southeast-1')
print(conn.get_all_reservations())
-----------------------------------------
#stop instance:i-8xxxx
a=['i-8xxxx']
print(conn.stop_instances(a))
#start instance:i-8xxxx
a=['i-8xxxx']
print(conn.start_instances(a))
#get instance: i-3686d661 state
#get_only_instances回傳boto.ec2.instance.Instance的list
#而boto.ec2.instance.Instance有state的屬性
print(conn.get_only_instances('i-3686d661')[0].state)
On Ubuntu
If U use python3 instead of python
#sudo apt-get install python3-pip
#pip3 install boto
#vi ~/.boto
-----------------------------------------
[Credentials]
aws_access_key_id = <Your Key Id>
aws_secret_access_key = <Your Secret Key>
-----------------------------------------
#vi aws.py
----------------------------------------
#!/usr/bin/python3
import boto.ec2
conn = boto.ec2.connect_to_region('ap-southeast-1')
print(conn.get_all_reservations())
-----------------------------------------
#stop instance:i-8xxxx
a=['i-8xxxx']
print(conn.stop_instances(a))
#start instance:i-8xxxx
a=['i-8xxxx']
print(conn.start_instances(a))
#get instance: i-3686d661 state
#get_only_instances回傳boto.ec2.instance.Instance的list
#而boto.ec2.instance.Instance有state的屬性
print(conn.get_only_instances('i-3686d661')[0].state)
