August 5, 2016

 

tmux experience

Recently I found tmux. This is a best thing if you manage to work with your server in ssh console on a bad connection or from time to time and would like to save the entire context of what you are doing. For example, you compile kernel and went take a coffee, then back and connection dropped. If you used tmux simply attach to session:
$ tmux a
Need (like me) several consoles? (It's for sure more verbose than to have nohup or Ctrl-z; bg)
<Ctrl-b> , enter "new" <Enter>
For a list of sessions:
<Ctrl-b> , s
(then select from stable list - meaning you remember that for example your unprivileged session is always third one, and first two is sudoed root ones). Example (selected 2nd):
(0) + 0: 1 windows
(1) + 2: 1 windows
(2) + 3: 1 windows (attached)
The only not a good (yet) thing is scroll up as it needs 2 more keys:
<Ctrl-b>, [, then <PgUp/Down> or Arrows
Have fun!

Labels: , , ,

January 14, 2011

 

mysql config bind local replace script

AS IS! No guarantee.

-- bind-local-replace.sh
#!/bin/bash
sed -e '/^bind[-]address*/ s/^/#/' | sed '/[[]mysql[]]/a \
bind-address=127.0.0.1
'


--
Usage:
./bind-local-replace.sh < /etc/my.cnf > /tmp/my.cnf

and then manually check and then copy:
cp /tmp/my.cnf /etc/my.cnf

Labels: , , , ,

June 28, 2009

 

[solaris] LSOF substitute

lsof sometimes cannot work OK for TCP information after kernel updates on solaris (10, both sparc and x86). The reason is that kernel data scructures changes. So if you cannot recompile, i recommend in case of port-PID mapping to use such a simple script: http://www.unix.ms/pcp/. Tried it, works ok.
PS Mac users, try it plz?
PPS: Local copy: pcp.sh

Labels: , , ,

This page is powered by Blogger. Isn't yours?