2013年2月28日 星期四
[轉]10个你可能不知道的ubuntu快捷键
1.前一个后一个工作区的切换
如果你经常使用工作区,那你就可以用Ctrl + Alt +上/下方向键很容易地进行切换。左箭头切换到上一个工作区,右箭头切换到下一个工作区。如果你安装了Compiz,可以用Super + E快捷键显示所有的工作区
2,把当前窗口移到另一个工作区
快捷键Shift+ Ctrl + Alt +左/右方向键让你很容易把当前窗口移到指定的工作区。这个快捷键和上面的快捷键很好配合。如果你工作时常常打开很多窗口,但又不想看到桌面和任务栏挤满程序,你可以用这个快捷键把程序移到另一个工作区,这样你的桌面就整洁多了
3,显示桌面
Ctrl + Alt + D快捷键让你很快地最小化所有窗口,看到桌面。当所有窗口都最小化后,你再按这个快捷键就可以恢复窗口原来的状态
4.鼠标右击的键盘快捷键
在大多数程序里,你可以右击显示快捷菜单。其实键盘上 Shift + F10也能达到一样的效果
5,重启会话以从崩溃中恢复
ubuntu很少会完全崩溃。但如果它真的崩溃了,你可以按下Ctrl + Alt + Backspace来重启会话,恢复的可能达90%
6.快速锁定屏幕
如果你需要离开电脑一会儿,可以按下Ctrl + Alt + L很快地锁定屏幕,以防有人使用
7.反向切换窗口
Alt + Tab是切换窗口的快捷键。如果你再按下SHIft,你就可以反向切换窗口。这个快捷键很有用,当你Alt + Tab按得太快,错过了你想要切换的窗口,按一下shift就可以返回之前的窗口了
8,用方向键移动窗口
Alt+F7会激活移动窗口功能,用方向键(上,下,左,右)就可以移到窗口了。
9. 显示隐藏的文件
大多数情况下,你不需要在你的“家“目录中看到那些隐藏文件,但如果你有这个需要,你可以在Nautilus(ubuntu的文件管理器)下按Ctrl + H来显示隐藏文件
10.不用右击鼠标就能显示文件属性
想要查看文件/文件夹的一般做法是右击选择属性。现在你可以按下 Alt + Enter就能显示属性窗口了
当然,这些只是冰山一角。如果你想要知道更多快捷键,不只是ubuntu还包括Gmail, Google Search, Firefox以及其他软件,请访问Cheat Sheets页面。那里有9个pdf文档让你下载。
使用 Emacs 進行 Perl 開發
在 cperl mode中,如果能做到 code navigation的話,或至少能直接打開 module 的原始碼的話,會是很好的。
http://www.emacswiki.org/emacs/CPerlMode
這裏說使用ffap可以達到這個功能,試用後的確可以。
重點是,這個地方引用perl的方法寫得很好,兩人都對這個功能提出了解答,都用到 shell-command-to-string,寫得很優雅;
第一個作者對ffap的了解很深入,以及在lisp中處理文字、串列的方式非常熟悉
第二個作者將找不到檔案時的情況用nil往外傳,處理得很漂亮,並將大部分的處理在perl中完成,因此整體看來可讀性較高
http://www.emacswiki.org/emacs/CPerlMode
這裏說使用ffap可以達到這個功能,試用後的確可以。
重點是,這個地方引用perl的方法寫得很好,兩人都對這個功能提出了解答,都用到 shell-command-to-string,寫得很優雅;
第一個作者對ffap的了解很深入,以及在lisp中處理文字、串列的方式非常熟悉
第二個作者將找不到檔案時的情況用nil往外傳,處理得很漂亮,並將大部分的處理在perl中完成,因此整體看來可讀性較高
2013年2月25日 星期一
emacs中視窗的分割、配置、切換、捲動(2)
https://github.com/kiwanami/emacs-window-manager
感覺上日本人用 emacs 也用得滿出神入化的
http://sawfish.wikia.com/wiki/Subwm
這是把 emacs 當做 window manager 來著的,徹底擺脫 mouse...
感覺上日本人用 emacs 也用得滿出神入化的
http://sawfish.wikia.com/wiki/Subwm
這是把 emacs 當做 window manager 來著的,徹底擺脫 mouse...
2013年2月23日 星期六
win32/ubuntu平台上執行測試並將結果存成圖片(使用perl)
Win32 guitest
http://stackoverflow.com/questions/11219755/how-can-i-make-sure-i-take-the-screenshot-of-a-specific-window-using-perls-imag
主要用的是guitest和imager兩個套件。 win32-guitest 的最新版 http://search.cpan.org/~karasik/Win32-GuiTest-1.60/
ubuntu: libx11-guitest-perl
http://search.cpan.org/~pecastro/X11-GUITest-0.27/GUITest.pm
ubuntu等系統有類似win32 guitest的套件叫 libx11-guitest-perl ,在 http://sourceforge.net/projects/x11guitest/;不過使用的人好像不多…也對,linux平台上,軟體的source都公開了,直接從source做測試不就好了…
桌面快照
http://search.cpan.org/~tonyc/Imager-Screenshot/Screenshot.pm
這就要用cpanplus來安裝了,模組名為 Imager::Screenshot
範例
http://blog.alternation.net/automatic-thumbnails-of-web-sites
寫得不錯,不過我比較想看到一些處理 timeout和mouse click的例子
http://www.ibm.com/developerworks/cn/opensource/os-thinkpad/
這篇就寫得真的很好
2013年2月15日 星期五
在emacs上用gnus收信、讀新聞群組的~/.authinfo設定
machine foo.bar.com login your_username password your_pass
_________________________________________________
參
http://www.emacswiki.org/emacs/GnusTutorial http://ann77.emacser.com/Emacs/EmacsEmail.html http://www.lirui.name/upload/144.Emacs+Gnus.pdf ==>寫得很好,附圖
http://floss.zoomquiet.org/data/20101130102435/index.html
http://hi.baidu.com/corelchen/item/618b00a3ed9ab4d95af19113
http://www.ibm.com/developerworks/cn/linux/l-cn-emacsgnus/index.html
http://navyliu.blog.edu.cn/2008/163965.html
在emacs上用gnus收信、讀新聞群組的~/.gnus.el設定
參 http://whereofwecannotspeak.wordpress.com/2009/07/15/getting-gnus-to-read-mail-over-imap/
http://srlog.blogspot.com/2012/04/yahoo-mail-free-imap.html
_________________________________________________
(setq user-mail-address "user@yahoo.com.tw")
(setq user-full-name "name")
;; GMANE is about the only free news server I've seen.
;; I set it to my primary server so I can read a few Free software mailing lists.
(setq gnus-select-method
'(nntp "news.gmane.org"))
;; Mostly, though, I just want to read my mail.
;; This setup uses a standard SSL-based connection to read the mail for the accounts I have through
;; UC Berkeley:
(setq gnus-secondary-select-methods
'((nnimap "yahoo mail" ; primary email
(nnimap-address "imap.mail.yahoo.com")
(nnimap-server-port 993)
(nnimap-authenticator login)
(nnimap-expunge-on-close 'never)
(nnimap-stream ssl))
; (nnimap "ocf" ; secondary account
; (nnimap-address "mail.ocf.berkeley.edu")
; (nnimap-server-port 993)
; (nnimap-authenticator login)
; (nnimap-expunge-on-close 'never)
; (nnimap-stream ssl))
)
)
http://srlog.blogspot.com/2012/04/yahoo-mail-free-imap.html
_________________________________________________
(setq user-mail-address "user@yahoo.com.tw")
(setq user-full-name "name")
;; GMANE is about the only free news server I've seen.
;; I set it to my primary server so I can read a few Free software mailing lists.
(setq gnus-select-method
'(nntp "news.gmane.org"))
;; Mostly, though, I just want to read my mail.
;; This setup uses a standard SSL-based connection to read the mail for the accounts I have through
;; UC Berkeley:
(setq gnus-secondary-select-methods
'((nnimap "yahoo mail" ; primary email
(nnimap-address "imap.mail.yahoo.com")
(nnimap-server-port 993)
(nnimap-authenticator login)
(nnimap-expunge-on-close 'never)
(nnimap-stream ssl))
; (nnimap "ocf" ; secondary account
; (nnimap-address "mail.ocf.berkeley.edu")
; (nnimap-server-port 993)
; (nnimap-authenticator login)
; (nnimap-expunge-on-close 'never)
; (nnimap-stream ssl))
)
)
使用WWW-Mechanize-Firefox取得sciencedirect頁面資訊
use WWW::Mechanize::Firefox;
use Data::Dumper;
use Test::More;
local $Data::Dumper::Terse = 1;
my $mech = WWW::Mechanize::Firefox->new(
tab => qr/^ScienceDirect/,
);
diag $_->{tagName} .":". $_->{id}#.":". $_->{class}#.":". $_->{class} #. "\n"
for $mech->document->__xpath('/html/BODY/div');
print "_____export bib / save pdf\n";
diag $_->{tagName} .":". $_->{id} .":". $_->{innerHTML}
for $mech->document->__xpath('/html/BODY/div[@id="page-area"]/div[@id="articleToolbar"]/div[@id="articleNav"]/ul/li[position()=2 or position()=3]');
print "_____bib _____\n";
diag $_->{tagName} .":". $_->{id} .":". $_->{innerHTML}
for $mech->document->__xpath('/html/BODY/div[@id="page-area"]/div[@id="rightPane"]/div[@id="rightInner"]/div[@id="ui-accordion-rightInner-panel-0"]/div/dl/*');
print "_____html article_____\n";
diag $_->{tagName} .":". $_->{id}
for $mech->document->__xpath('/html/BODY/div[@id="page-area"]/div[@id="centerPane"]/div[@id="centerInner"]/*');
use Data::Dumper;
use Test::More;
local $Data::Dumper::Terse = 1;
my $mech = WWW::Mechanize::Firefox->new(
tab => qr/^ScienceDirect/,
);
diag $_->{tagName} .":". $_->{id}#.":". $_->{class}#.":". $_->{class} #. "\n"
for $mech->document->__xpath('/html/BODY/div');
print "_____export bib / save pdf\n";
diag $_->{tagName} .":". $_->{id} .":". $_->{innerHTML}
for $mech->document->__xpath('/html/BODY/div[@id="page-area"]/div[@id="articleToolbar"]/div[@id="articleNav"]/ul/li[position()=2 or position()=3]');
print "_____bib _____\n";
diag $_->{tagName} .":". $_->{id} .":". $_->{innerHTML}
for $mech->document->__xpath('/html/BODY/div[@id="page-area"]/div[@id="rightPane"]/div[@id="rightInner"]/div[@id="ui-accordion-rightInner-panel-0"]/div/dl/*');
print "_____html article_____\n";
diag $_->{tagName} .":". $_->{id}
for $mech->document->__xpath('/html/BODY/div[@id="page-area"]/div[@id="centerPane"]/div[@id="centerInner"]/*');
訂閱:
文章 (Atom)
