This is a list of the most useful keys/commands (IMHO) for tmux, a terminal multiplexer like the old screen.
Global config file: /etc/tmux.conf
Per-user config file: ~/.tmux.conf
Configuration options:
set-option -g prefix Ctrl-a # this will bind the Ctrl-a combination to the prefix key
set-option -g prefix ` # this will bind the ` key to the prefix key
setw -g monitor-activity on # mark visually the window that had activity on the status bar
set -g visual-activity on # pop a message in the status bar for the window that had activity
The default prefix, or the key that precedes the command is Ctrl-b
prefix c Create new window
prefix d Detach current client
prefix l Move to previously selected window
prefix n Move to the next window
prefix p Move to the previous window
prefix & Kill the current window
prefix , Rename the current window
prefix % Split the current window into two vertical panes
prefix q Show pane numbers (quickly press the number shown and you'll go to that pane)
prefix o Switch to the next pane
prefix ? List all keybindings
Window management:
prefix n Go to the next window
prefix p Go to the previous window
prefix l Go to the previous selected window
prefix w (List all windows / window numbers)
prefix window_number Go to the specified window number
prefix f Type the window name and tmux will try to find and switch to it
prefix { Move current pane to the left
prefix } Move current pane to the right
prefix space Rearrange windows (even-horizontal, even-vertical, main-horizontal, main-vertical and tiled)
prefix arrow_keys You can use the prefix key plus the up/right/down/left arrows to switch panes
prefix [ Enters copy mode so you can scroll up/down through that pane's terminal history (with Shift + PgUp/PgDown)
Command mode:
You can go into command mode by typing
prefix :
Inside command mode you can type whatever command tmux supports. One important tip here is that the command mode has a history function, so while inside you can use the up and down arrows to go through the history of commands you entered
A couple interesting commands are
rename-window name Rename current window
rename-session name Rename current session
break-pane Make the current pane into its own window
switch -t session_name Switch to the session named session_name
ls List sessions
After you have your client detached:
tmux new -s session_name Create a new session named session_name
tmux attach -t session_name Attach the client to the session named session_name (tip: you can type only a couple chars of the session name, tmux is intelligent enough to find out)
tmux ls This is the same as tmux list-sessions
I'm using squeeze which currently has the 1.3-2+squeeze1 version that has a little problem to properly draw the pane divisions on PuTTY so I installed a greater version from the squeeze-backports which is 1.4-6~bpo60+1 that correct this issue.
Extracted from the tmux changelog:
CHANGES FROM 1.3 TO 1.4, 27 December 2010
* Use UTF-8 line drawing characters on UTF-8 terminals, thus fixing some terminals (eg putty) which disable the vt100 ACS mode switching sequences in UTF-8 mode. On terminals without ACS, use ASCII equivalents.
Sunday, June 26, 2011
Sunday, June 19, 2011
ATI console framebuffer with Debian Squeeze
In order to have a native resolution console on ATI hardware you just need to install one package that adds KMS support:
sudo apt-get install xserver-xorg-video-ati
This installs some X.org related stuff but also a module that adds console framebuffer support on widescreen resolutions, etc etc.
The conf file is:
/etc/modprobe.d/radeon-kms.conf
Cheers
sudo apt-get install xserver-xorg-video-ati
This installs some X.org related stuff but also a module that adds console framebuffer support on widescreen resolutions, etc etc.
The conf file is:
/etc/modprobe.d/radeon-kms.conf
Cheers
Friday, June 17, 2011
Regex to match an integer/float with PHP and Javascript examples
A not so easy regex I was working with yesterday, it matches from the start of the line an integer or float.
For instance,
.23 and 0.23 matches
12. and 12.23 matches
12.asd23 will get the 12. part
asd.23 does not match
12.23.23 will get the 12.23 part
etc, etc ...
Now that I said that, here it goes:
PHP example to get the part of the string matched by the regex (using preg_match):
Javascript example:
For instance,
.23 and 0.23 matches
12. and 12.23 matches
12.asd23 will get the 12. part
asd.23 does not match
12.23.23 will get the 12.23 part
etc, etc ...
Now that I said that, here it goes:
PHP example to get the part of the string matched by the regex (using preg_match):
if (preg_match('/^(?:[\d]+|)(?:\.{1}(?:\d+)?)?/', $subject, $regs)) {
$result = $regs[0];
} else {
$result = false;
}
Javascript example:
result = subject.match(/^(?:[\d]+|)(?:\.{1}(?:\d+)?)?/g);
Tuesday, June 14, 2011
Update IP with custom DDNS on DD-WRT for DynDNS.com
I have DD-WRT on my Linksys WRT54GL and I needed to update my host IP with DynDNS.com but they did some changes recently and it wont update with the default DynDNS.org entry, so here is what you need to do:
And taken from the DD-WRT wiki, the following notes:
If static DNS is used, use statdns@dyndns.org instead of dyndns@dyndns.org.
Your ddns password should contain no spaces at the beginning or end of it.
Good luck ;-)
DDNS Service: Custom
Do not use external ip check: no
DYNDNS server: members.dyndns.org
User Name: put your dyndns username here
Password: put your dyndns password here
Host Name: the host you are trying to update, like myname.dyndns-server.com
URL: /nic/update?
Additional DDNS Options: --dyndns_system dyndns@dyndns.org --ip_server_name checkip.dyndns.org:8245 /
And taken from the DD-WRT wiki, the following notes:
If static DNS is used, use statdns@dyndns.org instead of dyndns@dyndns.org.
Your ddns password should contain no spaces at the beginning or end of it.
Good luck ;-)
Subscribe to:
Posts (Atom)
Followers
About me
- coke
- Santa Fe, Argentina
- Programador Web, PHP, MySQL, JQuery, Administrador Linux. LAMP, Lighttpd, Nginx.