Last call for ….

I haven’t posted anything in a while on this blog, and now I made the decision that this will not change: it is unlikely that this blog will be updated anytime soon. The reason is actually twofold:

Job
I’m working full time as an Open Source/Linux consultant these days – and after work I do not really have the time nor the energy to invest even more time into Open Source (besides the Fedora packaging).
Company’s Blog
I was successful in convincing enough people in our company to start a blog – and I blog there since then, so when I get home I usually already have blogged about whatever comes to my mind.

That means effectively that you will not receive any more new posts here. It hurts my heart and kills kittens, but you can remove the blogfeed. @planets where I might still be listed at: please remove this blog feed as well.

However, if you *do* want to keep up with my thoughts: credativ’s company blog is working quite nice these days. Btw., in case you don’t know, credativ is an Open Source/Linux company and the one behind the Open Source Support Center (OSSC) and the Open Source Support Card (yeah, “catchy” names, I know). They are focussed on Open Source support (Linux-Support, PostgreSQL-Support, etc.) and have offices in DE, UK, US, etc. So the general topics are pretty close to this blog. If you look close you will recognize my style: short italic introduction, eye catcher on the upper right side, special headline markings for Howtos and Short Tips, and so on. Also, the categories are quite the same, and it is actually available in German and English. Also, I am not the only person writing there – one very active PostgreSQL developer keeps blogging there, if I want it or not. ;-)

However – it is a company blog, so you will (!) find information regarding the company itself, or newest marketing things. You are warned!

So this is it: the last post. Thanks everyone for wonderful years full of blogging, discussions, news, Howtos and good tips. So long, and thanks for the fish! :-)

Short Tip: import larger sets of ics files into kontact

kde-logo-official
While migrating to Kontact it might come up that a large set of ics files have to be imported into Kontact. There is a GUI way to do that, but that involves a large number of clicks for each file. Easier is the command line way:

$ ls *.ics | xargs -n 1 konsolekalendar --file ~/.kde/share/apps/korganizer/std.ics --import

Another way is to copy all ics files to a directory. A new calendar can be created with this new directory which afterwards contains all the data from the ics files. This calendar can again be exported as one single ics files which can be easily imported everywhere.

Short Tip: access a running X session via x11vnc

cube-with-matrix
There are thousands of ways to access a running Linux machine. In case you need for whatever reason remote access to a full session, one easy way is x11vnc. Given that the user is already logged into X, access the machine via ssh, log in as the user who opened the X session, and enter:

x11vnc -display :0

Now you can access the machine with a vnc viewer, for example with 192.168.123.45:0. Beware however that this configuration has no encryption via network – and no vnc password at all!

In case you need to access a running login manager (where no user is logged in yet) first get the authentication file of the running X and hand it over to x11vnc (as root):

host:~# ps x|grep X
 1425 tty8     Ss+    0:01 /usr/bin/X -br :0 vt8 -auth /var/run/xauth/A:0-1EkR5c
host:~# x11vnc -display :0 -auth /var/run/xauth/A:0-1EkR5c

A good client to connect to the running vnc session is KDE’s krdc.

Short Tip: GNU Screen with proper scroll, session management support

shell.png
I often use GNU Screen – in fact, I can hardly imagine anyone administering Linux servers without it. However, I always found the scroll support in GNU Screen awkward: Ctrl+A+Esc (although this is, strictly speaking, the copy mode).

This can be fixed by adding this line to .screenrc:

termcapinfo xterm* ti@:te@ 

The only problem is that, while scrolling works perfect in normal terminal sessions, scrolling in vim in screenrc in KDE 4′s Konsole still does not work properly.

And since I am already talking about GNU Screen, these lines add a white control bar showing the currently open sessions, their names and make it possible to switch between them with F5 and F6:

caption always # activates window caption
caption string '%{= wk}[ %{k}%H %{k}][%= %{= wk}%?%-Lw%?%{r}(%{r}%n*%f%t%?(%u)%?%{r})%{k}%?%+Lw%?%?%= %{k}][%{b} %d/%m %{k}%c %{k}]' # good looking window bar

bindkey -k k5 prev # F5 for previous window
bindkey -k k6 next # F6 for next window

You can rename sessions with Ctrl+a+A.

As usual I appreciate comments and further tips – but please don’t paste anything with more than 5 or 6 lines of code ;)

Short Tip: grep with more than one expression

shell.png
One of the main tools on th command line is grep. It is most often used to search for specific strings in program output, text files and so on. For the sake of an example, the syntax to search a the X.Org log for the string nvidia is:

# cat /var/log/Xorg.0.log|grep -i nvidia
(--) PCI:*(0@1:0:0) nVidia Corporation Quadro NVS 135M rev 161, Mem @ 0xfd000000/0, 0xe0000000/0, 0xfa000000/0, I/O @ 0x0000ef00/0, BIOS @ 0x????????/131072
(II) NV: driver for NVIDIA chipsets: RIVA 128, RIVA TNT, RIVA TNT2,
(--) NV: Found NVIDIA Quadro NVS 135M at 01@00:00:0

The -i flags the search as case-insensitive. That way you can only search for one expression a time. In case you want to search for more expressions at the same time, the option -e is needed:
# cat /var/log/Xorg.0.log|grep -i -e TNT -e nvidia
(--) PCI:*(0@1:0:0) nVidia Corporation Quadro NVS 135M rev 161, Mem @ 0xfd000000/0, 0xe0000000/0, 0xfa000000/0, I/O @ 0x0000ef00/0, BIOS @ 0x????????/131072
(II) NV: driver for NVIDIA chipsets: RIVA 128, RIVA TNT, RIVA TNT2,
        Unknown TNT2, Vanta, RIVA TNT2 Ultra, RIVA TNT2 Model 64,
        Aladdin TNT2, GeForce 256, GeForce DDR, Quadro, GeForce2 MX/MX 400,
(--) NV: Found NVIDIA Quadro NVS 135M at 01@00:00:0

This is a typical problem I often thought about but never got around to look it up. And there are surprisingly few people out there who now that feature! And yes, I know that cat should not be used that way, but it’s hard to forget once you’ve learned it wrong.

Follow

Get every new post delivered to your Inbox.

Join 37 other followers