tmux – screen like terminal multiplexer

I used screen for a while now and really liked it, but I could never remember how to use the split screen windows, so I just kept using the simplest screen commands.

- create, close window
- switch windows
- detach and reattach

But then Derek told me about tmux. I tried it with this YouTube Howto Video:

How to use tmux (the terminal multiplexer)

It’s really easy and with this short .tmux.conf that Derek sent to me, the basic controls are even similar to screen.

# Make it use C-a, similar to screen..
unbind C-b
unbind l
set -g prefix C-a
bind-key C-a last-window

So, here the basic commands and what they do!

C-a - basic prefix for commands
C-a c - create new normal window
C-a " - create new split screen window
C-a SPACE - change split screen layout
C-a ARROWKEYS - switch between the split screens
C-a C-a - switch between normal windows, NOT the split screens
C-a 0-9 - switch to the specific window, NOT the split screens
C-a q - show the number of the split screens in the active window
C-a d - detach active tmux session

Show all active tmux sessions

tmux list-sessions
0: 2 windows (created Mon Nov  7 09:58:42 2011) [177x52]
1: 2 windows (created Mon Nov  7 13:16:07 2011) [177x52]

Re-attach to a specific tmux session

tmux attach -t 0
Geschrieben am: 07.11.2011 - 23:26 Uhr
Zeit in Vancouver: 07.11.2011 - 14:26 Uhr

Howto use the CentOS Firewall/iptables

Actually the implementation of iptables is easier to handle on CentOS, compared to Debian.

They created three small scripts, that makes it quite easy to handle.

iptables-save
iptables-restore
service iptables save

Of course you still use the usual iptables syntax like this:

iptables -A INPUT -p tcp -s 192.168.0.0/24 --dport 22 -j ACCEPT

After you added some rules, you simply can export your iptables config:

iptables-save > firewall.txt

It will look similar to this one:

# Generated by iptables-save v1.4.7 on Mon Nov  7 12:11:59 2011
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [23:6016]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -s 192.168.1.0/24 -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -s 192.168.1.0/24 -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
# Completed on Mon Nov  7 12:11:59 2011

Just add, change or delete rules and re-import the file!

iptables-restore < firewall.txt

Try if the configuration is working and if you want to keep it on the next reboot just type:

//UPDATE:
Oh there was a little mistake in the code. In addition, today I had a problem with the new installed CentOS 6, where the restore command didn’t work properly, because not all the rules were applied. For that I figured out I had to update the system with a simple “yum update”. Seems like there was a corrupt package on my install CD.

service iptables save

Thx, to Derek for the explanations.

Geschrieben am: 07.11.2011 - 22:51 Uhr
Zeit in Vancouver: 07.11.2011 - 13:51 Uhr

Search for Perl modules with yum

I was about to install OTRS on a CentOS6 and for this I have to install several Perl modules. It’s always annoying to find the right packages for this, so I asked Google and found this pretty possibility to search for Perl modules directly in yum.

For example:

yum provides "perl(XML::Parser)"

The output would be:

Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
 * base: mirror.its.sfu.ca
 * epel: linux.mirrors.es.net
 * extras: mirror.its.sfu.ca
 * rpmforge: fr2.rpmfind.net
 * updates: mirror.its.sfu.ca
perl-XML-Parser-2.36-7.el6.i686 : Perl module for parsing XML files
Repo        : base
Matched from:
Other       : perl(XML::Parser)

Really nice!

Geschrieben am: 07.11.2011 - 21:30 Uhr
Zeit in Vancouver: 07.11.2011 - 12:30 Uhr

Diary Update # 14 First week of Internship

Hey there,

i finished my first week of the internship and I like it. =) There are very nice co-workers and my tasks hopefully will be more related to server administration in the next weeks. This week I started with creating diagrams about the ethernet network in the server room and also of the power connections. Next steps will be a new or updated kind of server inventory. I’m really looking forward to the next weeks and my tasks, I’ll keep you updated for all the interesting things :)

Topic change!

Have you ever heard about “Poutine”?

Than take a look here:

German:
http://de.wikipedia.org/wiki/Poutine
English:
http://en.wikipedia.org/wiki/Poutine

It’s awesome :D so if you ever come to Canada or especially Vancouver. Try Poutine! So far I can recommend the one at the Donnelly’s Pub Chain, like “Cinema Public House” at Granville and Smithe Street, or the “Fritz” store at Granville and Drake Street. Don’t try the Poutine at A&W, because there you really should try the Hamburgers and not the Poutine :D

See you! :)

Geschrieben am: 05.11.2011 - 11:52 Uhr
Zeit in Vancouver: 05.11.2011 - 2:52 Uhr

Diary Update # 13 Last Day At ILAC!

Hey guys,

long time no see :) – Some new information from my stay in Vancouver, Canada!
I’m here for 8 weeks now and I successfully completed the first part of my stay, the ILAC language school.

Yesterday was my last day of school in ILAC – It was perfectly timed, ILAC had the Halloween Party on the SAME!!! day. So class ended at 11:45am and at 12 noon the Halloween Party started and at 2:15pm they started the graduation ceremony, where I got my certificate. I’ll add photos of it later!

Later that same day we went to the SKYTRAIN HALLOWEEN PARTY!

See the video and some photos here: http://epis.ch/ct

Next week I start with the internship programm at pro.NET a web design, development and hosting company.

Stay tuned for new information! I hope I can write more often and with less text ;)

Geschrieben am: 29.10.2011 - 22:45 Uhr
Zeit in Vancouver: 29.10.2011 - 13:45 Uhr

Mein Auslandstagebuch # 12 The worlds best steak!

Sunday evening I ate the best Steak ever. A honey roasted garlic top sirloin, served with broccoli and a stuffed baked potato filled with a blend of cream cheese, green onion and bacon.

The picture is bad quality, i know.

NOMNOMNOM! :D

Geschrieben am: 28.09.2011 - 5:59 Uhr
Zeit in Vancouver: 27.09.2011 - 20:59 Uhr

Mein Auslandstagebuch # 11 last week

Last week nothing special happened, so just a very short post now ;) . Besides the school, I went to the PUB NIGHT on Wednesday, where we had a lot of fun :) . I visited Metrotown twice, there is a big shopping mall, but I didn’t buy anything :D . So stay tuned :P

PS: new pictures of the rafting trip will follow in the post before this one!

Geschrieben am: 28.09.2011 - 4:37 Uhr
Zeit in Vancouver: 27.09.2011 - 19:37 Uhr

Mein Auslandstagebuch – #10 Rafting Trip

Ok, now about the awesome weekend on 17-18th September :)

The two days rafting trip in Chilliwack on the Chilliwack River. We started on Saturday and set up our tents first when we got there at around 5pm.

The most pictures you can see at the flickr account of INTERNeX : http://www.flickr.com/photos/internex/sets/

Some more you can see here, I’ll upload some more later.

Geschrieben am: 26.09.2011 - 4:38 Uhr
Zeit in Vancouver: 25.09.2011 - 19:38 Uhr

Mein Auslandstagebuch – #9 Summary

Attention, attention :)

Starting with today, I will write in english. My last post was more than one week ago, because the time is running much faster here in Vancouver ;) . But what happend since then?
I will start with last week, because there was nothing special =).

Every second Friday we have a test in school. In the last one we had excercises about reading, grammar and listening. When you get more than 75% in this test you can directly level up to the high-advanced classes. I got about 82% and was moved to a new class.
In this class we practice for the Cambridge Certificate in Advanced English (CAE) certificate, the old class was for the Cambridge First Certificate in English (FCE), which is an lower certificate. In this category is only one higher certificate the Cambridge Certificate of Proficiency in English (CPE), but I don’t know if they have any classes for this certificate at the moment :)

I think thats all about the last week, at least the workdays, there will be another post about the weekend :)

Geschrieben am: 23.09.2011 - 0:53 Uhr
Zeit in Vancouver: 22.09.2011 - 15:53 Uhr

Zwischeninfo:

Mir wurde gerade mitgeteilt, dass es vor 2 Tagen ein Erdbeben hier in Vancouver gab. Ich habe davon gar nichts mitbekommen, scheinbar war das nur in North-Vancouver zu spüren.

Quelle: Stern.de

Geschrieben am: 12.09.2011 - 8:29 Uhr
Zeit in Vancouver: 11.09.2011 - 23:29 Uhr