piyo's computer tips
2003/10/25
How to use screen part 3
Linux

Okay, I think I got the definition of screen wrong. It should be, the terminal multiplexer. Ha.

I figured out how to really set screen main control character:

# screen's shortcut entry character, cannot be set to ^Q
escape "^T^T"


And since I wanted to make the interface a little more familiar to my emacs-ways, I worked on some key redefinitions.

# make the interface like emacs
bind "x" command -c emacsx
bind "^X" command -c emacsx
bind -c emacsx "1" only
bind -c emacsx "2" split
bind -c emacsx "o" focus
bind -c emacsx "b" windowlist

# make the interface like windows
bind "c" copy
bind "^C" copy
bind "n" screen
bind "^n" screen

bind "v" paste .
bind "^v" paste .
bind "V" digraph


And what is a terminal without some color? This sets the status mode line to different colors depending on if it has the focus.

# Set the caption to something interseting
# dark gray with (active) white / (inactive) light gray
caption always "%{= Kw}%?%F%{..I}%:%{..i}%?%3n %t%? @%u%?%? %?%=%l %d%D%c "


Lastly, I love having a lot of history. I haven't yet hit a hard limit on memory usage. This setting below helps with scrollback selections as well.

# Save scroll history way way back
defscrollback 10000


Heck, I have a 20000 line history file for zsh. Maybe I should lower it.... Nah.
 
2003/10/23
How to use screen part 2
Linux

Screen is your emacs-like interface for remote terminal sessions. Somewhat.

However it uses the Control-A character as command. I frequently use minicom, which also uses the Control-A character. so I needed to remap it to Control-T. So this is what you put in ~/.screenrc :


# ^T instead of ^A as screen control character
bindkey -d "^T" command
bindkey -d "^A" meta
# ^a should act like
bind "^a" meta


Speaking of keys, here are some useful ones (using the above command prefix):
Control-T SPACE = next window
Control-T S = split window
Control-T Q = hide other windows
Control-T TAB = next split window
Control-T : = screen command line control

Also you may want to change the status information. I haven't yet found a way to let the window title prompts set by my zsh process pass through the screen's prompt settings... but this is a start.

#caption always "%{= bB} %3n %t%? @%u%?%? [%h]%?%=%c"
caption always "%{= bB}%?%F%{C} %3n %t%? @%u%?%? [%h]%?%=%c"
hardstatus on
hardstatus string ""


 
2003/10/10
My favorite windows apps, part 1
Windows

This recent thread has prompted me to list all the Windows apps I feel is useful. I carry a Smart Media USB card reader with about 60 MB worth of useful utilities:



Other stuff I use regularly but I don't need to bring with me:


 
2003/10/05
Linux: How to use screen

Screen helps you create "detachable views" of processes on your linux box.

For example, create a server process, such as top, as a detachable view:

screen -A -m -d -S top top

The bold part is standard options for creating a detachable view that will run automatically in the background. Now you can log out and back in, and see that it is still running:

screen -r top

What about listing which screens you are running? Just don't type anything after -r or if you really want to get pedantic:

screen -list

src: Windows that follow you
src: http://server.counter-strike.net/server.php?cmd=howto&show=screen
 
Windows: Postscript and ps2pdf

GhostScript, GhostView is the PS viewer.
And ps2pdf allows you to use the slick Adobe Acrobat 6 on your PostScript files. Here's some usage
 
2003/10/03
Bash: checking if scripts have a syntax error

To check if a bash script is free of syntax errors, call the script with a -n option.

bash -n there_is_no_error_here.sh
 
How I keep remembering new ways of using computers. My (computer-centric) new-optimization learning blog.

Name:
Location: Kobe, Hyogo, Japan
September 2003 / October 2003 / December 2003 / March 2004 / April 2004 / May 2004 / June 2004 / July 2004 / August 2004 / September 2004 / February 2005 / March 2005 / April 2005 / May 2005 / June 2005 / July 2005 / August 2005 / September 2005 / December 2005 / January 2006 / February 2006 / March 2006 / April 2006 /


Powered by Blogger