Archive for the ‘technology’ Category

Another desktop blogging tool

Saturday, November 5th, 2005 |

So after getting a way of blogging directly from the desktop from Linux, next step was to find a way to do it from Apple OSX. And yes there is a widget which will do blogging to wordpress.

Download RapidMetaBlog and point it to http://you.url.domain/path/xmlrpc.php type in your username and password, and it works.

How difficult can that be.

Software actually works sometimes….

Friday, November 4th, 2005 |

I was playing around with my PC at work, and saw that in Gnome there is an ‘Blog Entry Poster’ applet, which can post entries to blogs…

Great now I no longer need to login to my blog to post entries.

sshd – Invalid user ….

Monday, September 5th, 2005 |

I’ve written a couple of entries about my anoyance and solving the issue with "Invalid user", after I started running my script it seams that there are 40 ipaddress which actually is causing this.

If you want to get ridge of this, then either run my script block_idiots_ssh.pl, or start by blocking the following ipaddresses:

136.201.107.1
137.99.10.239
165.138.251.222
195.167.202.196
198.104.137.241
200.62.142.213
202.222.18.60
202.64.210.245
203.86.84.113
210.230.64.24
210.73.128.152
211.189.26.30
211.21.128.186
211.45.120.112
211.75.4.188
213.146.166.240
213.80.105.8
213.93.189.51
216.20.244.22
217.160.170.220
218.37.89.50
218.41.93.138
219.140.167.51
220.130.245.91
220.95.232.114
220.95.232.216
222.208.171.133
24.202.99.204
24.4.255.24
59.120.171.146
61.195.159.211
61.246.1.251
62.108.199.156
62.141.35.40
69.211.157.105
69.50.225.230
80.23.97.194
80.28.216.105
82.224.162.170
83.220.130.10

By using iptables: # iptables -A INPUT -i <interface> -s IPADDRESS -p tcp –dport 22 -j DROP

Then you should hopefully see that you number of "Invalid user" entries in /var/log/secure will go down. If not start doing something active.

Howto block scripts kiddie’s

Thursday, August 18th, 2005 |

So you probably have the same issue as I do – you see ‘[sshd] … Invalid user … ‘, a couple of hundred times a day. And would like to stop that, well you could write a script which scannes the /var/log/secure every couple of seconds, or you could do as I did.

First I figured out how to read from syslog in realtime. Next came the big one, how to make the whole thing work. Well I knew that my pipe was working, and the daemon thing – well it was running, but howto make it work. After some hours the result is actually working, and I only see one entry in my secure syslog per attempt to break in, and also only one entry in iptables (timing is the issue here).

If you’re interested in the code download it block_idiots_ssh.pl

It should be self explaining, otherwise use www.google.com to find out what it does (there are some pretty good perl sites out there) – not the most pretty perl code ever produced, but hey it is working.

Daemonize Perl – or howto create a daemon in Perl

Wednesday, August 17th, 2005 |

Perl have never been something I’ve looked in to as it is not as easy (I think as) as what I’m used to, which is C/C++, PHP, Shell scripts, etc. But I’ve found out that there are a few things where nothing beats Perl, and one of them is to create small deamons (and also programs) which only exist because I got an "excelent" idea.

Having my own server, one of the most anoying things I see everyday is people who is trying to login to my server with SSH, so I get my log filled up with stuff like "Aug 17 01:54:22 blabla sshd[9821]: Invalid user blabla from ::ffff:123.456.789.123", and in some cases hundreds of them every day. So looking into how syslog works, it turned out that one can actually have multible log facilities pointing to diffrent targets. But more about that later, read another blog entry

The problem is that a daemon is require in an enviroment where one wants to monitor events which happens now. Writing deamon’s is possible in almost every programming language, but Perl *) is good at one thing, it have everything, and then a bit. Especially the way one can use regular expressions directly in the language helps.

*) Yes I could do it in C or C++ (which probably would make more sense), but I could not be bothered, and this was a good excercise in learning Perl.

So I set up trying to figure out how to do this, and found that it is not too difficult (I’m a great believer in cut ‘n paste), and a skeleton would look like this:

#!/bin/perl
#
use strict;
use POSIX qw(setsid);
use LWP::Simple;

# flush the buffer
$| = 1;

# daemonize the program
&daemonize;

while(1) {
#
# Do interesting stuff here…….
#
}

# here is where we make ourself a daemon
sub daemonize {
chdir ‘/’ or die “Can’t chdir to /: $!”;
open STDIN, ‘/dev/null’ or die “Can’t read /dev/null: $!”;
open STDOUT, ‘>>/dev/null’ or die “Can’t write to /dev/null: $!”;
open STDERR, ‘>>/dev/null’ or die “Can’t write to /dev/null: $!”;
defined(my $pid = fork) or die “Can’t fork: $!”;
exit if $pid;
setsid or die “Can’t start a new session: $!”;
umask 0;
}

See that is not to difficult, I will continue my saga about how to stop idiots trying to access my box.

New blog software….

Friday, August 12th, 2005 |

Ok, I did not end up using WordPress, I found that Serendipity would be able to almost everything I need.

Now I only need to customize it….

Flitspaal (Speedcamera) and Garmin Streetpilot

Tuesday, August 9th, 2005 |

So got yourself a Garmin street pilot, and live in The Netherlands?, and you don’t like to get speeding tickets, because as you know there are a few speedcameras around. There are a few options for you;

- you can download a file from www.flitspaal.nl and load as many waypoints as possible (max. 500)
- or you can figure out how to create a transparet map which you can load on your gps.

Well I just spend a couple of days figuring out how to create a transparent map, which you can load with MapSource.

The files are here www.c-note.dk/gps-poi, you will need to load the flitspaal.reg to get MapSource to load the file.

I will try to make this an automatic update which happens every sunday, but until that… For starters I will try to do this at least every month.

Also maybe a way to install this automatically, but I don’t think that will be very high on my todo list.

To install copy the files to C:\Flitspaal (or modify the .reg file), and then run the flitspaal.reg. Then you should have a new map: Flitspaal NL. This map you can upload to your GPS. Currently this is to be considdered BETA and I cannot be hold responsibel for what ever happens to your GPS.

I will look into changing the dots, also it looks like the cameras are a bit off from where they are supposed to be, but I don’t have time to check it right now (bike in the shop).

A small thank you would be nice: My Amazon wishlist