Skip to main content

Category: unix

Always encrypt your ssh private key

Recently someone I know advised other IT people to generate their SSH keypair using the default options “using just enter to answer all the questions”. This means that the Private Key generated has no password against it (and is unencrypted). In this case your private key is stored unprotected on your own computer, and anybody who gains access to that will be able to generate signatures (login to servers) as if they were you They will be able to log in to your server under your account.

OpenBSD, postgresql and semaphore failures during initdb

Today I upgraded my postgresql database instance on OpenBSD. Did a pg_dumpall, removed the old packages and then added the new ones (latest version 8.1.9 for OpenBSD 4.0 – yes I’m behind).

During the initialisation of the new DB, I got the following error:
<br /> creating directory /var/postgresql/data/pg_tblspc ... ok<br /> selecting default max_connections ... 10<br /> selecting default shared_buffers ... 50<br /> creating configuration files ... ok<br /> creating template1 database in /var/postgresql/data/base/1 ... FATAL: could not create semaphores: No space left on device<br /> DETAIL: Failed system call was semget(1, 17, 03600).<br />
The PostgreSQL documentation talks about this extensively. However I don’t want to recompile my kernel away from GENERIC. What else can I do?

Coral Content Distributed network

Have you ever had your website hit on a topic that people find conflicting? When the site gets viewed by the masses, you need to be prepared. If you have access to modify your web server .htaccess file then go and have a read of the Coral CDN Overview For those interested in the techie bits, here is my .htaccess for news site flood protection, and to allow CDN to serve up all my site images – thus offloading from my puny connection the bandwidth burden for images.

Mailing attachments from the Solaris Shell

I needed a quick way to send some files from the command line when logged into a Solaris server via ssh. This assumes the server is already configured to deliver your smtp mail. I also used mailx for the sending client. Here is how I did it, for your geeky reference. First write your message: cat << EOF > /tmp/mailmsg<br /> Hi this is a message<br /> And this is the second line<br /> EOF

Clearcase Tips Number 03 – managing label conventions with perl

I previously showed you how to use a shell script with Rational Clearcase, to alert you when a new branch type was created.

In this post, I will show you how to use a Perl script to enforce Clearcase labeling conventions. This example is directed toward Clearcase on UNIX (i.e. Solaris or similar) and assumes you have Perl installed, working and have a basic knowledge of how to program in Perl. It is a reworked version of the windows script supplied by IBM on Developerworks.

This is a long post, but a good one if you are a new clearcase admin who needs to enforce label names.

Clearcase Tips Number 02 – Triggers and email

I was looking for a simple way to have someone emailed when an event occurred in Rational Clearcase, like a new branch type being created. If you run Clearcase on UNIX (i.e. Solaris or similar) you can whip up a simple shell script and create your trigger. I will assume you have sendmail or similar already configured on your host so that mail utilities can send smtp mail Lets have a go at it.

Perl while loop memory hog

I was trying to use someone elses script for logging dansguardian events to an RDBMS.The script was chewing up 99% of my CPU! I got chatting to a friend and a perl coder about this, and got some ideas. He showed me about the perl debugger using the -d switch. Awesome. I finally got my perl script working. Installing the DBI package on OpenBSD was a snap with pkg_add (pkg_add -v p5-DBD-Pg-1.

chpasswd in an OpenBSD apache chroot jail

I’ve recently re-installed OpenBSD and had to set-up my squid intranet password changing tool again. The app I use is chpasswd Version 2.2.3. I had some trouble with getting it working in the default apache chroot jail, and found very little information out there on this app in a chroot jail. Here are my notes I recorded and and steps I took. Hope it helps someone else, but YMMV: Download chpasswd to /tmp

Clearcase Tips number 01

I found myself writing down example commands in clearcase (V6), so I thought I would share them. If you have ever needed to find files like you do in UNIX, but want to be clearcase specific, then these commands will give you a quick headstart on using the cleartool find command: How do I list all files and file versions going into a specific build that is labelled? Assume your label is TR1_PRE_RELEASE