s5h.net

“fresh linux news and advice.”


puce2007-06-29 just a useful tip

Once again I'd forgotten how to do something basic like talk to a HTTPS server for a GET/HEAD. Took me a while to find the openssl syntax. Here it is just for archival:

openssl s_client -connect host:443 -quiet

puce2007-06-27 brownout

Tonight I should be revising Russian verbs, nouns and grammar, instead, it is a night of celebration as Gordon Brown steps up to fill the role of Prime Minister.

puce2007-06-25 days gone by

For interests sake I have gone looking through the search history of this site just to see what I was working on some time ago.

Popular search hits related to zabbix, opebbsd's cdrom make script and icmp fping. Things that have always been reoccurring are qmail 551 messages. This I put down to there being a constant populous who receive instant 551 messages and perform a quick google search to see what the cause is; however my site would be very far down the list of results, so who knows what keeps them chasing their tails.

puce2007-06-24 good intentions

I'm going to put some time into making this site plain html. In the long run this should improve page load times and reduce db work. I've already started on the linux news pages, and should, in theory be little work to do for the lyrics and jokes sections.

Sadly, I chose to do this with Java. That's fine for running here, but I don't think that many site hosts allow java to run as CGI or cron.

Normally I would do this in perl, since perl is so portable, but, just to give myself something new to work with I'm going to do this in python, no Ruby. I've not done anything significant in Ruby, and hopefully I'll be able to update the code comparison page with some new information.

puce2007-06-23 slashdotted

Well not slashdot, but digg. My connection here was a little uneasy with the pounding it received from a highly rated digg article. I shall try and find a cheap host that can carry the database and news articles that are published here. The last time this happened it was for the unix beards page. This connection could hardly cope with the DNS lookups, at first I thought I was getting attacks. One of the annoying things for me is that by default ICMP port unreachable packets were going to the sender, but this was preventable.

Today I took some advice and went to the sweatshop in Reading to get expert advice on some running shoes. I have a slight angle on my feet which seems to be the root cause of my troubles. The shoes I bought have firmer material on one side so that the feet have more difficulty to lean. This is something new to me which I was unaware of, but if it prevents me experiencing the pain in running then I'm all for it.

I was so impressed with the advice and attention the shop was willing to give me that if I had remembered the assistants name then I would be writing a letter of thanks to their head office, good deeds like this should be rewarded.

puce2007-06-17 xss irony

I discovered this link to a QuickPlace XSS filter protection on IBM’s website, on the front page of digg.com. It's highly ironic.

puce2007-06-16 whole new world of pain

Some while back I took part in the Reading Half Marathon, which was great fun, and I really look forward to maybe taking part in the 2008 event. However a few days later when using the treadmill at the local gym I found pain half way up my calf. Since then I'd gone really easy on the leg and stopped working out.

About three months have since past, in the first month I had some sports therapy, which I felt was doing some good, although in other ways the extensive massage would leave me feeling a little sore the following day. Two days ago I finally visited a Dr who ('Dr Who' is unintentional) told me to just take some pills, ibuprofen specifically.

Also during the three months I started to swim frequently, as Ruth (the sports therapist) told me I should partake in impact free activities. Things such as running or walking case the let to undergo an impact during the movements. Swimming and cycling are much better forms of sport since there is little shock on the leg.

Since I am a lousy swimming my head wants to remain above water level as much as possible. This itself caused my neck to suffer some strain. I fell that there is much higher energy used during running than swimming, and in all the gym work that I normally do, so the swimming rate became close to three or four visits per week, just so that I could feel like I was doing as much activity as per normal... Which of course led to me getting muscle strain in my neck. Pride being what it is I decided to keep this from the therapist.

So a few ibuprofen pills later and the RSI in both my hands, the next strain and my leg were feeling much better. So, why not go back out for a quick one round the town?

Big mistake. My ankle is now giving me jip. Dunno what happened but about a half mile in and something felt like it was giving way. I pushed on, today, however, I'm being reminded with every step that it was a silly thing to do.

Looking to the future I require some activity to occupy me, otherwise I will do silly things. Tonight I would normally find a club to visit and hang out, but with difficulty handling stairs it seems a silly move to make.

puce2007-06-11 hammered

Lost internet connection here today, not great. When inet was restored I noticed that google bot was really hammering my connection, after QoS dropped considerably I decided to bite the bullet and take a look at Apache throttling. My experience of the throttling appears quite good. With a simple directive the upstream is limited to 150kbyte/sec.

<IfModule mod_cband.c>
        CBandSpeed 120 10 10
</IfModule>

I've no idea why Googlebot has gone loopy and decided to pull off the site like this, but had this been hosted remotely I would probably have lost the months bandwidth quota already.

puce2007-06-10 perl redirect

Here's a snippet of code to HTTP proxy. I've seen a lot of scripts around that make a proxy interface for web, but none that do the job silently. It is a simple script, but could save a little time when requiring the functionality.

#!/usr/bin/perl

use strict;
use warnings;
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Response;

# Copyright (C) 2007 Ed Neville
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2, as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
# or visit http://www.gnu.org/licenses/gpl.txt
#
# 20070510 ewn redirect.pl script
#              this script just gets a page off a server. it does not
#              rewrite any urls, if the urls are not relative then they
#              will be written out as read in.
#              other methods of redirect would include frameset.
#              this script would ideally provide https.
#
# example usage
#
# <VirtualHost *>
# ServerName www.example.com
# SuexecUserGroup ed ed
# ScriptAlias /cgi-bin /var/www/sites/www.example.com/cgi-bin
# suPHP_Engine on
# suPHP_ConfigPath /etc/php4/apache
# AddHandler x-httpd-php .php
# <Directory "/cgi-bin">
# 	Options +ExecCGI
# </Directory>
#
# ErrorDocument 404 /cgi-bin/redirect.pl
# CustomLog /var/www/sites/www.example.com/log/web.log combined
# ErrorLog /var/www/sites/www.example.com/log/error.log
# </VirtualHost>
# 

my %config = ( host => 'http://www.google.co.uk' );

sub headers {
	print( "Status: 200 OK\r\n" );
	print( "Content-type: text/plain\r\n\r\n" );
}

sub agent_headers {
	while( <STDIN> ) {
		print( $_ );
	}
	foreach( sort keys( %ENV ) ) { 
		print( "$_ ${ENV{$_}}\r\n" );
	}
}

sub set_config {
	$config{'redirect_to'} = $config{'host'} . $ENV{'REQUEST_URI'};
	$config{'method'} = $ENV{'REQUEST_METHOD'};
}

sub get_redirect {
	my $ua = LWP::UserAgent->new;
	
	my $req = HTTP::Request->new( 
		$config{'method'} => $config{'redirect_to'} );

	if( $config{'method'} eq "POST" ) {
		my $data = "";
		while( <STDIN> ) {
			$data .= $_;
		}
		$req->content = $data;
	}

	my $response = $ua->request($req);
	print( "Status: " . $response->status_line );

	print( "\r\n\r\n" );
	print( $response->content );
	
}

sub main {
	set_config();
	#headers();
	get_redirect();
	#agent_headers();
}

main();

puce2007-06-05 too busy to do anything

Things have been too busy lately for me to make any edits. For the moment I point you at a cartoon strip: elesr, it's not exactly that funny, but it's taking the piss out of Dull -- I mean Dell, and that's all that counts.

Sadly for me, this is one of the largest gaps in this blogg, how will I know in a few years time that this was the period of my life when I spent the majority of my time dealing with fallout from a large computer shuffle at work?

Needless to say, I need a break, which I why I'm toying with the idea of a holiday in Belarus, Russia, Ukraine or anywhere, just somewhere that makes using a computer a difficulty or very expensive.