Gnome Theming…

For quite a moment now, I’ve been using the Aurora GTK engine and theme. Nevertheless, there was a thing that slightly disturbed me: the double scrollbar-button-with-up-arrow. So, firstly, I’ve installed Ubuntu-Tweaker, thinking that would do the configuration trick easily. But then, I found nothing in it about this. So I’ve tried gconf-editor. Nothing there either. Well, beyond this point, I started to imagine that the double-button thing had nothing to do with the configuration of Gnome. I’ve looked at the Aurora files, and searched the Interwebs for some theme-creation documentation. I found this. Especially, the has-secondary-backward-stepper interested me. Looking in Aurora’s gtkrc file, I found a line like:

GtkScrollbar::has-secondary-backward-stepper = 1

Switching the 1 to a 0, and reloading the theme has threw the extra-button away. :)

No Comments

Tasque Conky Script

Here is the script I’ve written to display on conky next Tasque ToDo items:

#!/usr/bin/env python
 
import sqlite3
from os.path import expanduser
import pprint
from sys import argv
from math import ceil
 
limit = 0
widthLimit = 0
if len(argv) > 1:
	limit = int(argv[1])
if len(argv) > 2:
	widthLimit = int(argv[2])
 
con = sqlite3.connect(expanduser("~/.config/tasque/sqlitebackend.db"))
con.isolation_level = None
cur = con.cursor()
 
counter = 0
for lastIteration in range(0,2):
	if lastIteration == 0:
		cur.execute("SELECT Name, State FROM Tasks WHERE DueDate >= 0 ORDER BY DueDate asc, Name COLLATE NOCASE asc;")
	else:
		cur.execute("SELECT Name, State FROM Tasks WHERE DueDate < 0 ORDER BY Name COLLATE NOCASE asc;")
 
	currentItem = cur.fetchone()
	while currentItem and ((limit != 0 and counter < limit) or limit == 0):
		if(currentItem[1] == 0):
			if(widthLimit == 0):
				print currentItem[0].encode("utf-8")
			else:
				for i in range(int(ceil(len(currentItem[0].encode("utf-8"))/widthLimit + 1))):
					print currentItem[0].encode("utf-8")[i*widthLimit:(i+1)*widthLimit]
			counter+=1
		currentItem = cur.fetchone()
 
con.close()

The .conkyrc line to display 5 next ToDo items using this script is:

${exec tasqueTasksScript 5}

If you want to go to the next line after 50 characters, use:

${exec tasqueTasksScript 5 50}

2 Comments

Amazon MP3 downloader on Lucid…

The new Ubuntu has been released, and with it, new versions of software packages. Some of you may have remarked that the Amazon MP3 downloader doesn’t seem to work any more (actually, I expect it to be not-functional, but I haven’t had it before upgrading to lucid, so all I can say is that installing it AFTER the upgrade doesn’t work. By the way if someone has the problem with the software installed BEFORE the upgrade, let me know, I’ll upgrade this post with the new information).

Though, I’ve got it installed, and it works. All I’ve done is to get old needed packages from the Hardy package repository, and get them installed. Then I’ve installed the Amazon mp3 downloader, and now, all works like a charm. I know this workout is not the best way to get things done, but until Amazon updates its mp3 downloader, I think that’s the best way to make it work.

Edit: I’ve made an architecture-independent shell script (I’ve only tested it on my i686 box, a review on an other architecture will be welcomed) to prepare your distribution for Amazon MP3 downloader. Download it here, then check “Allow executing file as program” in Properties > Permissions, then launch it in a terminal.

3 Comments

Ruby

Yesterday, a friend of mine asked me if I’d recommend Ruby programming language. I’ve said that, even if I had never tried it, it is said to be very reliable. Nevertheless, I’ve decided to try it, just by curiosity. So I’ve gone to the Ruby language website, and there, I’ve found some code, a hello word example:

# The Greeter class
class Greeter
  def initialize(name)
    @name = name.capitalize
  end
 
  def salute
    puts "Hello #{@name}!"
  end
end
 
# Create a new object
g = Greeter.new("world")
 
# Output "Hello World!"
g.salute

I tried it, and until today, forgotten it. But, today, I wanted to do a script to generate all IP addresses in an IP block. I first thought to do it in python, a language I’m more familiar with, but, still driven by curiosity, I’ve wondered if I could do it in Ruby. And that’s what it gave:

#!/usr/bin/env ruby
# The NetMask class
class NetMask
	@mask
	@baseIP
	def initialize()
		@mask = 0
		@baseIP = 0
	end
	def parseFromString(str)
		array = str.split(".")
		if array.length != 4
			array = str.split("-")
		end
		if array.length == 4
			@mask = array[0].to_i + array[1].to_i * 256 + array[2].to_i * 65536 + array[3].to_i * 16777216
		end
	end
	def setFromInt(value)
		@mask = ('1' * value + '0' * (32 - value)).to_i(2)
	end
	def parseBaseIPFromString(str)
		array = str.split(".")
		if array.length != 4
			array = str.split("-")
		end
		if array.length == 4
			@baseIP = array[0].to_i * 16777216 + array[1].to_i * 65536 + array[2].to_i * 256 + array[3].to_i
		end
	end
	def formatIntToIP(int)
		return (int/16777216).to_s+ "." + ((int/65536)%256).to_s + "." + ((int/256)%256).to_s + "." + (int%256).to_s
	end
	def getMask()
		return formatIntToIP(@mask)
	end
	def getBaseIP()
		return formatIntToIP(@baseIP)
	end
	def generateIPList()
		array = []
		for i in (@baseIP & @mask) .. ((@baseIP & @mask) | ((2**32)-1)-@mask) do
			array.push(formatIntToIP(i))
		end
		return array
	end
end
 
mask = NetMask.new()
args = ARGV[0].split("/")
if args.length == 2
	mask.parseBaseIPFromString(args[0])
	mask.setFromInt(args[1].to_i)
else
	mask.parseBaseIPFromString(ARGV[0])
	mask.setFromInt(ARGV[1].to_i)
end
puts mask.generateIPList()

Just for information, the help is here.

No Comments

BattleFlash v2 @Annecy

These last two days, I’ve participated to a small Adobe Flash contest in Annecy, named the Battle Flash (Frenchies have recurrent a tendency to reverse orders of words :P ). The concept is pretty simple: In a first phase, as a team composed from one to six students, you have to realise five different flash animations, each having its subject, one imposed artwork, one imposed sound or music and one imposed text. These imposed media had to be respectively used in each of ‘em, but we were allowed to modify them, providing that we kept their artistical meaning. Secondly, each team is opposed to another, like in a single-elimination tournament. Our team hadn’t done the last subject, so we couldn’t win. But, unfortunately, the first round was on the only one subject we didn’t treat, and so, we were eliminated from the beginning of this tournament, that’s sad…
Nevertheless, I was the only one coder in the team, and as such, I’ve chose what method and software we had to use to produce .swf files. I use a Linux distribution, so I couldn’t choose Flash as coding platform. I like free (and also open-source) software, and that’s why I naturally came to Adobe’s Open-Source Flex SDK. But I have been annoyed by the impossibility to debug my animations correctly. Actually, I didn’t know of the “Linux debugger and standalone players” existence… I will publish my work soon, at least for the subject I have to continue. :)

No Comments

HADOPI doesn’t works… As expected??

Is in the same vein as that previous post, it seems that the three-strike-law (I appointed HADOPI™), this article (in french) says that piracy has increased by three percent in France, since the adoption of the law… How pathetic they still believe in this kind of method…

No Comments

Vampire: The Masquerade – Redemption

This day has been particularly nice, at least in term of weather. And, in order to be in a as-good-as-possible-mood, I’ve decided to listen to the fabulous Beyond Good and Evil‘s OST. But after a half-dozen loops of the entire album, I’ve decided to listen to my entire video-game music collection, including the flawless vampire: the masquerade – Redemption main theme :

This game is simply marvellous, it’s one of my favourite ones. It’s sometimes a bit repetitive, a few bosses are pretty hard, and you have often to travel a bit too much to finish a mission; but if you ask me, this great game has one of the better ambiance I’ve seen this far. And, also, the game has a lot of areas with different and surprising atmospheres. It still suffers from common defaults (not enough NPC, not realistic towns and no in-game-social-life, etc.) of games of this epoch (2000), but it’s easily forgiveable given the feelings you can have while playing at it.

Have a nice game! :)

No Comments

Ubuntu Party 2009 @Cité des Sciences de Paris la Villette

Last year (2009) I went to the Ubuntu Party 2009 in the Cité des Sciences de Paris la Villette. It was nice, and I had a great dinner with most of the staff. I didn’t expect much from this event, I have just been there by curiosity; because I didn’t like Ubuntu a lot. And yet, I was impressed by Mark Shuttleworth’s conference¹, which changed my mind and my considerations on it. I thought and I still think it is a crappy Operating system which is also simple to deploy and to use. What has changed is that now, I know that this “imperfect” software is based on very good ideas, and that the Ubuntu team seems to be very dynamic (which means that the correction of any bug or defective design is just a matter of time).

First, Mark told us about cadence (or to plan releases on milestones rather than functionalities). He said that it:

  • Energizes a project
  • Regularises project releases (on a 3/6/12 months basis; adapt the time cycle to the project)
  • Force developers to release their work to the project
  • Gives a rapid feedback from users
  • Makes collaboration between projects easier
  • Allows users to help each other (since they have similar versions of software)

I think this might be a good practice for middle-sized and big projects; while I would prefer “when it’s done” releases for little projects, since it allows more flexibility and give me much more free time when I work alone on a project.

Then, he spoke of the quality of a project, and said that:

  • Projects witch have tests are more open to contributions
  • Automated package creation from stable software branches increases the number of people who really use an up to date version of the software and allows a great feedback on latest versions.
  • It’s important to be aware of the difference between a new software development and the maintenance of the current version of an existing one.
  • There is less pressure to back-port new features (rather than to maintain stable branch) when people know when the next version will be out (see cadence).
  • More aggressive changes can be done since more accurate feedback is available from more users.
  • Automated crash reporting gathers all crash information (mainly from log-files) and spot all problems as they happen.

And finally he got into design, or the way you approach a problem.

  • Best open source software are made by people who instinctively understand (grok) good software design.
  • Design as skill is a profession.
  • Creating both a design and engineering space on a projects make the project healthy.
  • Ask tests from unexpected (aka. random; as instance, people picked from street or at a shop, friends of friends, etc.) people gives a more complete feedback
  • Design is also about functionalities integration into the window manager and all its parts.

In the end, I liked to be there, I learned a lot of things, and now, I still use Ubuntu, but I don’t grumble as often as before about it. ;)

So, see you at the next Ubuntu Party² :)


¹ A post on Mark’s blog about time based release and cycles in free software.
² Due to some slight inconveniences with part of the UP staff, I’ve not been there.

No Comments

Nautilus SVN plugin

Today, I had to checkout some SVN repository, and so, I downloaded subversion. But I reminded that when I used windows, a while ago, a sort of GUI plugin was available for explorer. So, I started to seek for the same thing for Nautilus. And I found out this.

P.S.: I also sorted out this, for those who don’t want to use rabbitvcs. But I haven’t tested it yet.

No Comments

The closure of The Pirate Bay seems to have done nothing to stem the flow of potentially copyri… ORLY?!!!

As written on slashdot, closing TPB doesn’t seem to change anything good concerning piracy spreading. Instead, the number of sites providing unauthorized materials has been said to have increased of 300%.

No Comments