s5h.net

“fresh linux news and advice.”


puce2008-06-30 a little more on modules

Since my previous post spoke of something which I could not complete, I thought it might be worth posting some information about how someone else could go about making their own authentication module.

So here is the start of my page on apache modules.

puce2008-06-29 mod_vchkpw

I thought that I had a reasonable idea to make mod_vchkpw, a module which uses vpopmail for authentication in Apache. This would use the vpopmail user database for authentication rather than htpasswd files or other database. This has an advantage for things like single signon authentation, there would be no synchronisation issues between database files and versions.

There is one major snag that I've only just realised since the vchkpw files are owned by vpopmail, and mode 600, this prevents the www process from having any read access to these files without compromising security. So, just after fixing a bunch of stuff I've realised that this module will now be forgootten about - there's no useful way to implement it to anyone's advantage.

puce2008-06-24 pidgin disconnect

It's useful sometimes to be able to disconnect myself from the internet from a remote location, in this case with my jabber account knocking myself offline like a ping pong session between my home and work computers.

This might be a useful method to accomplish just that

export $( tr "\000" "\n" < /proc/$(pgrep -u $USER gaim|head -1)/environ | grep '^DBUS_SESSION_BUS_ADDRESS' )
gaim-remote setstatus?status=offline

gaim-send-async can call any function in gaim, you can find these using

nm -D /usr/bin/gaim

puce2008-06-23 amy whinehouse

Somethings really annoy me. One of those is cellebs slipping out of their responsibility. Until recently Amy Winehouse had an image of popping pills, drinking and basically just doing what's not good for her - but it was her image, she demonstrated little self control in public and craved the attention that it drew.

So in other recent news to attempt to save money the NHS are offering NRT (Nicotine Replacement Therapy) to smokers for free, along with gift vouchers to contribute towards food and drink. This should solve some of the upcoming cancer problems in the next few decades and extend the working life of citizens such that they continue to contribute pension and taxes.

These two events together, what do we have? Well, a previously crack smoking Shamey Whinehouse now is in public with NRT patches all over her body and what a good role model she is!!! What strings did her PR people pull to get her off the crack charges offensive with the government I wonder? You know what? This really grinds my gears.

puce2008-06-22 sometimes things worth dying for are worth living for

Perhaps my obsession with computer software is my own personal downfall, it leads me to spend so much time in isolation that when there is an opportunity to do something new I just cannot make the time to stop scratching those computer itches.

So anyway, what I've been doing today is a simple little CPU monitor script so that the work that the CPU does can be graphed. The point of this is simply because I found out that

4*a(1)

is how to calculate pi. 'a' being arctan, and now I have a CPU that can schedule work.

echo "scale=1000000; 4*a(1)" | bc -l > 1meg_pi

There's nothing more to say about this really, but if you are interested in doing something similar then the code can be found here: stats.

        pucemultilog postprocessor

I noticed that a lot of harvesting attacks hit my mail server, basically the SMTP client attempts to deliver mail to dictionary addresses at my hostname. There is a limit of 10 attempts on these failures before the client is disconnected and then it's free to reconnect and continue attempts. So I've written another script today to process the log files and string out the failing addresses, then update the connection hash with appropriate deny entries.

At the moment this script works on plain text files which is really just an interim fix before using something a little better such as mysql or sqlite to store the failures and appropriate details, such as the time of the attack and perhaps the sender address (although that's not really much use, but might be of some use in the future - who knows).

This is available in the code directory, validrcptto log process.

To use this script you can simply change the multilog parameters in your log run script like this

#!/bin/sh
PATH=/var/qmail/bin:/usr/local/bin:/usr/bin:/bin
export PATH
exec setuidgid qmaill multilog t s100000 n20 !/usr/local/bin/read_excess.pl /var/log/qmail/qmail-smtpd 2>&1

puce2008-06-17 chinese proverbs

  1. Virginity like bubble, one prick, all gone.
  2. Man who run in front of car get tired.
  3. Man who run behind car get exhausted.
  4. Man with hand in pocket feel cocky all day.
  5. Foolish man give wife grand piano, wise man give wife upright organ.
  6. Man who walk through airport turnstile sideways going to Bangkok.
  7. Man with one chopstick go hungry.
  8. Man who scratch ass should not bite fingernails.
  9. Man who eat many prunes get good run for money.
  10. Baseball is wrong: man with four balls cannot walk.
  11. Panties not best thing on earth! But next to best thing on earth.
  12. War does not determine who is right, war determine who is left.
  13. Wife who put husband in doghouse soon find him in cat house.
  14. Man who fight with wife all day get no piece at night.
  15. It take many nails to build crib, but one screw to fill it.
  16. Man who drive like hell, bound to get there.
  17. Man who stand on toilet is high on pot.
  18. Man who live in glass house should change clothes in basement.
  19. Man who fish in other man's well often catch crabs.
  20. Man who fart in church sit in own pew.
  21. Crowded elevator smell different to midget.

In other news I have finished reading the end notes to The Selfish Gene. Quite a good read really.

Also my couchsurfing membership has come through. Which is great news for me as I intend to help out and attend couch surfing events when possible. My daily commute makes it pretty hard to juggle social events, but cultural exchange is something that I'm very interested in.

puce2008-06-16 me vs you

Sometimes life is nothing more than a battle between two people. No seriously it is. Think about this in terms of the battle of the sexes. The male pours only a small about of effort and nutrition into the construction of a few million sperm cells, perhaps daily. On the other hand, the female has to put a huge amount of effort into creating an egg, which s many times larger in size than the sperm.

That said egg has to be natured for many months (in the case of humans) before it can be given birth to (once fertilised). The male on the other hand is free to venture to pastures new, leaving behind his trace DNA. The female has to put further work into it's upbringing, nursing and protection.

The natural selection process therefore must be an efficient one, weeding out the good from the bad when the female enters courtship. Any male showing signs of looking elsewhere for mating should surely be a bad investment on her part.

On the other hand, yet again. The male, through evolution has not become just a servant of the female. The ideal balance between has been reached where the female is able to identify suitable partners and those who cannot have passed inadequate genes on to be further exploited. These obviously put more effort into eggs which demand more from the mother. Thus giving less resources to self preservation.

Lets go back to the small effort involved in sperm creation. It's not so small now, when we look at the infidelity test. Now each male has to put a huge amount of effort into being faithful to the female. Tests at every corner (literally) await his down fall. Not only this, but all that extra resource has to be presented in the most useful form for the female, otherwise she must contribute vastly greater resources again in the infant stage of development.

If you don't agree with my thoughts, complain not just with me but with Richard Dawkins, the celebrated evolutionist.

puce2008-06-15 pain sensor overload

Loved and lost so many times.

There is no great love without great jealousy.

Today I finished reading the book Cryto (see my books page for details and links to this).

puce2008-06-12 the price of it all

In order to make my life better and more secure I took a job in Maidenhead. Now I'm finding that my spoils are being reaped by the tax man and oil tycoons. I find that the price of fuel is just climbing without any delay.

In order to make my life better and more secure I took a job in Maidenhead. Now I'm finding that my spoils are being reaped by the tax man and oil tycoons. I find that the price of fuel is just climbing without any delay. What can we do?

Here is a short list of some basic things which can help conserve petrol. Perhaps it's possible to do just this until the state sorts the problem out. Lets face it, no one will cycle 60 miles to work daily. No one can arrange their schedule right to fit with other people to car pool. We all love and enjoy the freedom and independance that our cars bring. For the best part of the last 50 years this has been without want or let, now we're all being taxed because the oil companies are in a position where they can dictate the price that we pay. We can all blame the government, kick, scream, but like a determined horse the oil companies won't reduce the price.

  1. keep your car well serviced and check the oil level regularly.
    correctly maintained cars can operate more efficently and help reduce CO2 emissions.
  2. check your tyre pressure every month
    under inflated tyres can increase fuel consumption by up to 4%.
  3. remove unnecessary weight from your boot or back seats
    the heavier the car, the harder the engine has to work and the more fuel it consumes
  4. close your windows, especially at higher speeds, and remove empty roof racks
    this will reduce wind resistance and can lower your fuel consumption and CO2 emissions by up to 10%
  5. use air conditioning only when necessary
    unnecessary use increases fuel consumption and CO2 emissions by up to 5%
  6. start driving soon after starting the engine and tune off the engine when stationary for more than one minute
    modern engines enable you to just get in and go, thus reducing fuel consumption
  7. drive at reasonable speeds and above all drive smoothly
    every time you accelerate or brake suddenly, your engine uses more fuel and produces more CO2
  8. when accelerating change up gears as early as possible
    higher gears are more economical in terms of fuel consumption
  9. try to anticipate traffic flow
    look at the traffic as far ahead as possible in order to avoid unnecessary stopping and starting within the flow of traffic
  10. consider car sharing for work or leisure
    you will help reduce congestion and fuel consumption

Image013   Image012

puce2008-06-11 madness

Things are going on at an incredible speed for me at the moment, socially anyway. It seems there's people who actually enjoy my company and are calling me regularly to go to town and have some beers to to watch live music. Really is getting chaotic.

puce2008-06-10 suv? nothanks!

Thankfully it looks as though the SUV has begun a decline. On the flip side of the coin, it must also indicate that the oil companies would seek to recoupe their funds elsewhere, perhaps in the pockets of normal drivers. It's a sad world we live in where one good thing leads to another bad.

Perhaps the world is just greedy and it's population are too exposed to the good and rich life. This author will happily sell everything for love and companionship which is perhaps the richest of them all.

puce2008-06-06 seems it wasn't such a bad choice

The RAM that I ordered from crucial arrived today. Everything was waiting and already connected in eagerness of its arrival. Powered the box up just fine and the new parts have already proved their worth for me.

  1. motherboard; GA-945PL-S3P
    I always go for gigabyte never had a fault. Descent mid-range, nothing too fancy. this was the first mistake, I forgot to order this.
  2. cpu; intel p4 651 3.4GHz
    intel p4, although I intended to get a dual core, this single core operates similarly to dual processors
  3. cooling; AK 956SF
    it's just a cheap CPU heat sink and fan. nothing special but it's quiet
  4. video; Nvidia 7600GS 256MB DDR2 DUAL DVI PCI-E
    this card has no gpu fan, it's cooled entirely by heat sink
  5. memory; DDR2 PC2-6400
    this is the second mistake in the order

Overall, I'm happy again, programs are operating at an expected speed and everything appears to be functioning well. It'll now be possible for me to run Solaris images (when I feel like hurting myself) along side my normal tasks.

I found a very good youtube serise on programming in perl from bermnz, so if this is an interesting subject for you then why not click that link and see what it's all about.

puce2008-06-04 just goes to show

It could be due to carelessness or stupidity but when I buy computer parts I always seem to mess it up. Last time it was with an AMD 64, this time it's with a P4.

Firstly I make the order and forget about getting the motherboard. So, after making the order for the motherboard I find that once it's arrived that my existing RAM is not compatible. If you held a gun to my head I would have sworn that the RAM was the same.

So, simply I have to ebay the (now useless) components and go through all the hassle of packing it into boxes, writing out labels and so forth.

For the time being I'm using my laptop and a 3mobile HSDPA modem, which also came from ebay.

On a more positive note I think I've found new love. So I'll leave you with this song, Therapy - Dopamine, Seratonin, Adrenaline, it'll be on youtube somewhere.

puce2008-06-01 small update

Only a very small update today in the form of a CIDR netmask chart chart for people who are starting their own large computer networks (but in which case you should know this already) and therefore this is not going to be of much use. This is being posted anyway since it might be handy for the odd verifying glance.

cidr chart.

puce2008-06-01 short posting

There was an article on /. about the root DNS servers being compromised would be all be ok. Well one of the comments was about turning a bookmarks file into a hosts database. Well, here's a short perl script that does just that. It's not special or clever, but as I've got little else to show today, I thought this would fill the gap.

#!/usr/bin/perl

use strict;
use warnings;
use Net::DNS;

my %hosts;

sub lookup {
	my $res =  Net::DNS::Resolver->new;
	my $query = $res->search( shift );

	if ($query) {
		foreach my $rr ($query->answer) {
			next unless( $rr->type eq "A" );
			return( $rr->address );
		}
	} 
	else {
		warn "query failed: ", $res->errorstring, "\n";
	}
}

while( my $l = <STDIN> ) {
	if( $l =~ m!(http://.+?)\s! ) {
		print( "$1\n" );
		if( $1 =~ m!http://(.*?)/! ) {
			my $ip = lookup( $1 );
			$hosts{$1} = $ip;
		}
	}
}

foreach my $host ( sort keys( %hosts ) ) {
	print( $hosts{$host}, "\t", $host, "\n" );
}