スキップしてメイン コンテンツに移動

dot.screenrc

screenの私的設定

# $Id: screenrc,v 1.15 2003/10/08 11:39:03 zal Exp $
#
# /etc/screenrc
#
#   This is the system wide screenrc.
#
#   You can use this file to change the default behavior of screen system wide
#   or copy it to ~/.screenrc and use it as a starting point for your own
#   settings.
#
#   Commands in this file are used to set options, bind screen functions to
#   keys, redefine terminal capabilities, and to automatically establish one or
#   more windows at the beginning of your screen session.
#
#   This is not a comprehensive list of options, look at the screen manual for
#   details on everything that you can put in this file.
#

# ------------------------------------------------------------------------------
# SCREEN SETTINGS
# ------------------------------------------------------------------------------
### escape charactor
escape ^t^t

### startup message
startup_message off
nethack on

#defflow on # will force screen to process ^S/^Q
deflogin on
###autodetach off
autodetach on

# turn visual bell on
###vbell on
vbell off
###vbell_msg "   Wuff  ----  Wuff!!  "

# define a bigger scrollback, default is 100 lines
defscrollback 1024

# ------------------------------------------------------------------------------
# SCREEN KEYBINDINGS
# ------------------------------------------------------------------------------

# Remove some stupid / dangerous key bindings
bind ^k
#bind L
bind ^\
# Make them better
bind \\ quit
bind K kill
bind I login on
bind O login off
bind } history

# An example of a "screen scraper" which will launch urlview on the current
# screen window
#
#bind ^B eval "hardcopy_append off" "hardcopy -h $HOME/.screen-urlview" "screen urlview $HOME/.screen-urlview"

# ------------------------------------------------------------------------------
# TERMINAL SETTINGS
# ------------------------------------------------------------------------------

# The vt100 description does not mention "dl". *sigh*
termcapinfo vt100 dl=5\E[M

# turn sending of screen messages to hardstatus off
hardstatus off
# Set the hardstatus prop on gui terms to set the titlebar/icon title
termcapinfo xterm*|rxvt*|kterm*|Eterm* hs:ts=\E]0;:fs=\007:ds=\E]0;\007
# use this for the hard status string
hardstatus string "%h%? users: %u%?"

# An alternative hardstatus to display a bar at the bottom listing the
# windownames and highlighting the current windowname in blue. (This is only
# enabled if there is no hardstatus setting for your terminal)
#
#hardstatus lastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<"

# set these terminals up to be 'optimal' instead of vt100
termcapinfo xterm*|linux*|rxvt*|Eterm* OP

# Change the xterm initialization string from is2=\E[!p\E[?3;4l\E[4l\E>
# (This fixes the "Aborted because of window size change" konsole symptoms found
#  in bug #134198)
termcapinfo xterm 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l'

# To get screen to add lines to xterm's scrollback buffer, uncomment the
# following termcapinfo line which tells xterm to use the normal screen buffer
# (which has scrollback), not the alternate screen buffer.
#
#termcapinfo xterm|xterms|xs|rxvt ti@:te@

# Enable non-blocking mode to better cope with flaky ssh connections.
defnonblock 5

# ------------------------------------------------------------------------------
# STARTUP SCREENS
# ------------------------------------------------------------------------------

# Example of automatically running some programs in windows on screen startup.
#
#   The following will open top in the first window, an ssh session to monkey
#   in the next window, and then open mutt and tail in windows 8 and 9
#   respectively.
#
# screen top
# screen -t monkey ssh monkey
# screen -t mail 8 mutt
# screen -t daemon 9 tail -f /var/log/daemon.log

hardstatus string "%-w%{=b}%n %t%{-}%+w"

このブログの人気の投稿

TeXマクロプログラミング

2012.03.30 更新 スライド化しました.   新しいマクロ定義 以下に例を示す. \dev\hoge{ほげ}    これにより,\hogeが「ほげ」に変換される.引数を使うには,以下のように記述する. \dev\hour#1{今は#1時です}   別の方法 上に示した処理は,以下のようにも記述できる. \newcommand{\hoge}{ほげ} \newcommand{\hour}[1]{今は#1時です}   defとnewcommand違い defとnewcommandが異なる箇所として,以下が上げられる. 定義命令を定義している処理系 マクロを多重定義した場合の動作 引数のとり方  まず,定義されている処理系が異なる.defはtexで定義されており,newcommandは,latexで定義されている.  次に,多重定義した際の動作が異なる.defでは,新しい定義で上書きする.一方,newcommandではエラーを出力する.  最後に,defでは,引数のとり方としてパターンマッチングを利用できる.例えば,以下のマクロ定義があるとする. \def\Hatchr(#1,#2)(#3,#4)#5 これにより,以下に示すインターフェイスを実現する. \Hatchr(3,4)(7,8){hoge}   マクロの複製 以下の処理では,\hogeの内容を\fugaに複製する. \let\fuga\hoge   マクロの初期化 以下のコードで,\hogeを初期化する. \let\fuga\relax  ここで,\relaxは初期化のために利用する空の定義である.   マクロに文字を追加し再定義 defによる定義は,マクロの多重展開をおこなわない.例えば,以下のコードを考える. \def\hoge{ほげ} \def\hoge{\hogeふぇふぇ}  この後,\hogeを利用すると「\hogeふぇふぇ」と展開される.つまり,一度だけしかマクロは展開されない.  マクロを展開してから定義する際には,以下の記述を用いる. \edef\hoge{\hogeふぇふぇ}  これに

beamerでしおりを付ける

しおり   しおりとは,acroreadなどでpdfを表示する際に,ウィンドウの左側に表示される目次のようなものである.このしおりを使うことで,文章の構成を大まかに把握したり,特定の項目に移動することが簡単にできる.   beamerには,標準でしおりを付ける機能が備わっている.以降では,しおりを付ける方法について述べる. しおりをつける   beamerでしおりを付けるには,次のコマンドをtexの文章中に記述する. section{} subsection{} subsubsection{}   カッコの中に記述する文字列が,しおりの項目名に使用される.また,section,subsection,subsubsectionを使い分けることで,階層化をすることも可能. 文字化け対策   しおりは,標準の仕様ではUnicodeのみがサポートされている.EUCを使う場合は,そのままではしおりの日本語が文字化けする.このため,Unicodeを用いない際には,何らかの対策が必要である.   以下では,EUCを利用する人のための対処策を述べる.ここで,dviからpdfを生成する際の方法によって,対処の仕方が異なることに注意する.具体的には,(1)dvipdfmxを用いる場合と,(2)dvipsおよびps2pdfを用いる場合で,対処の仕方が異なる.以降,それぞれについて述べる. dvipdfmxを用いる場合   次のコードをプリアンブルに記述しておくことで解決できる.これにより,しおりの部分の文字列が,自動でUnicodeに変換される. \ifnum 42146=\euc"A4A2 \AtBeginDvi{\special{pdf:tounicode EUC-UCS2}}\else \AtBeginDvi{\special{pdf:tounicode 90ms-RKSJ-UCS2}}\fi   ただし,実行にはEUC-UCS2というファイルが必要.texをインストールする際に,標準でシステムに入る場合はこのままコンパイルできるが,無ければコンパイルできない.私がこれまで経験したなかでは,Vine 5.0, Mac OSXには含まれているが,Debian lennyには入っていなかった.   システムにEUC-UCS2が無い場合,以下のようなサイトから取ってくる.取って

ssh-agentの管理を自動化する

ssh-start.sh ssh-agentの管理を自動化するスクリプトssh-start.shを紹介する. 詳細 ssh-agentを使うことで,sshでリモートログインする際に,パスワードの入力を省略できる. ssh-agentを利用するためには,ソケットのパスとプロセスIDを環境変数に登録する必要がある.環境変数に登録すべき情報は,ssh-agentの起動時に,以下のように標準出力に出力される. $ ssh-agent SSH_AUTH_SOCK=/tmp/ssh-XTqIvn4918/agent.4918; export SSH_AUTH_SOCK; SSH_AGENT_PID=4919; export SSH_AGENT_PID; echo Agent pid 4919; 上記のように,ssh-agentの出力はシェルコマンドとなっており,実行すれば環境変数がセットされる.このため,多くの解説記事では,次のようにevalを用いる方法が述べられている. $ eval `ssh-agent` Agent pid 4919 しかし,この方法は,同じssh-agentのプロセスを複数のシェルから利用することはできない.上記コマンドを他のシェル上でも実行すれば,動作はするが,次の点で優れた手法とは言えない. ssh-agentのプロセスを複数起動する (本来は1個で充分). 起動毎に秘密鍵の登録,およびパスフレーズの入力が必要となる. 上記の問題は解決するには,1個のssh-agentを複数のシェルから再利用すればよい.例えば2個のターミナルから1個のssh-agentプロセスを利用するには,次のようにする. # terminal 1 $ ssh-agent > ~/tmp.sh $ source ~/tmp.sh Agent pid 4919 # terminal 2 $ source ~/tmp.sh Agent pid 4919 こうすることで,2個のターミナルから同一プロセスのssh-agentを利用できる. 以上の処理を自動化したものが,ここで紹介するスクリプトである. 使い方 環境変数を扱かうため,通常のスクリプトのようには利用できない.このため,sourceコマンドや.(ドット)コマンドで実行する. $ source /path/to/dir/s