May 05

Charm allowed me to download all my LJ entries this month as text files but unfortunately they were not named with .txt which PyBloxsom requires to pick them up as postings. Again, some googling found me some Unix find command examples from which I was able to adpat an example to write this code

find . -type f -name "*" -exec mv {} {}.txt \;

which renames every file under the current directory to .txt.

Feb 28

Just for laughs, I decided to install Debian Linux on my old Sony notebook. Once I bit the bullet and deleted Win98 completely I was able to, with DaveK’s plain vanilla Sony CD-ROM drive, boot from the CD and do a basic install.
Continue reading »

Dec 18

Iinix Solutions

Linux Comments Off

It looks like Sajjad is doing well for himself as a Linux Consultant in Pakistan after leaving Japan earlier this year. If you are looking for someone to do remote work on your Linux systems or someone locally in Pakistan give him a call.

Nov 07

“Cron is my TiVo” describes a system like the one DavidB wanted to build.

Sep 03

To find the big directories:

du / | sort -n

or add -h to make it easier to read.

Jun 16

Postgres

Linux Comments Off

I need to see what SQL is being processed by Postgres. Starting Postgres from the command line like this will log it.

/usr/local/pgsql/bin/postmaster -i -d 2 -D/home/pgsql/data -N620 -B2048 -o -S65536 >> /home/pgsql/postgres.log 2> /home/pgsql/postgres.log

Next, to figure out what all the options mean.

Jun 13

Pure poetry

Linux Comments Off

rm -f `ls -1t | tail +8`
Continue reading »

Jun 13

I’m going to forget this…

export EDITOR=vi
crontab -e

Jun 10

SSH is really nifty but can drive you mad. In the configuration file:

/etc/ssh/sshd_config

in the AllowUsers you can set which accounts are accessilbe from which IP addresses or range of IPs. This allows you to really lock down your security but if you mess it up you can lock yourself out of the machine and then you have to logon from the console. Not nice if the machine is in a data center far away.

Also you can end up making it a real pain to log on to the machine by forcing logons through another machine making a nasty twisty maze of logons to endure before being able to login to the machine you want to maintain.

After changing sshd_config, don’t forget to restart the sshd service

/etc/rc.d/init.d/sshd restart

or you’ll be puzzling as to why you still can’t logon…

Also if you have any problems do

less /var/log/secure

followed by Shift-G to see the latest entries in the secure log.

I had trouble with one machine as it didn’t have a reverse DNS entry and as a result gave the error “Could not reverse map address”. I didn’t realize that that machine had gotten it’s IP addres via DCHP so actually it wasn’t a good idea to put it in the list anyway. So I got the machine a shiny new permanent IP address and now I can access it using Putty with no problems.

May 14

One of our severs was reaching 95% usage capacity but df and du were giving wildly different figures for disk usage. JimT gave me the clue that du wouldn’t see open files. When I checked with lsof there were a lot of files in the Apache logs folder that were “deleted” but were still open. Restarting Apache brought the figures back to normal.

preload preload preload