Wednesday, November 30, 2005

scripting up some tabs in kde's konsole app


[root@moby bin]$ cat bipcons.sh
#!/bin/sh

SESSIONS="
d44
co-04
c62-29
co-02
co-05
d84-1
d84-2
"

KONSOLE=`dcopclient $KONSOLE_DCOP`
CURSESSION=$KONSOLE_DCOP_SESSION
for A in $SESSIONS; do
NEWSESSION=`dcop $KONSOLE konsole newSession $A`
dcop $KONSOLE $NEWSESSION renameSession $A
# your command here on the next line!
dcop $KONSOLE $NEWSESSION sendSession "console $A"
done
dcop $CURSESSION closeSession



The above shell script I have saved to a icon on my kde desktop. The icon properties run this in the command section:

/usr/local/bin/konsole --script -e ~/bin/bipcons.sh

Basically it opens a new tab for each entry in $SESSIONS, assigns the tab name to that entry ($A) and then runs a command on that entry as well. In this example, the remote console app (http://www.conserver.com). Of course that app could be anything, like ssh.

Very useful stuff. Took me a long time to dig up this information on the web, so I'm posting it here for posterity.

Tuesday, February 22, 2005

Using APT to keep DeadRat 9 up to date.

Here's a slightly out of date HOW-TO I wrote that has kept me somewhat sane when using RedHat 9 (DeadRat):

Keeping your RH9 box up to date with apt
----------------------------------------

Apt, normally a base part of the debian Linux distrobution has been ported
to RedHat and rpm. Apt makes it extremely easy to keep up to date with the
latest fixes and packages from the official RedHat distribution. Apt also
does all the dependancy checking for you. Thus keeping your installation
sane as well as up to date. It will not let you install incompatible package
sets.

- Start here:
http://apt.freshrpms.net

- download the apt for RedHat 9 package.

- install the apt for RedHat 9 package:

rpm -Uhv apt-0.5.5cnc5-fr2.i386.rpm

- update the package list:

apt-get update

You can 'cron' this command if you like. Use the really quiet mode to
prevent email unless there's an error. 'apt-get -qq update'

- upgrade your installed packages:

apt-get upgrade

You can also 'cron' this command. I prefer to use the 'download' only
switch. This way I get a email report from std out about the packages
that are ready to be updated. I can then manually do a 'apt-get update'
at my convienance and resolve conflicts if they occur.

download only mode: 'apt-get -y -q -d upgrade'

- erase old 'out of date' packages from the local cache"

apt-get autoclean

You should cron this one, for a once a week operation.

- installing new packages and their dependancies via apt:

You have to know the package name first:

browse http://ayo.freshrpms.net/redhat/9/i386/ to find the packages available.
(this pointer is stored in /etc/apt/sources.list and may update/change)

Once you find the package you want, install it.

apt-get install vim-X11

You don't need to specify the version, or the file name.

- checking on dependancies for available packages:

You can see the dependancy and package descriptions for packages in the
local cache:

apt-cache showpkg vim-X11

Use this command to decide if it's worth installing, investigating what
you're missing, etc..