2015年3月24日 星期二

[Tools] source insight tab 換 space

把tab鍵換成空白:

1. Options -> Document Options
2. 打勾 Expand tabs

2015年3月20日 星期五

[win7] 開啟測試模式

按一下[開始] 按紐,滑鼠右鍵點選[命令提示字元],選擇[以系統管理員身分執行]。
bcdedit /set testsigning on
重開機

2015年2月11日 星期三

[Mac] 重灌mac Yosemite


製作重灌USB碟

首先下載 Mac OS X Yosemite

接著在終端機執行

sudo /Applications/Install\ OS\ X\ Yosemite.app/Contents/Resources/createinstallmedia --volume /Volumes/目標磁碟名稱 --applicationpath /Applications/Install\ OS\ X\ Yosemite.app --nointeraction


重開機 按住鍵盤上的「Option」按鍵(alt)不放
選擇隨身碟開機



2014年12月25日 星期四

[ubuntu] 常用指令

觀看記憶體 free -m

 硬碟空間 df -h

 mount -t tmpfs -o size=2G tmpfs /tmp/

 格式化硬碟 指令為 mkfs -t ext4 /dev/sdc1

看cpu
 cat /proc/cpuinfo|grep "model name"

更改系統時間
sudo date -s 2015/06/03
sudo date -s 14:00:00
sudo hwclock --systohc --utc

2014年10月17日 星期五

[android] adb shell 送 intent


ex:
    adb shell am broadcast -a android.intent.action.xxx.xxx --ez state true

ON:
settings put global airplane_mode_on 1
am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true

OFF:
settings put global airplane_mode_on 0
am broadcast -a android.intent.action.AIRPLANE_MODE --ez state false

am broadcast [--user <USER_ID> | all | current] <INTENT>

am broadcast: send a broadcast Intent.  Options are:
    --user <USER_ID> | all | current: Specify which user to send to; if not
        specified then send to all users.
    --receiver-permission <PERMISSION>: Require receiver to hold permission.


<INTENT> specifications include these flags and arguments:
    [-a <ACTION>] [-d <DATA_URI>] [-t <MIME_TYPE>]
    [-c <CATEGORY> [-c <CATEGORY>] ...]
    [-e|--es <EXTRA_KEY> <EXTRA_STRING_VALUE> ...]
    [--esn <EXTRA_KEY> ...]
    [--ez <EXTRA_KEY> <EXTRA_BOOLEAN_VALUE> ...]
    [--ei <EXTRA_KEY> <EXTRA_INT_VALUE> ...]
    [--el <EXTRA_KEY> <EXTRA_LONG_VALUE> ...]
    [--ef <EXTRA_KEY> <EXTRA_FLOAT_VALUE> ...]
    [--eu <EXTRA_KEY> <EXTRA_URI_VALUE> ...]
    [--ecn <EXTRA_KEY> <EXTRA_COMPONENT_NAME_VALUE>]
    [--eia <EXTRA_KEY> <EXTRA_INT_VALUE>[,<EXTRA_INT_VALUE...]]
    [--ela <EXTRA_KEY> <EXTRA_LONG_VALUE>[,<EXTRA_LONG_VALUE...]]
    [--efa <EXTRA_KEY> <EXTRA_FLOAT_VALUE>[,<EXTRA_FLOAT_VALUE...]]
    [-n <COMPONENT>] [-f <FLAGS>]
    [--grant-read-uri-permission] [--grant-write-uri-permission]
    [--debug-log-resolution] [--exclude-stopped-packages]
    [--include-stopped-packages]
    [--activity-brought-to-front] [--activity-clear-top]
    [--activity-clear-when-task-reset] [--activity-exclude-from-recents]
    [--activity-launched-from-history] [--activity-multiple-task]
    [--activity-no-animation] [--activity-no-history]
    [--activity-no-user-action] [--activity-previous-is-top]
    [--activity-reorder-to-front] [--activity-reset-task-if-needed]
    [--activity-single-top] [--activity-clear-task]
    [--activity-task-on-home]
    [--receiver-registered-only] [--receiver-replace-pending]
    [--selector]
    [<URI> | <PACKAGE> | <COMPONENT>]

2014年10月15日 星期三

[ubuntu] VIM 用法

選取
v 小寫

選取後可用以下方式操作:
d 刪除選取區內容。
y 複製選取區內容。


/etc/vim/vimrc
插入space取代Tab
:set expandtab

Tab = 4 space
:set tabstop=4

程式縮排需要space的個數
:set shiftwidth=4

:w 令存新檔

[ubuntu] Byobu

F2 - Create a new window
F3 - Move to previous window
F4 - Move to next window
F6 - Detach from this session
F7 - Enter copy/scrollback mode
F8 - Re-title a window
F9 - Configuration Menu
F12 - Lock this terminal

alt + page up 往上捲動視窗
alt + page down 往下捲動視窗

Q: Putty 中使用Byobu F2~F4無效 
Ans: "Terminal" -> "Keyboard" -> "The Function keys and keypad" 選用 "Xterm R6" 便可。