2015年4月3日 星期五

[轉貼/筆記]linux screen使用方法

screen的全名叫做(full-screen window manager),是在Linux or BSD上一個很好用的工具,可以讓你在一個terminal下開啟多重視窗執行,讓你只要靠一個putty/pietty視窗就可以同步地處理很多的事情,視窗彼此的切換又很方便迅速,有點像瀏覽器的「分頁」功能一樣。

例如說你可以開一個視窗正在compile程式,另開一個視窗開vim看code,再開第三個視窗連ftp抓一個大檔,最後再開一個視窗用偷偷telnet連BBS逛PTT這樣(最後一個上班不要亂用,視窗間可以隨時用熱鍵切換,彼此卻又運作順暢互不干擾。


screen 操作指令表

screen 參數說明
Ctrl + a 與 c建立新 screen 視窗
Ctrl + a 與 Ctrl + a切換至上一個 screen 視窗
Ctrl + a 與數字鍵 0 到 9切換至指定編號的 screen 視窗
Ctrl + a 與 n切換至下一個的 screen 視窗
Ctrl + a 與 p切換至下一個的 screen 視窗
Ctrl + a 與 w列出目前所有的 screen 視窗
Ctrl + a 與 "列出目前所有的 screen 視窗,並可用上下鍵選擇要切換的設窗
Ctrl + a 與 k關閉目前的 screen 視窗
Ctrl + a 與 d卸離 screen 工作環境
Ctrl + a 與 Esc 鍵(或Ctrl + a 與 [進入複製模式(copy mode),可用方向鍵操作捲軸,或用 / 與 ? 來搜尋,按下空白鍵開始選取要複製的內容,選取完成後再按下第二次空白鍵,即可複製,隨後使用 Ctrl + ] 可貼上複製的內容。
Ctrl + a 與 S將畫面分割成上下兩個區域
Ctrl + a 與 Q關閉分割畫面
Ctrl + a 與 Tab 鍵切換分割畫面
Ctrl + a 與 t顯示目前系統的時間與負載狀況
Ctrl + a 與 a送出 Ctrl + a
Ctrl + a 與 ?顯示說明
Ctrl + a 與 v顯示版本資訊
Ctrl + a 與 x鎖定 screen 螢幕
Ctrl + a 與 H開啟或結束 screen 紀錄功能
Ctrl + a 與 C清除 screen 視窗中的內容
Ctrl + aD 與 D強力卸離,卸離 screen 工作環境之後,直接登出
Ctrl + a 與 Ctrl + g視覺化鈴聲(visual bell)切換
Ctrl + a 與 i顯示目前 screen 視窗的資訊
Ctrl + a 與 l重繪目前 screen 視窗的內容

資料來源:


2015年3月27日 星期五

[Tool]Windows檔案總管進化版(Clover & Q-Dir)

Windows中開啟多個檔案總管視窗,在工具列上會有一疊的視窗,切換視窗時必須慢慢找,工作效率超差。

希望檔案總管視窗可以像Chorme瀏覽器一樣有分頁功能、甚至是書籤等功能!


以下是兩個看似不賴的tool官方介紹、圖片與連結

1.「Clover」:http://cn.ejie.me/#

為您的 Windows Explorer 插上翅膀!

Clover 是Windows Explorer 資源管理器的一個擴展,為其增加類似谷歌Chrome 瀏覽器的多標籤頁功能。

Q-Dir (the Quad Explorer) makes your files and folder easy to manage, as an installed or portable Windows program. Fast and easy access to your hard disks, network folders, USB-Stiks, floppy disks and other storage devices.

Q-Dir i a good file manager with an amazing Quadro-View technique.
You don't have to renounce the usual, Drag and Drop, all Views, and other functions of your system.



2015年2月6日 星期五

你無法安裝Windows 10 Technical Preview,因為您的處理器不支援CompareExchange128

將VirtualBox 4.3.20中的win7升級到Win10 Technical Preview遇到了如下的error


解決方法如下圖


1.到host主機(非VM中)的命令列中,切換到virtual安裝資料夾
2.輸入vboxmanage setextradata Win7(VM名稱) VBoxInternal/CPUM/CMPXCHG16B 1

2014年12月18日 星期四

[Tool]測試網站是否被萬里長城GFW 封鎖 ??



Checks whether a site is blocked by the Great Firewall of China.

http://www.viewdns.info/chinesefirewall/

2014年11月22日 星期六

使用google analytics統計ajax內容重載

1.在js中加入

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXX']);
_gaq.push(['_trackPageview']);

(function() {
  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

2.在ajax function的success中加入


    _gaq.push(['_setAccount', 'UA-XXXXXX']);
    _gaq.push(['_trackPageview']);

在aws ec2 使用php mail功能寄信(ubuntu 14.04)

1.確認port 25沒被擋:

在VPC中的subnets與Security Groups確認SMTP (25) outbound 是否有開啟?



2.安裝 snedmail:

sudo apt-get install sendmail


參考資料:
http://stackoverflow.com/questions/19858457/send-mail-using-amazon-ec2-instance

2014年11月19日 星期三

mobile-friendly pages (defined by Google)

Google 將在行動裝置搜尋結果,加入mobile-friendly標籤。

符合以下條件會被加入標籤:
  • Avoids software that is not common on mobile devices, like Flash
  • Uses text that is readable without zooming
  • Sizes content to the screen so users don't have to scroll horizontally or zoom
  • Places links far enough apart so that the correct one can be easily tapped

Google測試:

Mobile-Friendly Test


資料來源:

Helping users find mobile-friendly pages