Mon, 26 Jan 2009

Checking portsmon

When tabthorpe and thierry mentored me, tabthorpe told me I have to be reactive with pointyhat and to check portsmon *regularly*. Each time I committed something to the ports tree (PR, or update), I would have a look on portsmon, in spite of all my own tests before committing!
It's a pain to check all your last commits and it's a really embarassing to receive pointyhat mail. So, I wrote a little ruby script.

#! /usr/local/bin/ruby

require 'rubygems'
require 'hpricot'
require 'open-uri'
require 'timeout'
require 'rss'

i = 0

if ARGV.length != 2
	puts "./check_portsmon.rb check your ports commit on portsmon"
	puts "Usage: ./check_portsmon.rb commiter_name xml_limit"
	puts "Example: ./check_portsmon.rb mylogin 20"
	exit 0
end

url = "http://cia.vc/stats/author/" + ARGV[0] + "/.rss?ver=2&medium=plaintext&limit=" + ARGV[1]
flux_result, rss = nil

begin
	timeout(10) do
		open(url) do |s| flux_result = s.read end
		begin
			rss = RSS::Parser.parse(flux_result)
		rescue RSS::InvalidRSSError
			rss = RSS::Parser.parse(flux_result, false)
		end
	end
rescue StandardError => boom
	puts "Error: #{boom}"
rescue Timeout::Error => time
	puts "Error: #{time}"
	exit 0
end

if rss.items[i] != nil
	while i != ARGV[1].to_i
		if rss.items[i].description != nil && rss.items[i].description =~ /([a-zA-Z0-9._-]+)\/([a-zA-Z0-9._-]+)\/([a-zA-Z0-9._-]+)/
			if $1 == "ports"
				uri = "http://portsmon.freebsd.org/portoverview.py?category=" + $2 + "&portname=" + $3
			puts "Testing  #{$1}/#{$2}/#{$3}"
			@portsmon = Hpricot(open(uri))
			@portsmon.search("td.error").each do |e|
				if e.inner_html =~ /([A-Z]{1}[a-z]{2,3}) ([A-Z]{1}[a-z]{2,3}) ([\d]{1,4})/ 
					puts "Date: #{$1} #{$2} #{$3}"
				end
				if e.inner_html =~ /href="(.*\/)#(.*)">/
					puts "Error: #{$2}"
				end
				if e.inner_html =~ /href="(.*.log)"/
					puts "Go to #{$1}"
				end
			end
			end
		end
		i += 1
	end
else
	print "Commiter name invalid"
	exit 1
end

This script will check for you, your n last commit on portsmon. It parses cia.vc and take only the ports commits.
Here is an example:
I commit only in ports and I want to check my last 20 commits:
./check_portsmon.rb jadawin 20
Testing  ports/net-mgmt/p5-Net-CIDR
Testing  ports/archivers/p5-Archive-Tar
Testing  ports/sysutils/phplogcon
Testing  ports/www/hiawatha
Testing  ports/www/p5-Web-Scraper
Testing  ports/math/p5-Math-BaseCalc
Testing  ports/net/spoofer
Testing  ports/devel/p5-EV
Testing  ports/mail/p5-Mail-IMAPClient
Testing  ports/finance/p5-Finance-Currency-Convert
Testing  ports/www/p5-Web-Scraper
Testing  ports/astro/p5-Astro-SpaceTrack
Testing  ports/www/p5-libwww
Testing  ports/audio/ampache
Testing  ports/astro/p5-Astro-SpaceTrack
Testing  ports/security/vuxml
Testing  ports/net/nepim
Testing  ports/devel/p5-Config-General
Testing  ports/sysutils/hammerhead
Testing  ports/misc/p5-Array-Compare
tabthorpe@ commits in ports and in docs and he wants to check his last 10 commits:
./check_portsmon.rb tabthorpe 10
Testing  ports/editors/dkns
Testing  ports/x11-wm/nickleby
Testing  ports/x11-wm/nickleby
Testing  ports/mail/squirrelmail-vlogin-plugin
Testing  ports/mail/squirrelmail-password_forget-plugin
Yeah. Only 5. Because, his has only 5 ports commits in his last 10 commits.
What happens if there is an error on portsmon?
You will see:
Testing  ports/security/ossec-hids-client
Go to http://pointyhat.FreeBSD.org/errorlogs/sparc64-errorlogs/e.6.20090112004632/ossec-hids-client-1.6.log
Error: mtree
Date: Wed Jan 7
Go to http://pointyhat.FreeBSD.org/errorlogs/sparc64-errorlogs/e.6.20090112011936/ossec-hids-client-1.6.log
Error: mtree
Date: Mon Jan 12
A direct link to pointyhat's log, error type and when it happened.

I wrote this script to help commiters to be more reactive. Don't think I had a lot of pointyhat's mails :-)
Please, feel free to download it here. You need www/rubygem-hpricot to run check_portsmon.

I you use this script, please, give me feedback, good or bad!

posted at: 10:14 | tag: freebsd | path: /freebsd | permanent link to this entry

Wed, 14 Jan 2009

Back for playing!

Ok, after this succession of crashes, essential things are restored. It means that I can play again with FreeBSD commiters. Great!
To celebrate that Ampache 3.4.4 is, finally, commited in ports tree. Enjoy!

Now, time to play with perl-5.8.9's update! Thanks skv!

posted at: 19:31 | tag: freebsd | path: /freebsd | permanent link to this entry

Fri, 09 Jan 2009

Tu me fais marrer!

Tu me fais marrer (bébé) - Volo

Tu m'fais marrer bébé
Quand on joue à cache-cache
Dix fois dans la journée
A tous les coups ça marche
Tu m'fais marrer bébé
Quand t'as l'air tout déçu
Ou bien très énervé
Alors c'est qu'tu t'chies d'ssus
Tu m'fais marrer bébé
Comme t'as l'air d'aimer l'sable
Quand j'te fais des pâtés
On croirait qu't'es à table
Tu m'fais marrer bébé
Comme tu m'repousses des mains
Comme tu m'donnes des coups d'pieds
Quand je t'fais un câlin

C'est maint'nant
Et tout d'suite
C'est pour l'instant
Que j'en profite
C'est pas le bon moment
Pour se dire que le temps
Passe vite

Ils m'font marrer bébé
Comme tu les rends gagas
Mon papa ton pépé
J'l'ai jamais vu comme ça
Ils m'font marrer bébé
Quand ils me disent quoi faire
Alors qu'j'ai rien d'mandé
J'écoute surtout ta mère
Ils m'font marrer bébé
A dire que t'as grandi
Et qu'est-ce que t'as changé
Alors que t'es toujours tout p'tit
Ils m'font marrer bébé
Quand ils poussent un soupir
Encore à m'répéter
Que j'vais pas t'voir grandir

C'est maint'nant
Et tout d'suite
C'est pour l'instant
Que j'en profite
C'est pas le bon moment
Pour se dire que le temps
Passe vite

On va s'marrer bébé
Quand tu demand'ras pourquoi
Et que j'vais t'expliquer
Des trucs que j'sais même pas
On va s'marrer bébé
Même si j'peux rien t'promettre
Et quand faudra pleurer
Faudra aussi s'en remettre
On va s'marrer bébé
A se faire des mac do
J'suis sûr qu'a démonter
C'est vach'ment rigolo
On va s'marrer bébé
Et même si rien n'se passe
Comme j'veux l'imaginer
Si c'est vrai qu'tout s'efface

C'est maint'nant
Et tout d'suite
C'est pour l'instant
Que j'en profite
C'est pas le bon moment
Pour se dire que le temps
C'est maint'nant
Et tout d'suite
C'est pour l'instant
Que j'en profite
C'est pas le bon moment
Pour se dire que le temps
Passe vite

C'est à peu près ça, sauf que Simon ne joue pas encore dans le sable et que je ne pense pas qu'on ira au MacDo, vu mon amour inconditionnel de cette magnifique nourriture surchargée de graisse.

posted at: 14:14 | tag: life | path: /life | permanent link to this entry

Mon, 05 Jan 2009

"When troubles arrive, they come not in single file, but in battalions."

After huppa's crashed disks, glenrothes (my home server on adsl line) is dead. Motherboard is out-of-service and there's no way to boot it. Grim reaper decided to take this computer.

As you can imagine I'm *really* happy. For many reasons. First, it was my first own computer and it's 10 years old. Second, it was huppa's backup. Happily, I finished restoring 90% of non-corrupted data. Now, lesson is learned, i will have more than one backup.

Only one person is happy with this prematured death: Isa, my wife. I promise her a noiseless computer.

posted at: 17:45 | tag: admin,life | path: /life | permanent link to this entry

Back again!

Yep. I'm back again with freelog. Due to a crash disk and a lot of corrupted files and databases in backup, I had to reinstall this server. No mail lost, just some news websites (like this one, of course).

In spite of that, I wish you a really happy new year! A lot of joy, peace, and, of course, hack! Enjoy, Enjoy, Enjoy! I hope you are able to forget everything when you are with your family, I hope you are entranced when you have your child and your wife (or husband) in your arms.

Happy new year.

posted at: 17:24 | tag: admin,life | path: /life | permanent link to this entry