June 19, 2013

Fedora election – voting has begun

Twice an year Fedora hold election cycles to elect members for governing bodies who then guide the project with in for a period of an year. This June, this summer, we are having three elections running for electing members to the following governing bodies.

  1. The Fedora Board
  2. FESCo
  3. FAmSCo

As usual after series of town-hall sessions we are in the phase of voting, However I hope it is not fun as town-halls but you can have a look and vote for the next generation of the governing body members. Please use the following link and cast your vote.

https://admin.fedoraproject.org/voting

The eligibility for voting differ from selection body, you must however has signed CLA to vote all the three governing bodies. Further for the FESCo and FAmSCo you need to be a member of at least a FAS group to vote. So cast your vote and help selecting the next governing body who can shape the project as you envision.

Have Happy Voting !!!

 


June 18, 2013

DIY Bodhi

A little while ago I was asked about how one would go about testing Eclipse Fedora Packager’s Bodhi functionality. Unfortunately it’s not too often that I, or someone else may push an update that coincides with testing.

There’s the Fedora Bodhi Staging instance but even that approach assumes you have an FAS account with the ability to push updates. Also, the person who asked about this didn’t have an account on the staging instance (I guess a combination of having a newer account, and the staging instance database not being updated that often ?)

The last approach I considered, turned out to be the simplest. Create your own Bodhi instance! Instructions are here.

I had some issues compiling on Fedora 18 with fedmsg, so I disabled calls to fedmsg.publish, but for the kind of testing planned that’s not really too important. When determining if a package will be pushed, Bodhi consults the buildsystem to determine whether the action is valid. By default, the buildsystem is a mocked up version of Koji (buildsystem = ‘dev’) that will perform almost any action. You could also set the buildsystem to be Fedora Koji, or maybe even point it to your own Koji instance. This other patch also needed to be applied if you leave your Bodhi instance using the ‘dev’ configuration to properly handle the tags.

From 35874774d8a36bbe11e887968e956721a95c582d Mon Sep 17 00:00:00 2001
From: Roland Grunberg <rgrunber@redhat.com>
Date: Fri, 31 May 2013 18:26:33 -0400
Subject: [PATCH 1/2] Disable fedmsg.publish, and modify to use with Eclipse
 PyDev.

---
 Makefile       |  2 +-
 bodhi/model.py | 52 ++++++++++++++++++++++++++--------------------------
 setup.py       |  2 +-
 start-bodhi    | 13 -------------
 start-bodhi.py | 13 +++++++++++++
 5 files changed, 41 insertions(+), 41 deletions(-)
 delete mode 100755 start-bodhi
 create mode 100755 start-bodhi.py

diff --git a/Makefile b/Makefile
index a8968ec..5d125d1 100644
--- a/Makefile
+++ b/Makefile
@@ -56,7 +56,7 @@ init:
 	rm bodhi-pickledb-*

 run:
-	python start-bodhi
+	python start-bodhi.py

 profile:
 	nosetests --with-profile --profile-stats-file=nose.prof
diff --git a/bodhi/model.py b/bodhi/model.py
index 81e6743..24a5f4d 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -43,7 +43,7 @@ try:
 except ImportError:
     from fedora.tg.util import tg_url

-import fedmsg
+#import fedmsg

 from bodhi import buildsys, mail
 from bodhi.util import get_nvr, rpm_fileheader, header, get_age, get_age_in_days
@@ -448,18 +448,18 @@ class PackageUpdate(SQLObject):
             self.unpush()
             self.comment('This update has been unpushed',
                          author=identity.current.user_name)
-            fedmsg.publish(topic=fedmsg_topic, msg=dict(
-                update=self,
-                agent=identity.current.user_name,
-            ))
+            #fedmsg.publish(topic=fedmsg_topic, msg=dict(
+            #    update=self,
+            #    agent=identity.current.user_name,
+            #))
             flash_log("%s has been unpushed" % self.title)
             return
         elif action == 'obsolete':
             self.obsolete()
-            fedmsg.publish(topic=fedmsg_topic, msg=dict(
-                update=self,
-                agent=identity.current.user_name,
-            ))
+            #fedmsg.publish(topic=fedmsg_topic, msg=dict(
+            #    update=self,
+            #    agent=identity.current.user_name,
+            #))
             flash_log("%s has been obsoleted" % self.title)
             return
         #elif self.type == 'security' and not self.approved:
@@ -489,10 +489,10 @@ class PackageUpdate(SQLObject):
                                                           mybuild['nvr']))
         elif action == 'revoke':
             if self.request:
-                fedmsg.publish(topic=fedmsg_topic, msg=dict(
-                    update=self,
-                    agent=identity.current.user_name,
-                ))
+                #fedmsg.publish(topic=fedmsg_topic, msg=dict(
+                #    update=self,
+                #    agent=identity.current.user_name,
+                #))
                 flash_log('%s %s request revoked' % (self.title, self.request))
                 self.request = None
                 self.comment('%s request revoked' % action,
@@ -575,10 +575,10 @@ class PackageUpdate(SQLObject):
             action, notes, flash_notes))
         self.comment('This update has been submitted for %s by %s. %s' % (
             action, identity.current.user_name, notes), author='bodhi')
-        fedmsg.publish(topic='update.request.' + action, msg=dict(
-            update=self,
-            agent=identity.current.user_name,
-        ))
+        #fedmsg.publish(topic='update.request.' + action, msg=dict(
+        #    update=self,
+        #    agent=identity.current.user_name,
+        #))
         mail.send_admin(action, self)

     def request_complete(self):
@@ -900,11 +900,11 @@ class PackageUpdate(SQLObject):
         if email:
             mail.send(self.people_to_notify(), 'comment', self)

-        if author not in ('bodhi', 'autoqa'):
-            fedmsg.publish(topic='update.comment', msg=dict(
-                comment=c,
-                agent=identity.current.user_name
-            ))
+        #if author not in ('bodhi', 'autoqa'):
+        #    fedmsg.publish(topic='update.comment', msg=dict(
+        #        comment=c,
+        #        agent=identity.current.user_name
+        #    ))

         if self.critpath:
             min_karma = config.get('critpath.min_karma')
@@ -1565,10 +1565,10 @@ class BuildRootOverride(SQLObject):
             self.release.override_tag))
         koji.tagBuild(self.release.override_tag, self.build, force=True)
         mail.send_admin('buildroot_override', self)
-        fedmsg.publish(
-            topic='buildroot_override.tag',
-            msg=dict(override=self, agent=identity.current.user_name),
-        )
+        #fedmsg.publish(
+        #    topic='buildroot_override.tag',
+        #    msg=dict(override=self, agent=identity.current.user_name),
+        #)

     def untag(self):
         koji = buildsys.get_session()
diff --git a/setup.py b/setup.py
index 5207f10..afa5acb 100755
--- a/setup.py
+++ b/setup.py
@@ -174,7 +174,7 @@ setup(
         "kitchen",
         "python-fedora",
         #"hashlib",
-        "fedmsg>=0.0.8",
+        #"fedmsg>=0.0.8",
         "decorator",
         "PIL",
         # The following are not available as eggs so we can't uncomment them.
diff --git a/start-bodhi b/start-bodhi
deleted file mode 100755
index 5896d0f..0000000
--- a/start-bodhi
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/python -tt
-""" Start script for bodhi """
-__requires__='bodhi'
-from bodhi.commands import start, ConfigurationError
-
-if __name__ == '__main__':
-    try:
-        start()
-    except ConfigurationError, exc:
-        import sys
-        sys.stderr.write(str(exc))
-        sys.exit(1)
-
diff --git a/start-bodhi.py b/start-bodhi.py
new file mode 100755
index 0000000..5896d0f
--- /dev/null
+++ b/start-bodhi.py
@@ -0,0 +1,13 @@
+#!/usr/bin/python -tt
+""" Start script for bodhi """
+__requires__='bodhi'
+from bodhi.commands import start, ConfigurationError
+
+if __name__ == '__main__':
+    try:
+        start()
+    except ConfigurationError, exc:
+        import sys
+        sys.stderr.write(str(exc))
+        sys.exit(1)
+
--
1.8.1.4

and

From 9ab7e42232343fff065dbabb91b3c4dcc3193a65 Mon Sep 17 00:00:00 2001
From: Roland Grunberg <rgrunber@redhat.com>
Date: Fri, 31 May 2013 19:35:28 -0400
Subject: [PATCH 2/2] Add rule for the usage of the 'dist' prefix.

The dist prefix has not been used since f15.
---
 bodhi/buildsys.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/bodhi/buildsys.py b/bodhi/buildsys.py
index bf7128c..c3cf9a0 100644
--- a/bodhi/buildsys.py
+++ b/bodhi/buildsys.py
@@ -184,12 +184,13 @@ class DevBuildsys(Buildsystem):
                      'name': 'dist-5E-epel', 'perm': None, 'perm_id': None}]
         else:
             release = build.split('.')[-1].replace('fc', 'f')
+            distStr = "" if int(release[1:]) > 15 else "dist-"
             return [{'arches': 'i386 x86_64 ppc ppc64', 'id': 10, 'locked': True,
-                     'name': 'dist-%s-updates-candidate' % release, 'perm': None, 'perm_id': None},
+                     'name': distStr + '%s-updates-candidate' % release, 'perm': None, 'perm_id': None},
                     {'arches': 'i386 x86_64 ppc ppc64', 'id': 5, 'locked': True,
-                     'name': 'dist-%s' % release, 'perm': None, 'perm_id': None},
+                     'name': distStr + '%s' % release, 'perm': None, 'perm_id': None},
                     {'arches': 'i386 x86_64 ppc ppc64', 'id': 5, 'locked': True,
-                     'name': 'dist-%s-updates-testing' % release, 'perm': None, 'perm_id': None}]
+                     'name': distStr + '%s-updates-testing' % release, 'perm': None, 'perm_id': None}]

     def listTagged(self, tag, *args, **kw):
         return [self.getBuild(), self.getBuild(other=True)]
--
1.8.1.4

After applying those changes, I pretty much had a working local Bodhi instance that could push updates.

eclipse-bodhi-instance

Just about everything could be done within Fedora Eclipse, using the Eclipse Pydev plugin (yum install eclipse-pydev).


Summit talk posted
My summit talk has been posted for those that are curious. It's a deep dive into how we run OpenShift online (http://www.openshift.com)

http://youtu.be/luCxhWdCQwE
Deploying Big Using BitTorrent [Sharing Files Using BitTorrent]
If you just want to share some files without concern of privacy, please check out this short tutorial on bittorrent.com. This article will talk a bit about BitTorrent's basic internals and it's usage to do large code/application deploys.

Scenario: I have to do deploy some application(s) across many co-located data centers. The collective size of deploy will be of the order of tens of GB.

Conventional methods like scp, rsync and http fails:
  • scp will not resume if it breaks at any point. Every time I will have to start over and over again.
  • rsync works well with text files, not so well with binaries (it works nonetheless). The amount of CPU it  eats is unacceptable though.
  • http can resume most of the times but as more servers try to download the application, the bandwidth limitations slow down the entire process.
Enter BitTorrent! 
  • Resumes the download every time. No problem if the connection breaks.
  • Does not eats my CPU.
  • As more servers download, they can act as seeder and actually increase collective bandwidth.
Now let us start the technical details. For torrent to work, you will need to create a torrent file (also known as a metafile). You'll also need a tracker. Tracker keeps track of what all leechers and seeders (collectively known as peers) are there and help in general coordination by announcing the available peers periodically. Finally you will need a torrent client which can seed the files you are going to share. 
Now the problem is that BitTorrent is no longer open sourced. So either you have to get license from BitTorrent, Inc. which can be very costly (I am not sure) or you can use the older code which was once open source and still works like a charm.

For Centos/Red Hat/Scientific Linux, you should try NauLinux School repo:
# vim /etc/yum.repos.d/naulinux-school.repo:
[naulinux-school]
name=NauLinux School
baseurl=http://downloads.naulinux.ru/pub/NauLinux/6.2/$basearch/sites/School/RPMS/
enabled=0
gpgcheck=1
gpgkey=http://downloads.naulinux.ru/pub/NauLinux/RPM-GPG-KEY-linux-ink

Install bittorrent rpm package:
# yum --enablerepo=naulinux-school install bittorrent

For Fedora, you can try downloading the rpm from their build system koji and manually install it.
# yum localinstall ./bittorrent-4.4.0-16.fc15.noarch.rpm

Also install mktorrent which will be used to create torrent meta files.
# yum install mktorrent

Creating a torrent tracker
As I have mentioned before, tracker is a critical piece of the bittorrent setup. It helps in co-ordinating between the peers and maintains a list of the same. It also keeps a record of all the seeds along with the checksum of the torrent. Needless to say that without a torrent tracker, entire bittorrent setup will fail.
You can setup a tracker for yourself easily. Just run the following command on CentOS:
$ bittorrent-tracker  --port 8080 --dfile dstate --logfile tracker.log

For Fedora, you can use the bttrack command after installing the bittorent package:
$ bttrack --port 8080 --dfile dstate --logfile tracker.log

Alternatively, you can use one of the public tracker like OpenBitTorrent. This may save you sometime.

Creating a torrent metafile
Once we have the tracker up, we need to create the actual torrent file to distribute. A torrent file contains bencoded data about the files and the announce URL of the tracker along with some other information.
Creating torrent using mktorrent easy but if you prefer GUI, you can use transmission or any other bittorrent client.
$ mktorrent -a http://tracker.example.com:8080/announce -l 18 -v /path/to/the/app

Here -a specifies the tracker's announce url which we created before. -l flag specifies the size of each chunk of file which will be transferred at a time and -v flag is for verbosity.

Once the torrent metafile is created, you need to seed the torrent so that other peers can download it. I like to use rtorrent for this:
# yum install rtorrent
$ rtorrent <path to the torrent metafile>


Here is an easy-to-follow tutorial, if you are more interested in rtorrent.

Tips for peaceful life
There are certain parameters that can be tweaked for better performance. While making the torrent try adjusting the -l flag to a higher value if you have really good bandwidth. Since my deployment was for a bunch of data centers which have really good bandwidth, I usually set it up to 20.

If you do the deploys without taking out the machines from production, it is possible to limit the bandwidth usage of torrent client. This comes really handy and helps in avoiding the clogging of network pipes. Check out the tutorials and docs of your torrent client to know about these controls.

Before initiating the transfer, always make sure that you inform the relevant data center technicians and network operations guys. I did not, the first time, and due to huge spike in network, the one of the data center ops thought that we are under some sort of DOS attack and cut off connectivity to all our servers resulting in minor service disruption.

Happy deploying!

Discuss this post on Hacker News.
XChat a ferramenta de comunicação dos projetos open source

Quanto mais colaboramos com um projeto open source mais mudamos nossa rotina e visualizamos novas ferramentas que maximizam nossa interação com a comunidade como um todo. Uma das principais ferramentas é o XChat, pois ela permite que tenhamos acesso a diversos servidores irc e canais dos projetos, este tipo de contato é importantíssimo, pois é nestes canais que ocorrem as principais reuniões e discussões sobre cada projeto, logo não utilizar uma ferramenta como o XChat é como ficar de fora destes debates, sendo assim vou apresentar algumas dicas que podem ser úteis para você que esta iniciando.

 

Servidores IRC:

Existem dezenas de servidores irc espalhados pelo mundo, logo vou citar apenas dois dos que considero os mais relevantes:

   FreeNode

O FreeNode é um dos principais servidores e nele você irá encontrar centenas de canais de inúmeros projetos e comunidades open source, principalmente do Projeto Fedora, onde eu participo diariamente do #fedora-latam,  #fedora-ambassadors, #fedora-devel, entre outros.

Ao contrário do que alguns acreditam o “#” dos canais não copiou o conceito do hastag, utilizado em redes sociais pela internet, mas sim o conceito de hastag venho justamente do irc, pois ao querermos conversar sobre um determinado assunto entramos no canal com o seu respectivo nome, exemplo: #ovirt, neste canal os assuntos relacionados ao projeto open source oVirt são tratados.

Se você já tem o XChat instalado vou passar o procedimento correto de uso e inscrição no FreeNode, caso não tenha o XChat instalado simplesmente instale-o em seu Fedora:

# yum install xchat

Ao abrirmos o XChat vou mostrar como automatizar o seu dia-a-dia, logo vamos começar ignorando a tela inicial de “Network list”:

Marcando a opção “Skip network list on startup”. Após vamos aos comandos para o irc da FreeNode:

/server chat.freenode.net

Todos os comandos em um irc server devem iniciar com o “/”, o comando acima nos permite entrar no irc server da FreeNode.

Agora que entramos precisamos registrar nosso nickname(apelido) para que outros usuários não utilizem nosso nickname, sendo assim vamos ao processo de registro:

/nick meu_apelido

/msg nickserv register minha_senha meu_e_mail

Como podemos ver acima escolhemos um apelido no primeiro comando e no segundo comando enviamos uma mensagem ao nickserv(servidor de irc) solicitando o registro do apelido a pouco escolhido juntamente com nosso e-mail, pois a FreeNode envia um e-mail solicitando a sua confirmação.

/msg nickserv verify register meu_apelido token_recebio_no_e_mail

Ao recebermos o e-mail de verificação de registro ele nos informa exatamente o comando que temos que inserir no XChat, assim ele contém um importante tocken que irá validar meu registro. Lembrando que se escolhermos um nome já registrado as mensagens do nickserv irão nos mostrar que nosso apelido já esta registrado, logo devemos escolher um apelido livre/não utilizado e seguir o processo.

Com o registro realizado devemos nos identificar sempre que entrarmos na FreeNode ou em outro irc server:

/msg nickserv identify minha_senha

Assim completamos o processo de registro na FreeNode.

  OFTC

Outro irc server que costumo utilizar é o OFTC, logo seguimos o mesmo processo, porém o OFTC não envia e-mail de confirmação, ele apenas solicita o registro sem a informação de seu e-mail.

Automatizando o XChat:

Imagine diariamente você ter que entrar no XChat, entrar em dois ou mais servidores irc diferentes, identificar-se em cada um dos servidores e ainda entrar em diversos canais, em cada um dos servidores irc que você costuma entrar, inevitavelmente você poderá esquecer o nome de um canal, ou mesmo desistir de usar essa forma de comunicação, pensando nisso o XChat permite que você crie scripts de automação, sendo assim vamos criar o nosso script, mas não se preocupe, você não precisa saber programar é simplesmente unir os seus comando diários em um único arquivo:

$ vim ~./meu_script_xchat.txt

Dentro deste arquivo vamos inserir o que fariamos manualmente em nosso dia-a-dia, exemplo:

server chat.freenode.net

msg nickserv identify minha_senha

join #fedora-latam

join #fedora-devel

join #fedora-ambassadors

…..

Como podemos ver colocamos TODOS nossos comandos em um único arquivo que ao abrirmos nosso XChat será carregado com um único comando:

/load -e ~/meu_script_xchat.txt

Somente temos que cuidar o local(path) onde guardamos nosso arquivo, pois acredito que ele deve estar em um local de seu fácil acesso para você e também seguro, também devemos observar que no arquivo de automação não precisamos usar a “/” nos comandos e podemos inserir quantos servidores irc, se assim desejarmos, e também quantos canais quisermos.

Bom proveito e seja bem vindo em nossos canais do projeto Fedora.

Des Kaisers neue Kleider – oder: neues Theme für Fedora-Blog.de gesucht

Das Theme von Fedora-Blog.de ist inzwischen ein wenig in die Jahre gekommen und um ehrlich zu sein, mit sehr heißer Nadel gestrickt. Die Hauptprämisse war seinerzeit, das Fedora-Blog.de ein “eigenes” Theme haben sollte und nicht das Standard-Theme von WordPress.

Um eventuellen Problemen bei Updates aus dem Weg zu gehen, wurde seinerzeit der Weg über ein Child-Theme von TwentyTen gewählt, da so nur die gewünschten Änderungen gemacht werden mussten, ohne gleich ein komplettes Theme designen zu müssen.

Nach all den Jahren täte dem Blog aber auch ein frischer Anstrich sicher nicht schaden. Deshalb rufen wir zu einem Fedora-Blog Theme 3.0 Design-Wettbewerb auf. Das aktuelle Theme ist auf GitHub zu finden und kann als Ausgangsbasis verwendet werden.

Folgende Anforderungen sollte das neue Theme erfüllen:

  • Die Änderungen/Erweiterungen in der functions.php und der styles.css müssen übernommen werden.
  • Die fedora-typischen Blautöne sollten Verwendung finden.
  • Es sollten nach Möglichkeit nur Standardfunktionen von WordPress verwendet werden, damit es möglichst keine Probleme mit Plugins oder bei Updates gibt.
  • Das fertige Theme sollte nach Möglichkeit unter einer freien Lizenz (CC oder GPL) lizenziert sein.
  • Nice to have wäre, wenn auf der Startseite nur Auszüge der einzelnen Posts mit einem Weiterlesen-Link angezeigt werden.

Wer an dem Wettbewerb teilnehmen möchte, schicke uns einfach einen Link zu dem Git-Repository mit seinem Theme-Entwurf. Wir werden dann die Screenshots der Entwürfe hier gesammelt veröffentlichen und die Leser abstimmen lassen, welches Theme wir in Zukunft verwenden sollen.

Selbstverständlich darf sich der Schöpfer in der Fußzeile des Themes verewigen.

Pequena alteração no banner
Olá leitor,
Fiz uma pequena alteração no banner do blog. Coloquei uns discos de vinil (!) no lugar da máscara da HQ "V de Vingança", pois percebi que esta máscara está sendo utilizada em protestos no Brasil e no Mundo; deixo claro que não tenho nenhuma relação com estes protestos, muito pelo contrário, questiono sua necessidade e autenticidade ideológica. 
Originalmente eu tinha colocado a figura para evidenciar um fenômeno mundial cujo estopim foi a divulgação, por parte do Wikileaks, de dados confidenciais do governo americano. 
Aproveito para frisar que política não é o foco deste blog.

Paz e bem,
Renato.
Fedora Workshop, SJCE, Chennai

A Fedora workshop was organised at St. Joseph’s College of Engineering, Chennai, Tamil Nadu, India on Friday, June 14, 2013. The participants were students from the Master of Computer Applications (MCA) department.

The forenoon session began with an introduction to Free/Open Source Software (F/OSS) and Fedora. I explained the various project and communication guidelines that students need to follow, and mentioned the various Fedora sub-projects that they can contribute to. System architecture, and compilation concepts were also discussed. The need to use free and open standards was emphasized. Copyright, and licensing were briefly addressed.

MCA lab

After lunch, a programming lab session was held to see how students solve problems. Their code was reviewed, and suggestions for improvement were given. Klavaro was shown to students to learn touch typing. I also gave an overview of GCC using the “Introduction to GCC” presentation. The concept of using revision control systems was illustrated. A demo of Fedora 18 (x86_64) was shown, and the same was installed on the lab desktops.

Thanks to Prof. Parvathavarthini Mam for working with me in organizing this workshop. Thanks also to Prof. Shirley for managing the logistics.

Few photos taken during the trip are available in my /gallery.

Darkserver Improvement : Google Summer of Code 2013

It’s better later than never. It’s been two week since the Google Summer of Code 2013 results were announced and I am glad to say that I got selected this year.

I will be working on Darkserver Improvment under Fedora. One can see a draft of my proposal here. My mentor is Kushal Das and i am really helpful for helping me out in the whole process both in code and application.


RSA Key Sizes: 2048 or 4096 bits?

Many people are taking a fresh look at IT security strategies in the wake of the NSA revelations. One of the issues that comes up is the need for stronger encryption, using public key cryptography instead of just passwords. This is sometimes referred to as certificate authentication, but certificates are just one of many ways to use public key technology.

One of the core decisions in this field is the key size. Most people have heard that 1024 bit RSA keys have been cracked and are not used any more for web sites or PGP. The next most fashionable number after 1024 appears to be 2048, but a lot of people have also been skipping that and moving to 4096 bit keys. This has lead to some confusion as people try to make decisions about which smartcards to use, which type of CA certificate to use, etc. The discussion here is exclusively about RSA key pairs, although the concepts are similar for other algorithms (although key lengths are not equivalent)

The case for using 2048 bits instead of 4096 bits

  • Some hardware (many smart cards, some card readers, and some other devices such as Polycom phones) don't support anything bigger than 2048 bits.
  • Uses less CPU than a longer key during encryption and authentication
  • Using less CPU means using less battery power (important for mobile devices)
  • Uses less storage space: while not an issue on disk, this can be an issue in small devices like smart cards that measure their RAM in kilobytes rather than gigabytes

So there are some clear benefits of using 2048 bit keys and not just jumping on the 4096 bit key bandwagon

The case for using 4096 bits

  • For some types of attack, security is not just double, it is exponential. 4096 is significantly more secure in this scenario. If an attack is found that allows a 2048 bit key to be hacked in 100 hours, that does not imply that a 4096 bit key can be hacked in 200 hours. The hack that breaks a 2048 bit key in 100 hours may still need many years to crack a single 4096 bit key
  • Some types of key (e.g. an OpenPGP primary key which is signed by many other people) are desirable to keep for an extended period of time, perhaps 10 years or more. In this context, the hassle of replacing all those signatures may be quite high and it is more desirable to have a long-term future-proof key length.

The myth of certificate expiration

Many types of public key cryptography, such as X.509, offer an expiry feature. This is not just a scheme to force you to go back to the certificate authority and pay more money every 12 months. It provides a kind of weak safety net in the case where somebody is secretly using an unauthorised copy of the key or a certificate that the CA issued to an imposter.

However, the expiry doesn't eliminate future algorithmic compromises. If, in the future, an attacker succeeds in finding a shortcut to break 2048 bit keys, then they would presumably crack the root certificate as easily as they crack the server certificates and then, using their shiny new root key, they would be in a position to issue new server certificates with extended expiry dates.

Therefore, the expiry feature alone doesn't protect against abuse of the key in the distant future. It does provide some value though: forcing people to renew certificates periodically allows the industry to bring in new minimum key length standards from time to time.

In practical terms, content signed with a 2048 bit key today will not be valid indefinitely. Imagine in the year 2040 you want to try out a copy of some code you released with a digital signature in 2013. In 2040, that signature may not be trustworthy: most software in that era would probably see the key and tell you there is no way you can trust it. The NIST speculates that 2048 bit keys will be valid up to about the year 2030, so that implies that any code you sign with a 2048 bit key today will have to be resigned with a longer key in the year 2029. You would do that re-signing in the 2048 bit twilight period while you still trust the old signature. Fortunately, there are likely to be few projects where such old code will be in demand.

4096 in practice

One of the reasons I decided to write this blog is the fact that some organisations have made the 4096 bit keys very prominent (although nobody has made them mandatory as far as I am aware).

Debian's guide to key creation currently recommends 4096 bit keys (although it doesn't explicitly mandate their use)

Fedora's archive keys are all 4096 bit keys.

The CACert.org project has developed a 4096 bit root

These developments may leave people feeling a little bit naked if they have to use a shorter 2048 bit key for any of the reasons suggested above (e.g. for wider choice of smart cards and compatibility with readers). It has also resulted in some people spending time looking for 4096 bit smart cards and compatible readers when they may be better off just using 2048 bits and investing their time in other security improvements.

In fact, the "risk" of using only 2048 rather than 4096 bits in the smartcard may well be far outweighed by the benefits of hardware security (especially if a smartcard reader with pin-pad is used)

My own conclusion is that 2048 is not a dead duck and using this key length remains a valid decision and is very likely to remain so for the next 5 years at least. The US NIST makes a similar recommendation and suggests it will be safe until 2030, although it is the minimum key length they have recommended.

My feeling is that the Debian preference for 4096 bit PGP keys is not based solely on security, rather, it is also influenced by the fact that Debian is a project run by volunteers. Given this background, there is a perception that if everybody migrates from 1024 to 2048, then there would be another big migration effort to move all users from 2048 to 4096 and that those two migrations could be combined into a single effort going directly from 1024 to 4096, reducing the future workload of the volunteers who maintain the keyrings. This is a completely rational decision for administrative reasons, but it is not a decision that questions the security of using 2048 bit keys today. Therefore, people should not see Debian's preference to use 4096 bit keys as a hint that 2048 bit keys are fundamentally flawed.

Unlike the Debian keys (which are user keys), the CACert.org roots and Fedora archive signing keys are centrally managed keys with a long lifetime and none of the benefits of using 2048 bit keys is a compelling factor in those use cases.

Practical issues to consider when choosing key-length

Therefore, the choice of using 2048 or 4096 is not pre-determined, and it can be balanced with a range of other decisions:

  • Key lifetime: is it a long life key, such as an X.509 root for an in-house CA or an OpenPGP primary key? Or is it just for a HTTPS web server or some other TLS server that can be replaced every two years?
  • Is it for a dedicated application (e.g. a closed user group all using the same software supporting 4096 bit) or is it for a widespread user base where some users need to use 2048 bit due to old software/hardware?
  • Is it necessary to use the key(s) in a wide variety of smartcard readers?
  • Is it a mobile application (where battery must be conserved) or a server that is likely to experience heavy load?
Daily log June 17th 2013

Busy day. Hit a whole bunch of new bugs.

Daily log June 17th 2013 is a post from: codemonkey.org.uk

Turbocharge DevStack with Raid 0 SSDs

Turbocharging DevStack

I wanted to turbocharge my development cycle of OpenStack running on Fedora 18 so I could be waiting on my brain rather then waiting on my workstation.  I decided to purchase two modern solid state drives (SSD) and run them in RAID 0.  I chose two Intel S3500 160 GB Enterprise grade SSDs to run in RAID 0.  My second choice was the Samsung 840 Pro which may have been a bit faster, but perhaps not as reliable.

Since OpenStack and DevStack mostly use /var and /opt for their work, I decided to replace only /var and /opt.  If a SSD fails, I am less likely to lose my home directory which may contain some work in progress because of the lower availability of RAID 0.

The Baseline HP Z820

For a baseline my system is a Hewlett Packard Z820 workstation (model #B2C08UT#ABA) that I purchased from Provantage in January 2013.  Most of the computer is a beast sporting an 8 core Intel Xeon 35-2670 @ 2.60GHZ running with Hyperthreading for 16 total cpus, Intel C602 chipset,  and 16 GB Quad Channel DDR3 ECC Unbuffered RAM.

The memory is fast as shown with ramspeed:

[sdake@bigiron ramspeed-2.6.0]$ ./ramspeed -b 3 -m 4096
RAMspeed (Linux) v2.6.0 by Rhett M. Hollander and Paul V. Bolotoff, 2002-09

8Gb per pass mode

INTEGER   Copy:      11549.61 MB/s
INTEGER   Scale:     11550.59 MB/s
INTEGER   Add:       11885.79 MB/s
INTEGER   Triad:     11834.27 MB/s
---
INTEGER   AVERAGE:   11705.06 MB/s

Unfortunately the disk is a pokey 1TB 7200 RPM model.  The hdparm tool shows a pokey 118MB/sec.

[sdake@bigiron ~]$ sudo hdparm -tT /dev/sda
/dev/sda:
Timing cached reads: 20590 MB in 2.00 seconds = 10308.76 MB/sec
Timing buffered disk reads: 358 MB in 3.02 seconds = 118.69 MB/sec

Using the Gnome 3 Disk Image Benchmarking tool show a lower average of 82MB per second, although this is also passing through the LVM driver:

bench-disk

Warning: I didn’t run this benchmark with write enabled, as it would have destroyed the data on my disk.

Running stack.sh takes 6 minutes:

[sdake@bigiron devstack]$ ./stack.sh
Using mysql database backend
Installing package prerequisites...[|[/]^C[sdake@bigiron devstack]$ 
[sdake@bigiron devstack]$ ./stack.sh
Using mysql database backend
Installing package prerequisites...done
Installing OpenStack project source...done
Starting qpid...done
Configuring and starting MySQL...done
Starting Keystone...done
Configuring Glance...done
Configuring Nova...done
Configuring Cinder...done
Configuring Nova...done
Using libvirt virtualization driver...done
Starting Glance...done
Starting Nova API...done
Starting Nova...done
Starting Cinder...done
Configuring Heat...done
Starting Heat...done
Uploading images...done
Configuring Tempest...[/]
Heat has replaced the default flavors. View by running: nova flavor-list
Keystone is serving at http://192.168.1.20:5000/v2.0/
Examples on using novaclient command line is in exercise.sh
The default users are: admin and demo
The password: 123456
This is your host ip: 192.168.1.20
done
stack.sh completed in 368 seconds

I timed a heat stack-create operation at about 34 seconds.  In a typical day I may create 50 or more stacks, so the time really adds up.

Turbo-charged DevStack

After installing two SSD devices, I decided to use LVM raid 0 striping.  Linux Magazine indicates mdadm is faster, but I prefer a single management solution for my disks.

The hdparm tool shows some a beast 1GB/sec throughput on reads:

[sdake@bigiron ~]$ sudo hdparm -tT /dev/raid0_vg/ssd_opt

/dev/raid0_vg/ssd_opt:
Timing cached reads: 21512 MB in 2.00 seconds = 10771.51 MB/sec
Timing buffered disk reads: 3050 MB in 3.00 seconds = 1016.47 MB/sec

I also ran the Gnome 3 disk benchmarking tool, this time in write mode.  It showed an average 930MB/sec read and 370MB/sec write throughput:

pic2

I ran stack.sh in a little under 3 minutes:

[sdake@bigiron devstack]$ ./stack.sh
Using mysql database backend
Installing package prerequisites...done
Installing OpenStack project source...done
Starting qpid...done
Configuring and starting MySQL...done
Starting Keystone...done
Configuring Glance...done
Configuring Nova...done
Configuring Cinder...done
Configuring Nova...done
Using libvirt virtualization driver...done
Starting Glance...done
Starting Nova API...done
Starting Nova...done
Starting Cinder...done
Configuring Heat...done
Starting Heat...done
Uploading images...done
Configuring Tempest...[|]
Heat has replaced the default flavors. View by running: nova flavor-list
Keystone is serving at http://192.168.1.20:5000/v2.0/
Examples on using novaclient command line is in exercise.sh
The default users are: admin and demo
The password: 123456
This is your host ip: 192.168.1.20
done
stack.sh completed in 166 seconds

I timed a heat stack create at 6 seconds.  Comapred to the non-ssd 34 seconds, RAID 0 SSDs rock!  Overall system seems much faster and benchmarking shows it.


June 17, 2013

Freestyle Fun

Es ist wieder einmal Zeit für einen neuen Screencast. Dieses Mal wird gezeigt wie mit der, in Version 2.67 von Blender neuen Funktion Freestyle ein Blueprint erzeugt wird. Eine kleine Rolle hat auch Inkscape gespielt. Also viel Spaß beim Nachmachen und wer dafür das kleine Flugzeug benötigt, findet es hier zum Download.

Wohin mit Bugreports und Feature-Request?

Florian Weimer hat heute auf der Entwicklerliste von Fedora die Frage aufgeworfen, ob man Bugreports und Feature-Requests zu einem Paket im Bugtracker von Fedora/Red Hat oder im Bugtracker des jeweiligen Projektes (Upstream) posten soll. Weimer begründet seine Frage damit, das er es nicht einsieht, in jedem Upstream-Bugtracker einen Account anzulegen, nur um einen Fehler zu melden oder einen Verbesserungsvorschlag zu machen. Viel mehr sieht er dies als Aufgabe der Paket-Maintainer an.

Im Verlauf der teilweise recht hitzigen Diskussion wurde jedoch auch angemerkt, das es für viele Maintainer zeitlich kaum zu leisten sei, sowohl den Fedora- als auch den Upstream-Bugtracker quasi als man in the middle zu betreuen und das es deshalb jedem Maintainer selber überlassen sei, wie mit Bugs umgehe, die eigentlich in den Upstream-Bugtracker gehören. Einigkeit bestand jedoch darin, dass das komplette Ignorieren des Fedora-Bugtrackers, das von verschiedenen Maintainern betrieben wird, eher kontraproduktiv ist.

Wie denken die Leser von Fedora-Blog.de über das Thema?

Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.
Updated Inkscape trunk builds for Fedora

I just updated the repo for the inkscape trunk builds for fedora. See my previous post here for details on initially setting this repo up. If you have already set the repo up, this updated package provides inkscape trunk revision 12379, with the following changes since the previous build (rev 12353)

[12379] Fix layer selection so defs don't change layers, updated 
          symbol text.
[12378] Fix for 1184408 : Additional zoom levels in zoom context menu
[12377] Revert Fix for 600285 : Zoom slider
[12376] Improve icons for symbols dialog
[12375] Fix crash for external symbol documents, should never select 
        these items.
[12374] Big change in symbols ui and selection chemistry.
[12373] Allow svg elements to be ungrouped
[12372]  Do not allow markers for children of markers (prevent loop)
[12371] Use fixed inkscape icon for 'no-marker' instead of gtk theme icon
[12370] Fix Apache2 license conflict with GPL with re-license from 
        SOIX upstream
[12369] Use 'remove' instead of 'gtk-remove' for theme.
[12368] Restore the old behavior of autogen.sh (do not automatically 
        run configure).
[12367] Change back to using NULL and fix windows theme error by checking
[12366] Fix bug where symbols weren't identified as such
[12365] extensions. hpgl input. new import routine by TimeWaster
[12364] Fix new bug with No-Marker having no icon, use Stock GTK::Remove icon 
        for No-Marker.
[12363] Change marker layout in stroke-widget so they are all on one line.
[12362] use visual bbox in calculation of filter area (Bug 1188336)
[12361] Remove use of separate array for scale values.
[12360] Replace multiple copies of GTK2/GTK3 #ifdef code with single helper 
        function.
[12359] Refactor --export-pdf-version detection. If the user try to export the 
        pdf and ps versions at one run, the sp_export_pdf detection would fail. 
        A better approach (this commit) is to check the mime argument.
[12358] C++ conversion of parallel arrays to vector of class instances.
[12357] Check for value in range before dereferencing.
[12356] Glibmm 2.32+ fix extended to optional components. Fixes bug #1179338.
[12355] Adding inclusion of config.h where needed for threads.h check
[12354] Warning cleanup.
Google map fail under Firefox 17.0

The new google map it's now online. Every one know's this news.

The google devolopment team told us:

The new Google Maps is redrawn for every search and click you make...

Really !?

I have last update of firefox, see :

So firefox is not good for google map.

You can read more news and tutorials here.

Be carefull when updating from RHEL6.1 to RHEL6.4

If you have a RHEL6.1 and try to update to RHEL6.4, you will get some strange errors, about missing libraries.

The reason is that ldconfig will not run anymore, because /etc/ld.so.conf.d/kernel-2.6.32-* sepcifies hwcap 0 till RHEL6.1 and RHEL 6.2 and higher specifies hwcap 1.

It the settings are different you get this error message:

ldconfig: /etc/ld.so.conf.d/kernel-2.6.32-71.29.1.el6.x86_64.conf:6: hwcap index 1 already defined as nosegneg

ldconfig cannot run after installing new libraries and some symlinks are broken.
To Fix: simply change all hwcap setting to 1 and rerun ldconfig.

FUDCon Training Install Fest en la U Andina termina con exito
Hola, después de mucho tiempo. Les cuento que tengo un reto muy grande para septiembre, nos toca realizar el FUDCon-Latam en la ciudad del Cusco y como parte de las actividades, hemos planeado talleres previos. El primero fue el FUDCon Training Install Fest, que se llevo a cabo el 15 de junio en la Universidad Andina del Cusco.

Todo fue muy bien y tuvimos 30 asistentes. Todo inicio con un pequeño retraso pero al final todo fue bien.
Regalamos discos de Fedora con LXDE, XFCE y el spin de seguridad.

Comencé yo con las charlas, hable un poco del proyecto GNU y Linux. Introduje algunos conceptos acerca distribuciones GNU/Linux, Fedora y la comunidad Fedora. Hubieron muchas preguntas :-D





Cuando estaba en la rueda de preguntas llego el Ing. Edwing Carrasco justo a tiempo para su charla sobre que era el software libre. Compartió con los asistentes una visión muy particular de las cosas y nos animo a todos a poner la mano para que GNU/Linux y Fedora alcancen el exito.




Luego nuestro amigo Cesar Villacorta hablo respecto al FUDCon regalo polos y discos (se creia papa noel)


Para terminar la rueda de charlas Eduardo Echevarria nos hablo de la comunidad Fedora en Latinoamerica y que es lo que hace falta para que la comunidad crezca.



Finalmente iniciamos con algunas instalaciones de fedora en algunas laptops, fue genial.


 Nos olvidamos de tomarles fotos a todos, pero con algunos asistentes y los chicos y chicas que nos ayudaron posaron para las camaras :-D



Gracias a todos por asistir a nuestro primer taller.....
Elecciones del Proyecto Fedora

Yo ya voté

En este momento los contribuidores de fedora, que tengan su cuenta abierta en el proyecto fedora y sean miembros de al menos un equipo del Proyecto Fedora pueden elegir a las personas que dirigen esta comunidad. Estan abiertas las votaciones para la Junta Directiva, para el comité de ingeniería y para el comité de embajadores.

Para mí es especial participar de una comunidad tan transparente y sobre todo con pocos niveles jerárquicos. En particular en el comité de embajadores hay representación de candidatos latinoamericanos, y yo los apoyo. Sin embargo, las propuestas de cada quien estan ahí y ustedes pueden valorar quien ha definido mejor sus objetivos en cada uno de estos puestos.

Para votar, nada más simple que ir a la página de votación.

Hacker's Log 2013-06-16

I had a relaxing weekend and most of today was the same. I did do a little hacking on Tahrir, though. I made some design updates in preparation for adding all sorts of cool metrics and functionality this week. Tomorrow I'll be tackling some database connection rewiring between Tahrir and Tahrir-API. After that, I'll be able to make all sorts of awesome updates.

Feedback

Please, send your questions and comments in a plain text email to oddshocks at riseup dot net. I may respond publicly, so please tell me if you would not like the email content and/or your name published.

June 16, 2013

#changeBrazil

What is really happening in Brazil?


<iframe allowfullscreen="" frameborder="0" height="315" src="http://www.youtube.com/embed/AIBYEXLGdSg" width="560"></iframe>

First time with Fedora Gooey Karma

Fedora Gooey Karma now has its own repository! It was developed by examon (Tomas Meszaros) who wrote some basic functionality before. I’ve forked his repository and created a new one which will be the main for Google Summer of Code.

Problem with threads

Tomas did a lot of great work but the code needed some tweaks. The main problem I’ve hit was with threads in Python. BodhiClient query started from thread got stuck in deadlock. It’s important to have internet queries in different thread than main GUI to don’t get it freeze for user.

So I filled a bug 972429 against fedora-python (it contains BodhiClient class) because I thought it’s problem with that. After IRC discussion with Toshio Kuratomi we figured out that problem is in implementation of python (or QT) threads. Thread cannot be spawned from imported library as it’s mentioned on the very bottom of official docs page.

Firstly, other than in the main module, an import should not have the side effect of spawning a new thread and then waiting for that thread in any way. Failing to abide by this restriction can lead to a deadlock if the spawned thread directly or indirectly attempts to import a module.

This problem was pretty serious because Tomas’s code has pretty much everything imported from one main file. I had to rewrite it to some “less abstract” code. I’ve split classes to separated files. Now we have two main “workers”. :) One is for packages which get info mainly from RPM database or YUM. Second one is communicating with Bodhi servers. Application spawns 15 threads of Bodhi workers now and I hope it will be good enough to have relevant results from servers in quite a short time.

You can see these changes in this and this commit.

What to do next

Now I’m going to edit Makefile to have it properly “installable” on system because it’s runnable from src/fedora-gooey-karma which can be a little confusing for random strangers now. :)


[QuickTip] Cómo pausar aplicaciones en Linux

Recientemente, nos tocó enterarnos de las "novedades" de OS X 10.9 "Mavericks". Una de las supuestas "novedades" es algo interesante que desde siempre se ha podido hacer en Linux: Pausar Aplicaciones ondemand.

¿Para qué nos sirve esto? Bueno, pues para evitar que una aplicación nos consuma recursos si no se está usando mientras el ordenador tiene cargas drásticas de trabajo. En una laptop incluso ayuda al ahorro de energía. ¿Cómo podemos hacerlo? Sencillo:

Método por consola

La pausa de aplicaciones se logra por medio de algo que se llaman "PID's" o Identificadores de procesos. Si te gusta usar la consola como a mí, puedes hacer esta gestión con 2 simples comandos:

1.- pgrep aplicación/daemon

(Ejemplos: "pgrep firefox/pgrep sshd"). Nos permite saber el PID de una aplicación determinada. Apps "multiproceso" como Chrome nos devolverán varios, pero el primero es el proceso padre, es decir, el que nos interesa.

2.- kill -19 PID 

Pausa la aplicación

3.- kill -18 PID

Reanuda la aplicación

Método Gráfico

Si lo tuyo no son las terminales, entonces puedes hacerlo también en modo gráfico. Por ejemplo, en el monitor del sistema de KDE, le das con el botón secundario al proceso deseado y le mandas la señal de STOP, CONTINUE o cualquiera de las disponibles según te sea necesario:


En este caso si se trata de una app multiproceso, el proceso padre (es decir, el que nos interesa en realidad) es aquél con el ícono de la aplicación representándolo. Me imagino que en el task manager de otros escritorios pasa lo mismo.

Monitoring with Ganglia: an O'Reilly community book project

I recently had the opportunity to contribute to an O'Reilly community book project, developing the book Monitoring with Ganglia in collaboration with other members of the Ganglia team



The project itself, as a community book, pays no royalties back to the contributors, as we have chosen to donate all proceeds to charity. People who contributed to the book include
Robert Alexander, Jeff Buchbinder, Frederiko Costa, Alex Dean, Dave Josephsen, Bernard Li, Matt Massie, Brad Nicholes, Peter Phaal and Vladimir Vuksan and we also had generous assistance from various members of the open source community who assisted in the review process.

Ganglia itself started at University of California, Berkeley as an initiative of Matt Massie, for monitoring HPC cloud infrastructure

My own contact with Ganglia only began in 2008 when I was offered the opportunity to work full-time on the enterprise-wide monitoring systems for a large investment bank. Ganglia had been chosen for this huge project due to it's small footprint, support for many platforms and it's ability to work on a heterogeneous network as well as providing dedicated features for the bank's HPC grid.

This brings me to one important point about Ganglia: it's not just about HPC any more. While it is extremely useful for clusters, grids and clouds, it is also quite suitable for a mixed network of web servers, mail servers, databases and all the other applications you may find in a small business, education or ISP environment.

Instantly up and running with packages

One of the most compelling features, even for small sites with less than 10 nodes, is the ease of installation: install the packages on Debian, Ubuntu, Fedora, OpenCSW and some other platforms, and it just works. Ganglia nodes will find each other over multicast, instantly, no manual configuration changes necessary. On one of the nodes, the web interface must be installed for viewing the statistics. Dare I say it: it is so easy, you hardly even need the book for a small installation.

Where the book is really compelling is if you have hundreds or thousands of nodes, if you want custom charts or custom metrics or anything else beyond just installing the package. If monitoring is more than 10% of your job, the book is probably a must-have.

Excellent open source architecture

Ganglia's simplicity is largely thanks to the way it leverages other open source projects such as Tobi Oetiker's RRDtool and PHP

Anybody familiar with these tools will find Ganglia is particularly easy to work with and customise.

Custom metrics: IO service times

One of my own contributions to the project has been the creation of ganglia-modules-linux, some plugins for Linux-specific metrics and ganglia-modules-solaris providing some similar metrics for Solaris.

These projects on github provide an excellent base for people to fork and implement their own custom metrics in C or C++

The book provides a more detailed account of how to work with the various APIs for Python, C/C++, gmetric (command line/shell scripts) and Java.

The new web interface

For people who had tried earlier versions of Ganglia (and for those people who installed versions < 3.3.0 and still haven't updated), the new web interface is a major improvement and well worth the effort to install.

It is available on the most recent packages (for example, it is in Debian 7 (wheezy) but not in Debian 6.)

It was originally promoted as a standalone project (code-named gweb2) but was adopted as the official Ganglia web interface around the release of Ganglia 3.3.0. This web page provides a useful overview of what has changed and here is the original release announcement.

robot scara con openCV
Esta es una prueba de un robot SCARA fabricado con 3 servos para el brazo actuador y 2 servos para controlar una cámara web.
Los brazos actuadores de tipo SCARA son un sistema muy eficiente para poner objetos en un espacio horizontal.
en esta pagina excelente se explica como calcular la cinematica inversa de de un brazo SCARA para obtener el angulo de os 2 servos que representan el brazo y ante brazo.
Este robot fue diseñado para hacer distintas pruebas, en este caso, se utilizo para "jugar" al clásico juego infantil TA-TE-TI, donde el robot usando visión artificial para determinar la jugada echa por el humano (los cuadrados naranjas) usando openCV con la función cv.SURF para detectar imágenes planas


vista del brazo actuador


cámara web para visión artificial


detalle de la placa ICARO



<object class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://i1.ytimg.com/vi/40XXQrdgbnc/0.jpg" height="266" width="320"><param name="movie" value="http://www.youtube.com/v/40XXQrdgbnc?version=3&amp;f=user_uploads&amp;c=google-webdrive-0&amp;app=youtube_gdata"/><param name="bgcolor" value="#FFFFFF"/><param name="allowFullScreen" value="true"/><embed allowfullscreen="true" height="266" src="http://www.youtube.com/v/40XXQrdgbnc?version=3&amp;f=user_uploads&amp;c=google-webdrive-0&amp;app=youtube_gdata" type="application/x-shockwave-flash" width="320"></embed></object>

video de reconocimiento de las fichas naranjas.


<object class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://i1.ytimg.com/vi/Xb1Zz7Bk0wU/0.jpg" height="266" width="320"><param name="movie" value="http://www.youtube.com/v/Xb1Zz7Bk0wU?version=3&amp;f=user_uploads&amp;c=google-webdrive-0&amp;app=youtube_gdata"/><param name="bgcolor" value="#FFFFFF"/><param name="allowFullScreen" value="true"/><embed allowfullscreen="true" height="266" src="http://www.youtube.com/v/Xb1Zz7Bk0wU?version=3&amp;f=user_uploads&amp;c=google-webdrive-0&amp;app=youtube_gdata" type="application/x-shockwave-flash" width="320"></embed></object>

jugando (y ganando) al ta-te-ti


Red Hat will provide PHP 5.4 for RHEL-6

Official announcement : Red Hat Software Collections 1.0 Beta Now Available

More information on Software Collections

Stability addicts can keep quiet, PHP 5.3.3 is still the standard version provided with RHEL-6.

We'll soon have an official and supported way to install PHP version 5.4, beside the system version, without any effect on installed components. Announcement tells the life cycle will be 3 years.

Attention  it's a beta version, published for evaluation purpose.

Installation

Activation of the distribution channel (requires a valid subscription) from the RHN web interface or from command line:

# rhn-channel --add --channel=rhel-x86_64-server-6-rhscl-1-beta

Installation of the meta-package and default components:

# yum install php54
...
======================================================================================================================================================
 Package                            Arch                    Version                          Repository                                          Size
======================================================================================================================================================
Installing:
 php54                              x86_64                  1-7.el6                          rhel-x86_64-server-6-rhscl-1-beta                  3.3 k
Installing for dependencies:
 php54-php-cli                      x86_64                  5.4.14-3.el6                     rhel-x86_64-server-6-rhscl-1-beta                  2.6 M
 php54-php-common                   x86_64                  5.4.14-3.el6                     rhel-x86_64-server-6-rhscl-1-beta                  566 k
 php54-php-pear                     noarch                  1:1.9.4-7.el6                    rhel-x86_64-server-6-rhscl-1-beta                  370 k
 php54-php-process                  x86_64                  5.4.14-3.el6                     rhel-x86_64-server-6-rhscl-1-beta                   45 k
 php54-php-xml                      x86_64                  5.4.14-3.el6                     rhel-x86_64-server-6-rhscl-1-beta                  109 k
 php54-runtime                      x86_64                  1-7.el6                          rhel-x86_64-server-6-rhscl-1-beta                  1.0 M

Transaction Summary
======================================================================================================================================================
Install       7 Package(s)

Total download size: 4.7 M
Installed size: 0 
Is this ok [y/N]: y

That's all ;)

Utilisation

Default version still 5.3.3

# php -v
PHP 5.3.3 (cli) (built: Nov 29 2012 04:12:23)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

You need to explicitly ask to use the SCL version, standard (SCL) way:

# scl enable php54 "php -v"
PHP 5.4.14 (cli) (built: May 23 2013 07:42:19)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

You can also use (for this collection, not supported for others):

# /opt/rh/php54/root/usr/bin/php -v
PHP 5.4.14 (cli) (built: May 23 2013 07:42:19)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

You can also permanently activate the collection:

# source /opt/rh/php54/enable
# php -v
PHP 5.4.14 (cli) (built: May 23 2013 07:42:19)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

Use from Apache

Various way exists, we'll only see the mod_php case

# yum install php54-php

Warning : apache can't load 2 php5 modules, so if the standard module is already present, on apache startup, you will get the error message:

[Sun Jun 16 16:51:01 2013] [warn] module php5_module is already loaded, skipping

You need to uninstall (or disable) the standard module, and then apache will use the PHP 5.4 from the collection.

Conclusion

I think this is a very important new feature which should help for the adoption of recent PHP version in enterprise environment.

CentOS (or other clones) users can also try the packages available on the community project site : Software Collections

Questions, with no answer yet:

  • For CentOS, will those packages be available in some official repository, or third-party (as the tru repo for DTS) ?
  • Will a php55 collection exists ?
  • Will packages for  RHEL-5 be available ?
  • Will EPEL be able to provide more extensions ?
  • Which PHP version will be packaged in the finale RHSCL version ?
OpenStack Cinder - Configure multiple backends

Following my first post of the series discussing how to scale OpenStack Cinder to multiple nodes, with this I want to approach the configuration and usage of the multibackend feature landed in Cinder with the Grizzly release.

This feature allows you to configure a single volume node for use with more than a single backend driver. You can find all about the few configuration bits needed also in the OpenStack block storage documentation. That makes this post somehow redundant but I wanted to keep up with the series and the topic is well worth to be kept also here.

As usual, some assumptions before we start:

  • you're familiar with the general OpenStack architecture
  • you have already some Cinder volume node configured and working as expected

Assuming we want our node, configured with some LVM based and an additional NFS based backend, this is what we would need to add into cinder.conf:

enabled_backends=lvm1,nfs1
[lvm1]
volume_driver=cinder.volume.drivers.lvm.LVMISCSIDriver
volume_backend_name=LVM_iSCSI
[nfs1]
nfs_shares_config=${PATH_TO_YOUR_SHARES_FILE}
volume_driver=cinder.volume.drivers.nfs.NfsDriver
volume_backend_name=NFS

The enabled_backends value defines some names (separated by a comma) for the config groups. These do not have to match the driver name nor the backend name.

When the configuration is complete, to use a particular backend when allocating new volumes, you'll have to pass a volume_type parameter to the creation command. Such a type has to be created beforehand and to have some backends assigned to it:

# cinder type-create lvm
# cinder type-key lvm set volume_backend_name=LVM_iSCSI
# cinder type-create nfs
# cinder type-key nfs set volume_backend_name=NFS

Finally, to create your volumes:

# cinder create --volume_type lvm --display_name inlvm 1

For people using the REST interface, to set any type-key property, including volume_backend_name, you pass that information along with the request as extra specs. You can list those indeed to make sure the configuration is working as expected:

#  cinder extra-specs-list

Note that you can have backends of the same type (driver) using different names (say two LVM based backends allocating volumes in different volume groups) or you can also have backends of the same type using the same name! The scheduler is in charge of making the proper decision on how to pickup the correct backend at creation time so a few notes on the filter scheduler (enabled by default in Grizzly):

  • firstly it filters the available backends (AvailabilityZoneFilter, CapacityFilter and CapabilitiesFilter are enabled by default and the backend name is matched against the capabilities)
  • secondly weights the previously filtered backends (CapacityWeigher is the only one enabled by default)

The CapacityWeigher attributes high score to backends with the most available space, so new volumes are allocated within the backend with the more space available matching the particular name in the request.

SFD 2013 registration is now ON!

At SFD mailing list, the announcement that the registration for SFD 2013 is open has come out. The wiki has been prepared with the current localized languages. As usual we are available for support through email on sfd-discuss or on IRC (#SFD on freenode).

web-banner-chat-attending-h

The deadline for registered teams to get the free goodies is July 21st which should give us enough time to ship everything everywhere. Simply create your team page under http://wiki.softwarefreedomday.org/2013 (/country/city/team for most) and complete the form on http://www.softwarefreedomday.org/cgi-bin/register.py . All information and links are of course available from the SFD website.

As usual artworks are available under http://wiki.softwarefreedomday.org/Artwork and CC-BY licensed. Feel free to use, enhanced and eventually localize them.

This year sponsors are Canonical, Google, and Linode. So let’s get started and happy SFD preparations!

SFD 2011 winners for inspiration: http://www.softwarefreedomday.org/en/competition/winners-2011

My First Ruby on Rails project

I will be working on my first ruby on rails project with the admin interface.

I found this great tutorial from DigitalOcean that shows how to get everything installed on ubuntu 12.04, I am also looking on how to install it on my home computer with fedora 18

 

rubyonrails


June 15, 2013

Gordische Knoten

Vor einigen Tagen bin ich auf ein kleines Programm aufmerksam geworden – Knotter. Mit diesem in QT implementierten Programm kann man im Handumdrehen keltische Knoten oder islamische Flechtwerke erstellen. Mit Inkscape geht das zwar auch, ist aber wesentlich aufwendiger. Die Erweiterung für Knotenmuster trennt nur an den Überlappungen die jeweiligen Pfade auf, um Knoten darzustellen.
Knotter läßt sich relativ leicht und intuitiv bedienen, es gibt nicht allzu viele Optionen. Vielleicht ist auch genau das, dass Geheimnis das Programm läßt sich wirklich einfach bedienen.

Ein Gitter an dem die gesetzten Knotenpunkte einrasten erleichtert die Arbeit, bei Bedarf kann man es auch abschalten. Wer nichtvon Beginn an, Knoten setzen möchte, der kann eines der mitgelieferten Plugins benutzen. Mit Hilfe dieser kann man sich ein Gitter, Polygone oder sogar Schriftrendern lassen. Bei Bedarf lassen sich eigene Plugins in JSON erstellen und Knotter damit erweitern. Dabei wird in 3 verschiedenen Arten von Scripten unterschieden. Es gibt Scripts zum Ändern der Spitzen (cusp), der Überschneidungen (edge) und natürlich zum Rendern von Formen. Wer interessiert ist Knotter zu erweitern, findet im Wiki eine ausreichende Dokumentation.

Nach dem man die Grundform des Knotenmuster erstellt hat, kann man natürlich das Aussehen noch anpassen, so eine Spitzenart einstellen, die Kurven anpassen, die Abstände und Größe der Löcher und die Winkel einstellen. Man kann natürlich auch die Farbe des Muster und der Ränder einstellen, hier sind nahezu beliebig viele Randfarben möglich.
Hat man sein Knotenmuster erstellt, kann man es als Rastergrafik oder als SVG exportieren. Zum speichern benutzt Knotter sein eigenes Format, *.knot man kann aber auch als XML-Datei abspeichern. Man kann aber auch den erstellten Knoten per Copy & Paste in Inkscape importieren. Wer Hilfebeim Einstieg braucht, findet im Wiki des Projektes einige Tutorials.

Es gibt aber auch Abstriche, da Knotter ein relativ junges Projekt ist, gibt es noch keine deutsche Übersetzung, dasstut der Sache aber keinen Abbruch. Man kann mit dieser Software auf jeden Fall Spaß haben.

Wer Knotter installieren möchte, findet den Sourcecode natürlich auf den Seiten des Projektes. Es gibt aber auch Pakete für Debian, Ubuntu, Fedora und weitere.

IMHO: Gnome Classic Mode: Die Gnome-Shell ist auf dem Desktop gescheitert

Mit der Version 3.8 hat das Gnome-Projekt den seit Gnome 3.0 existierenden Fallback-Mode durch den so genannten Classic-Mode ersetzt, der dem Gnome 2.x Desktop ähnelt.

Offiziell begründet man beim Gnome-Projekt den Classic-Mode damit, das der Fallback-Mode zu wartungsintensiv und kaum genutzt worden sei. Viel Wahrscheinlicher dürfte jedoch sein, das man bei Gnome zu der Erkenntnis gekommen ist, das die Gnome-Shell auf dem Desktop gescheitert ist und das man hofft, mit dem Classic-Mode Benutzer, die zu anderen Desktops gewechselt sind, wieder zu Gnome zurück holen zu können.

Ob dieses Ansinnen von Erfolg gekrönt ist, wird sich noch zeigen müssen. Da jedoch Red Hat bereits hat verlauten lassen, das man bei RHEL 7 standardmäßig den Classic-Mode als Desktop nutzen will, dürften wohl viele “Gnome-Flüchtlinge” zumindest kurzzeitig wieder zu Gnome zurückkehren ob sie jedoch bei Gnome bleiben hängt auch davon ab, wie es mit dem Classic-Mode in Zukunft weitergeht.

Nichts desto trotz wären die Gnome-Entwickler gut beraten, einerseits den Classic-Mode nicht so stiefmütterlich zu behandeln, wie sie es beim Fallback-Mode getan haben und andererseits sollten sie sich ernsthaft Gedanken machen, ob die an eine Tablet-Oberfläche erinnernde Gnome-Shell tatsächlich die richtige Arbeitsoberfläche für Notebooks und Desktop-PCs ist, da sie Arbeitsabläufe erzwingt, die im Berufsalltag wohl sehr oft als nicht intuitiv empfunden werden dürften.

IMHO ist der Kommentar von Fedora-Blog.de. IMHO = In My Humble Opinion (Meiner bescheidenen Meinung nach).
Red Hat Summit 2013 Recap

Red Hat Summit Opening KeynoteThe 2013 Red Hat Summit was my second one and I enjoyed it more than last year. Quite a few people asked for a recap and some takeaways from the Summit and that’s what I hope to do in this post.

Keynotes
It’s quite apparent that Red Hat is taking a more assertive — and sometimes aggressive — stance against closed source, overpriced solutions that prevent consumers from getting things done. Jim Whitehurst had a slide that showed “Open or Die” with a live plant on the left and a dead one on the right (see the photo in the post just below this paragraph). You could hear the gasp in the audience from some of the less technical crowd. Red Hat is making a big push to deliver on Openstack and to modernize their RHEL and RHEV platforms. Paul Cormier detailed some of the upcoming offerings and the overall strategy seems to be a double-down on virtualization via Openstack and further enhancement of Enterprise Linux.

Jim Whitehurst: Open or DieOf the vendor keynotes, the Intel keynote from Dirk Hohndel was superb. He seemed a bit nervous at first and we were quickly losing interest but he brought us back in with some good anecdotes. Dirk went into detail about how a company with a ton of intellectual property could also embrace open source. Surprisingly, the speech really moved me and there were no slides involved; it was just Dirk talking.

You can watch the keynotes on Red Hat’s Summit site. If you only watch one of them, watch Dirk Hohndel’s talk (direct link to MP4).

Sessions
Jon Masters: Hyperscale ARMThe most memorable was Jon Masters’ demonstration of the 64-bit ARM platform (AArch64). Although there was no bicycle or spandex involved this year (he apologized for the lack of both), it was amazing to see some firsts. It was the first time AArch64 has been demonstrated in public and the first time Gluster ran on 64-bit ARM. He had a 2U rackmount chassis and the fans were extremely loud. Jon commented that the chips are “rarer than gold” and that he wasn’t going to chance turning the fans off. The server performed quite well during the demonstration and certainly outperformed what I’d expect from an ARM system.

Dan Walsh led two informative sessions that I enjoyed. The first was a session on Linux containers. LXC confused me quite a bit before the talk but Dan and the product manager went through how containers work step by step. They gave real world use cases and made comparisons to the more prevalent virtualization methods, like KVM. As you might expect, Dan sprinkled in some useful security tips to make containers more safe to use.

Another of Dan’s talks was about how to use SELinux in a large enterprise. He started it off with a brief explanation of SELinux and made us all stand up and say the words on his first slide (“SELinux is a labeling system”). He offered some tips on how to manage SELinux on multiple machines with Puppet and Ansible. In addition, he showed how custom policies could be easily exported and then passed around as RPM’s or within configuration management systems. We also saw how to send auditd logs to remote systems for aggregation and alerting. You can certainly manage SELinux on many machines simply by treating the policies and configuration just like you treat any other service’s configuration files.

Even after the Pub Crawl on Thursday night, the Friday morning presentation about systemd was packed with attendees. The presenters went through SysV’s shortcomings and what systemd can deliver. It will replace init in RHEL 7. Adding systemd reduces the complexity of managing services and allows you to automate many of the things that are annoying to do manually (like cgroups). Its default method of handling cgroups allows CPU share to be carved up per service rather than per process. That means that if httpd has ten workers and MySQL is running two processes, each service will receive a 50% share of the total CPU (rather than httpd getting a lot extra since it has multiple processes).

The RHEL 7 talks were extremely informative and I was writing until my hand almost fell off. I probably missed a lot of the new features so it might be a good idea to wait for the slides to be published. If you’re eager to use RHEL 7 as a desktop, you’ll see GNOME’s classic mode on the desktop (and it looks great).

After-hours
As usual, the Red Hat Certified Professionals reception at McGreevy’s was a great networking opportunity. I met other Linux users from around the world and enjoyed some pretty decent beer and food. I stayed after the reception and received a detailed lesson about how hockey works. The Bruins pushed through three OT’s but eventually lost.

The rain ruined Thursday night’s plans but the Red Hat marketing folks put together a great alternative in less than 24 hours. We ended up at Royale and were treated to a ton of food and drinks. Some musicians set up late in the evening and we were all wondering what type of music they’d play. It was a group called Alter Ego from Montreal and they really rocked the place. They’re famous for “60 costume changes in 90 minutes” and they took us through oldies, disco, and contemporary music. They hit every single music genre I could think of (except country) and everyone was amazed that they entertained us for 90 minutes without a single break. If you get the chance to see this group in person, don’t miss it.

Panorama: Alter Ego at Royale

Wrap-up
The Red Hat Summits continue to be a good opportunity to learn, network, and experiment. The ratio of attendees seems to be tilting more toward the non-technical side, and this is a problem that the organizers will definitely need to improve. There were several technical sessions packed wall to wall with plenty of non-technical people playing on their phones or checking email on their laptops. It’s a tough problem to fix and many conferences have the same issue.

Next year’s summit will be in San Francisco in April. I hope to see you there!

Red Hat Summit 2013 Recap is a post from: Major Hayden's blog.

Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.

June 14, 2013

Daily log June 14th 2013
  • Switched out a broken SSD in test machine for a hybrid drive. Hopefully it’ll last longer even if it is slightly slower.
  • Hit a trinity bug where a child process would sleep for a really long time, and the watchdog had already exited. Reworked things so the watchdog never leaves while there child processes still running so that it can SIGKILL ‘stuck’ children. Stupid bug..
  • Spent some time cleaning up the linked list uses in trinity. Not happy with the resulting patch so didn’t commit it. Maybe next week.
  • Short bi-weekly kernel meeting in #fedora-meeting. Nothing exciting.

Looked over my 3.10-rc5 outstanding issues. Some more patches got merged, so things are starting to look better, as long as I don’t find any new problems next week.

Daily log June 14th 2013 is a post from: codemonkey.org.uk

State of Fedbadges #2

I am happy to report that this summer has been excellent. We are making real progress on the Fedora Badges infrastructure and I'm very satisfied with our pace. There is going to be some awesome hackery ahead.

Tahrir

  • Fedora cloud node is still live with current develop branch, though not much in the way of end-user functionality. That will be this coming week.

  • Notable improvements to the interface.

    • Better structure.
    • More Fedora look & feel.
    • Built Fedora Badges logo.
    • Implemented initial Tahrir logo and favicon. Thanks, Decause.
  • Did away with is_admin and implemented proper Pyramid __acl__ machinery. See issue #33.

  • As per issue #61, took variables base_url and title out of views' return dicts and added them as Pyramid events with super-fancy Pyramid magic:

    # This is Tahrir's events.py file.
    
    from pyramid.events import (
        subscriber,
        BeforeRender,
    )
    
    from pyramid.security import (
        authenticated_userid,
    )
    
    
    @subscriber(BeforeRender)
    def inject_globals(event):
        """Injects global variables into every template after the view
        is processed but before the template is rendered."""
    
        # request is available in every template, and we can just pull it
        # in like so...
        request = event['request']
    
        # ... and then set a couple global variables that will be available
        # in every template, so we don't have to pass them through the
        # dict returned by the view every time!
        event['title'] = request.registry.settings['tahrir.title']
        event['base_url'] = request.registry.settings['tahrir.base_url']
    
  • Began rewiring database structure. Tahrir will now soon have a database connection through tahrir_api.dbapi to tahrir_api.model, rather than being directly connected to tahrir_api.model. I will be implementing the currently-unused TahrirDatabase class provided by Tahrir-API's dbapi.py file.

  • Other changes required by changes to database model in Tahrir-API, detailed below.

Tahrir API

  • Learned Alembic and wrote some migration scripts for the database additions I planned to make. It was cool. They worked.
  • Made additions to database detailed in recent posts. Check out the before post and the after post.
  • Fixed a failing test caused by one of my changes. Also fixed a warning regarding silly unicode things. Note: hashlib's hexdigest() function does not return a unicode value.

Badges General

  • Added badge ideas found on this old wiki page to my overarching summer badges repo.
  • Threebean, Decause, and Jenn contributed a significant amount to the repo today.
  • Threebean is hard at work implementing many of the badges outlined in the repo. But I'll let him talk about that.

Previous State of Fedbadges

Daily Misc.

  • ASCiiFLOW is a cool thing.
    • I have some feelings about the very persistent "Help us improve this website" dialog.
  • Daily Dead: 71-12-07
    • Chooba chooba

Feedback

Please, send your questions and comments in a plain text email to oddshocks at riseup dot net. I may respond publicly, so please tell me if you would not like the email content and/or your name published.

Weekly Fedora kernel bug statistics – June 14th 2013
  17 18 19 rawhide  
Open: 244 424 134 72 (874)
Opened since 2013-06-07 2 25 12 7 (46)
Closed since 2013-06-07 10 9 3 1 (23)
Changed since 2013-06-07 16 39 32 13 (100)

Weekly Fedora kernel bug statistics – June 14th 2013 is a post from: codemonkey.org.uk

Leveraging systemd cgroup integration to provide SLAs on Fedora 18 & 19

Background

In the not-so-distant past, enterprise data centers would create silos for specific services to gaurentee some metric of performance, or “Service Level Agreement” (SLA). However, this approach can be costly to create and maintain.

Enter the modern era of cloud computing, and one might wonder, “Why not just put it in VM?”. For some use cases this might work just fine, because the metrics are “good-enough”. Despite this flexibility, there are many cases where this approach simply won’t meet some measure of performance. I won’t elaborate on the details, but it doesn’t take Schrödinger math to figure this out, because sometimes the cat is dead even before you peak into the box. ;-)

Thus, in this post we will explore leveraging systemd cgroup integration to provide SLAs on Fedora.


References


Prerequisites

  • Fedora 18 or 19 box(es).
  • Make certain you’ve read the references, as I may gloss over some details in this post.

Getting Started

First you will need to choose a service which has been integrated with systemd that you can plan on tuning. In this example I will use ‘condor’, but you could use any service that you desire.

 sudo yum install condor

NOTE: You could do this with raw cgroups, but it becomes difficult to gaurentee performance unless every service is in a group. So systemd does a lot of the heavy lifting for us.

Next you will need to determine the metrics of performance that you want to provide for that service. For the purposes of simplicity, lets say we want to carve off 50% of the CPU for condor. You can also play with disk-io-bandwidth and network settings too, but I think I will leave that for another post as this can be complicated enough.

In order to divide up your machine you will first need to determine the existing shares on your machine. This can be done by dumping the current cgroup settings to a file which can then be analyzed to determine the new settings.

cgsnapshot -s > cgroup_snap.conf 

If you have a fairly basic setup you will notice the following pattern

# Configuration file generated by cgsnapshot
mount {
    cpuset = /sys/fs/cgroup/cpuset;
    cpu = /sys/fs/cgroup/cpu,cpuacct;
    cpuacct = /sys/fs/cgroup/cpu,cpuacct;
    memory = /sys/fs/cgroup/memory;
    devices = /sys/fs/cgroup/devices;
    freezer = /sys/fs/cgroup/freezer;
    net_cls = /sys/fs/cgroup/net_cls;
    blkio = /sys/fs/cgroup/blkio;
    perf_event = /sys/fs/cgroup/perf_event;
}

group system {
    cpu {
            cpu.rt_period_us="1000000";
            cpu.rt_runtime_us="0";
            cpu.cfs_period_us="100000";
            cpu.cfs_quota_us="-1";
            cpu.shares="1024";
    }
    cpuacct {
            cpuacct.usage="147354515620554";
    }
}

group system/condor.service {
    cpu {
            cpu.rt_period_us="1000000";
            cpu.rt_runtime_us="0";
            cpu.cfs_period_us="100000";
            cpu.cfs_quota_us="-1";
            cpu.shares="1024";
    }
    cpuacct {
            cpuacct.usage="146844720798260";
    }
}

... * service look ~= 

Analyzing your Configuration

One thing you will notice is that systemd creates an implied hierarchy on your machine by default, where each service has an equal amount of cpu.shares. This means when all services are contending for resources, each “service” gets an equal share.

Lets elaborate on shares a bit. Say you had two service S(a) = 1, and S(b) = 3 and each service has multiple processes all contending for CPU.

%CPU = service.cpu.share /(sum (service shares @ level)) 
%CPU[S(a)] = 1/4 = 25% 
%CPU[S(b)] = 3/4 = 75% 

So now lets extend this idea and create a simple hierarchy where there are two groups, with each group having two services:

            Share   Overall%
Group 1     1       25%
    S(a)        1       12.5%
    S(b)        1       12.5%
Group 2     3       75%
    S(c)        3       56.25%
    S(d)        1       18.75%

Hopefully this should be intuitive, however it can quickly goto plaid. Therefore, it’s important to have a handle on how many services you have planed for a given machine, and your intended hierarchy. Thus the cost of reliable performance is extra complexity, which isn’t so bad provided you’ve done your math.


Altering your Configuration

So now lets provision condor such that it has 50% of the CPU. First we need to get a count of number of services that exist on the machine.

$ cgsnapshot -s | grep [.]service | wc -l
30

As you can see from the previous example, and from the documentation, the default cpu.shares given to a service is 1024. Thus if we want 50% CPU:

.50 = condor.cpu.shares/(1024*29 + condor.cpu.shares)
512*(29) + .50*condor.cpu.shares = condor.cpu.shares
14848 = (1-.50)*condor.cpu.shares 
condor.cpu.shares = 14848/.50 = 29696

Now we need to plug this magic number in:

vim /usr/lib/systemd/system/condor.service

[Service]
CPUShares=29696

Once we exit we will need to restart the daemon and verify it worked.

systemctl daemon-reload
systemctl restart condor.service
cgsnapshot -s > cgroup_snap_2.conf

Now you can compare the two configuration files.

Next you will want to submit a whole bunch of condor jobs, and try to load down the other services. To verify that your machine is behaving as expected you can run:

systemd-cgtop

In this example it can be difficult when you have 30 services to accurately test that you are guaranteed 50% so I would recommend that the reader trim their machine down and create a more controlled experiment to verify.


In Summary

Systemd’s integration with cgroups is a many splendid thing, and when used correctly can give administrators and developers another tool in which to help create SLAs in their datacenter.

Jam failed with MkDir1 error

Recently when packaging edelib I found that it uses jam as an alternative of automake. I’ve said that I haven’t used it since I first used Linux.

And when building the RPM no problem found, but when installing something went wrong like:

MkDir1 /home/rpmaker/rpmbuild/BUILDROOT/edelib-2.0-3.fc20.i386/usr 
mkdir: cannot create directory '/home/rpmaker/rpmbuild/BUILDROOT/edelib-2.0-3.fc20.i386/usr': File exists

mkdir /home/rpmaker/rpmbuild/BUILDROOT/edelib-2.0-3.fc20.i386/usr

...failed MkDir1 /home/rpmaker/rpmbuild/BUILDROOT/edelib-2.0-3.fc20.i386/usr ...
...skipped <dir>/home/rpmaker/rpmbuild/BUILDROOT/edelib-2.0-3.fc20.i386/usr/lib for lack of <dir>/home/rpmaker/rpmbuild/BUILDROOT/edelib-2.0-3.fc20.i386/usr...
...skipped <src>libedelib.so for lack of <dir>/home/rpmaker/rpmbuild/BUILDROOT/edelib-2.0-3.fc20.i386/usr/lib...
InstallSharedLibrary1 /home/rpmaker/rpmbuild/BUILDROOT/edelib-2.0-3.fc20.i386/usr/lib/libedelib_gui.so.2.0.0 
Install1 /home/rpmaker/rpmbuild/BUILDROOT/edelib-2.0-3.fc20.i386/usr/lib/libedelib_gui.la 
...skipped <src>libedelib_gui.so for lack of <dir>/home/rpmaker/rpmbuild/BUILDROOT/edelib-2.0-3.fc20.i386/usr/lib...
InstallSharedLibrary1 /home/rpmaker/rpmbuild/BUILDROOT/edelib-2.0-3.fc20.i386/usr/lib/libedelib_dbus.so.2.0.0 
Install1 /home/rpmaker/rpmbuild/BUILDROOT/edelib-2.0-3.fc20.i386/usr/lib/libedelib_dbus.la 
...skipped <src>libedelib_dbus.so for lack of <dir>/home/rpmaker/rpmbuild/BUILDROOT/edelib-2.0-3.fc20.i386/usr/lib...

Well I think there is something wrong with some jam files. After reading some docs I found the Jamrules may be problematic, and after searing via Google I found some people also met this problem.

From the error ouput it seems that these directories are existed already, then jam used mkdir to try creating the same things again. So the solution is to define MKDIR with -p option passed. As said in mkdir help:

-p, –parents no error if existing, make parent directories as needed

So you can add a line like this:

MKDIR = "mkdir -p"

Or sed every MKDIR with -p added.

Anyway, this warning should disappear now.

Many thanks to Sanel Zx, the author of edelib.

Backtracks

Months ago when I heard rumors about Microsoft preparing Windows Blue based on the large public disappointment with Metro in Windows 8 I thought about writing some words on a perceived advantage of proprietary software over Free software: since users are customers, it is forced to listen to their feedback and if a development goes wrong, they will reverse it (Microsoft is no stranger to that, the most prominent example being Vista/W7), while traditionally Free software developers do it primarily for themselves ("scratch your itch") and won't care much if bleeding users, as one can see with the GNOME project.

In the meantime Windows Blue is nearing release, has changed name to Windows 8.1, will be free of charge (something unusual for Microsoft, revealing the concerns over user unhappiness) and also a half-hearted move, we learn from the preview, since Microsoft has an agenda (app store, user locking, mobiles) and still plenty of money in reserve. Also, GNOME 3.8 was released including an optional "classic" mode, ridiculed by GNOME developers as a "Flinstone" mode.

It was a good thing I didn't write anything at the time, since I was mistaken, the important attribute on Microsoft software wasn't being proprietary, but being commercial. You can see this when learning based on user/customer feedback RHEL 7 will switch the default desktop from GNOME Shell to GNOME Classic. While still kind of a "Windows Blue" move, with a lot of words intended to control the damage, it gives years-worth air bubble to RHEL and CentOS users. As for GNOME, there is an eternity until a RHEL 8 will put the question on the table again, a lot will happen until then.

Just for fun: Apple also just announced a big interface change with IOS 7, is going to be interesting to see the evolution, especially now when their reality distortion field is weaker than ever.

PS: the troll inside me can't skip this question - if there will be a Fedora spin with GNOME Classic mode as a default, will it be called Fedora Blue?

Fedora 19/20 logfile explosions

PSA: if you’re running Fedora 19 or 20, I highly recommend you stop what you’re doing right now and do this instead. There are a couple of unfortunate bugs in F19/F20 right now which may well be screwing the hell out of your log files.

systemd-journald bug combines with new rsyslog to eat your CPU time, make /var/log/messages huge, break journalctl and generally spread woe and misery
SELinux denial happening every three seconds to GNOME users

Chapter One

1) Run top and check if ‘rsyslogd’ is sucking a bunch of your CPU time
2) If so, immediately stop rsyslog.service, do ‘yum downgrade rsyslog’, and restart it
2b) If not, breathe a sigh of relief, and make a note not to update to rsyslog 7.4.0 until this blows over. But still read the following chapters

EDIT 2.5) There’s now a systemd update which should both prevent any further buggy journal entries being written, and cope with reading existing buggy entries better: systemd-204-8.fc19. After updating to that systemd, the infinite loop in buggy journals should no longer occur. If you prune your journal as described in the rest of this post, and update to systemd 204-8, you should then be able to update back to rsyslog 7.4.0 without further problems. Once we get systemd 204-8 pushed stable, new F19 installs should no longer ever be affected by this problem in any way, so please upkarma it.

3) If you got bitten, /var/log/messages is now probably infeasibly huge (mine was 8GB). The easiest thing to do is probably just nuke it. If you have valuable logs, they can probably be extracted from journalctl.

ON WHICH TOPIC

Chapter Two

If you got hit by chapter one, you’re now in for some joyous fun. If your system logs are of no particular important to you, you can probably just go to /var/log/journal and blow *.journal* away, and you should now be more or less happy (though read Chapter Three too). The files in /var/log/journal are the Fabled Systemd-Journald Binary Logfiles themselves: you wipe one, you lose all the logs in it.

If your system logs are important to you, you get to have some fun. Run ‘journalctl –no-pager’ and wait a while. It’ll likely start looping around some very small period of time, endlessly. ctrl-c it, go to /var/log/journal , do ‘ls -ltr’ and spot the file(s) with a very close timestamp to where the loop happened. Move those files somewhere else (if you want to retain maximum data, you can move them one at a time, doing ‘journalctl –no-pager’ after each move until you hit the exact combo of files you need to move to unblock it. You may need to rinse and repeat: I had five different loops in mine.

You may now be able to update rsyslog to 7.4.0 again and be okay, but personally, I’m leaving it on the old build till things quiet down a bit.

Chapter Three

You may well still have a giant assload of SELinux alerts about bug #973849 in your logs – “SELinux is preventing /usr/libexec/accounts-daemon from ‘read’ accesses on the directory /var/log.” accounts-daemon tries this read about every three seconds, spamming the logs each time it fails. So first order of business, install selinux-policy-3.12.1-52.fc19 to fix it. Then you can clean up your logs, if you like.

I just gave up and wiped all the really large files in /var/log/journal – if you do an ‘ls -lSr’ in that directory you should see that most files are a few MB at most, but a few recent ones are tens or hundreds of MB in size. I killed all of those. You can leave ‘em, but they eat space and make journalctl really slow. Your choice.

Chapter Four

While doing all this you might notice a bunch of rather old files with the extension “journal~” in /var/log/journal . It seems that journald doesn’t rotate these (they’re journal files that were uncleanly closed on shutdown). I manually deleted all the really old ones I had.

Chapter Five

If you have gnome-shell-extension-fedmsg installed and you’re not really using it, you might want to consider removing it, because it spams the hell out of the journal: see bug #974429. Just something else I noticed on my log sanitization quest.

I am now running a sweepstakes on the first slashdot “systemd SUCKS!” post to cite this little mess as justification for the ‘binary logs are awful!’ meme…

Fedora 20 Elections: Board town hall logs

<head>

<style type="text/css"> /* For the .log.html */ pre { /*line-height: 125%;*/ white-space: pre-wrap; } body { background: #f0f0f0; }

body .tm { color: #007020 } /* time */ body .nk { color: #062873; font-weight: bold } /* nick, regular */ body .nka { color: #007020; font-weight: bold } /* action nick */ body .ac { color: #00A000 } /* action line */ body .hi { color: #4070a0 } /* hilights */ /* Things to make particular MeetBot commands stick out */ body .topic { color: #007020; font-weight: bold } body .topicline { color: #000080; font-weight: bold } body .cmd { color: #007020; font-weight: bold } body .cmdline { font-weight: bold }

</style>

</head>

<body>

19:00:31 <mdomsch> #startmeeting Fedora Project Board Elections Town Hall
19:00:31 <zodbot> Meeting started Thu Jun 13 19:00:31 2013 UTC.  The chair is mdomsch. Information about MeetBot at http://wiki.debian.org/MeetBot.
19:00:31 <zodbot> Useful Commands: #action #agreed #halp #info #idea #link #topic.
19:00:51 <mdomsch> Welcome to the Fedora Board Town Hall for this election cycle.  I?m your moderator, Matt Domsch, former board member.  Everyone (including candidates) may pose questions in #fedora-townhall-public.  I will take the questions and pose them to the candidates, assigning a number to each question to keep answers collated.  Candidates, please answer in parallel, completing your answer with ?EOF?.
19:01:13 <mdomsch> We have five candidates for three Board seats, each will serve for one year.  With us are Josh Boyer (jwb), Matthew Garrett (mjg59), Ha?kel Gu?mar (number80), and Dan Mashal (dan408).  Eric Christensen (sparks) sends his regrets as he has another obligation at this hour.  $DAYJOB schedule conflicts are to be expected for all Fedora volunteers, including Board members, please do not hold this against any candidate.
19:01:44 <mdomsch> While people are getting their questions ready, I will open asking for introductions.
19:01:52 <mdomsch> Q1.  Please start with a brief introduction of yourself, what your involvement in Fedora has been to date, and what you think makes you an excellent candidate for the Board.
19:03:32 <mjg59> I'm Matthew Garrett, and I've been working on Fedora for just over 5 years. I've mostly been involved in kernel and hardware support, working on the lower levels of the software stack, but I have some small contributions to desktop code as well.
19:03:35 <jwb> Josh Boyer, contributor since around FC4, FESCo member for a rather long time, previous Board member.  I come from an engineering background and have served on multiple Fedora committees and teams, so I have a wide array of experience with most things Fedora.  I do, however, suck at art and GUI stuff, so i haven't been on the design team ;) 
19:04:32 <number80> I've been a Fedora packager for 7 years, ambassador for 6 (founding member of the French Team, etc.). I'm a serial patcher on many FOSS projects.
19:05:26 <mjg59> More recently I've been working on things like UEFI Secure Boot support, which has involved a lot of negotiation, collaboration and political work with lawyers, developers and managers at various companies. Finding a solution that left people as happy as possible was a significant job, and I think that the work involved there maps quite nicely to the skills required to be an effective board member.
19:05:38 <dan408> My name is Dan Mashal (fas: vicodan) (irc nick: dan408). I have been a system administrator for over 10 years for various companies. I have been Fedora for as long as I remember and love it. I maintain MATE and co-Cinnamon desktops, the new MATE-Compiz spin introduced in Fedora 19, active member of the QA and Ambassador teams, active package reviewer.
19:06:46 <dan408> I also pick up orphaned packages and am working on Enlightenment (which was completely rewritten) for Fedora 20. I do many package reviews and also end user IRC support in #fedora as well.
19:06:46 <mdomsch> thank you all
19:07:04 <mdomsch> #topic Questions and Answers
19:07:37 <mdomsch> Q2: <mitr> What should the board decide with respect to the user base?  (i.e. both what is the question to be decided, and what is your answer?)
19:07:48 <mdomsch> Let me elaborate briefly...
19:08:16 <mdomsch> #link https://lists.fedoraproject.org/pipermail/advisory-board/2013-April/011968.html
19:08:16 <mdomsch> is Robyn?s outline for a discussion on User Base.
19:08:40 <jwb> that... isn't quite fair.  if we haven't read that yet, we certainly won't have time now
19:08:40 <mdomsch> and this question has been ongoing since at least 2007 if not before
19:09:15 <mdomsch> jwb: just framing the question in terms of history, not really content
19:09:37 <jwb> ok
19:09:53 <mjg59> The fundamental question is whether Fedora is intended to produce a product
19:10:14 <jwb> so.  i think focus on user base is a double edged sword.  if we're trying to make a product, then it's great to know who you're making it for.  if we're trying to make a platform, then it's less relevant
19:10:14 <number80> or a platform ? :) 
19:10:34 <jwb> i view Fedora more as a platform that other people make products (spins, etc) from
19:10:40 <mjg59> We can look at various other aspects of it. Should Fedora be a community? Should Fedora be a place where people can engage in worthwhile technical experimentation? Should it be easy to build things on top of Fedora?
19:11:16 <mjg59> But if we compare Fedora to Ubuntu, we find that Ubuntu has, if anything, managed these things better than we have
19:11:22 <jwb> i was on the Board when we came up with the current target user.  it was helpful to have a direction and someone to aim marketing at.  i'm not sure it's really done anything for the technical side of the distro
19:11:23 <number80> My point of view is that the board is mostly here to set common values/shared vision and a guarantee that contributors may do as they please
19:11:49 <mjg59> Because without a product, we lack the incentive for initial involvement
19:12:06 <mjg59> People come to the Ubuntu community because they run Ubuntu. They don't run Ubuntu because they want to join the Ubuntu community.
19:12:56 <mjg59> So I think the questions that are being asked right now are the wrong questions to be asking. A community is worthless without users to serve. We don't gain users unless we concentrate on producing a product.
19:13:13 <dan408> I'm have read that and just skimmed through it and am just going to offer a completely fresh opinion here. Lots of things have changed since then. For example the feature process has changed. I believe that the board's goal is to make sure end users and contributors are happy from all walks of life. That means the board should over see all aspects of Fedora. That is the definition of
19:13:13 <dan408> a traditional board. For example, what are the most common questions in #fedora? What are the most common packaging questions for new packagers? How can we make creating your first package and getting reviewed/sponsored easier? The board should look at all SIGs and groups and see if there is any help they can provide to those groups to help them operate better. The board should also
19:13:13 <dan408> improve communication distro wide between different said groups and SIGs.
19:13:26 <jwb> mjg59, so... the question becomes is a "desktop distribution" the correct product?
19:13:33 <jwb> for focus purposes
19:13:33 <mjg59> jwb: And the answer is clearly yes
19:14:00 <dan408> jwb mjg59 i disagree.
19:14:03 <number80> I agree with mjg59 that we need a flagship product in order to promote the platform and our community but i believe that is the role of the contributors (and ultimately the fesco) to decide what shape should take that product
19:14:18 <jwb> mjg59, i believe we've been doing that for a while now and as you've said, Ubuntu is winning by larger margins there
19:14:21 <mjg59> We don't have the community we could have, but we *do* have a community. And the majority of those community members use Fedora as a desktop operating system.
19:14:34 <mjg59> jwb: Yeah, because we've consistently produced a product that works less well.
19:15:15 <dan408> Fedora is not a "desktop distribution. It is a LINUX distribution. It offers multiple choices of desktops. It gives you the choice of having no desktop at all. You can run Fedora as a server, firewall, router, desktop, build machine, anything. That's the beauty of it.
19:15:24 <dan408> "
19:15:30 <jwb> mjg59, so the current community has failed?
19:15:49 <mjg59> jwb: No, I think the leadership has failed
19:16:00 <dan408> mjg59: what would change?
19:16:05 <dan408> what would *you* change?
19:16:17 <mjg59> jwb: See the board discussion around Secure Boot, for instance. The board was entirely ok with the idea of releasing a distribution that normal people would be unable to install on new computers.
19:16:48 <dan408> mjg59: And how was that fixed?
19:17:01 <mjg59> dan408: We did it anyway
19:17:15 <dan408> mjg59: You shouldn't "do it anyway"
19:17:20 <mjg59> dan408: What?
19:17:22 <mjg59> No
19:17:27 <dan408> I think in that case the board was uninformed
19:17:34 <mjg59> We informed the board
19:17:36 <number80> I don't think that technical issues should be decided at the board level, unless it violates Fedora Foundations or technical boards failed to resolve them
19:17:46 <jwb> "doing it anyway" is essentially the community actually working as it should
19:17:53 <jwb> so i don't think that specific case was a bad thing
19:17:59 <mjg59> Yeah. I think the right thing happened. But I think it happened for the wrong reasons.
19:18:10 <mjg59> There should have been leadership from the board driving us towards a solution
19:18:13 <mjg59> But there wasn't
19:18:17 <dan408> number80: I believe that technical issues should be decided in the board if it possible that it could frustrate end users.
19:18:50 <dan408> For example going to back to mjg59 and secure boot, that affected me negatively. I compiled a kernel manually on a UEFI  / secureboot system and I completely hosed my system.
19:18:51 <jwb> dan408, the Board is not a technical body.  they rely on the people doing the work to explain the issues
19:19:03 <number80> dan408: we're a contributors driven distro, the board may represent the users, but decisions should be taken by the contributors
19:19:32 <mjg59> The board shouldn't make technical decisions, but it should be providing a framework to target those technical decisions
19:19:41 <number80> dan408 is right that the board may express an opinion if it affects end users
19:19:42 <dan408> And the kernel maintainers view was "Sorry we're not giving you our key." So the end result was actually a failure on your part. That taught me the lesson of dont install fedora with uefi and secureboot because I wont be able to compile a custom kernel.
19:20:02 <jwb> dan408, you clearly can.  just create your own key
19:20:12 <jwb> pretty sure i even wrote a post on how to do it
19:20:14 <dan408> I'm not going through the extra trouble just for that.
19:20:31 <jwb> you're already building a kernel.  creating a key takes just a few min more.
19:20:40 <dan408> jwb: From the pristine linux source code?
19:20:43 <dan408> not the SRPM?
19:20:56 <jwb> no
19:20:59 <dan408> exactly.
19:21:02 <jwb> but the tools are all in fedora
19:21:07 <mdomsch> we're getting far afield from the original question - user base, and how would you resolve the outstanding question of "what should our users be"
19:21:18 <dan408> Our users should be EVERYONE.
19:21:31 <dan408> that is not even a question.
19:21:32 <mjg59> No
19:21:43 <mjg59> Our users should be everyone who would benefit from using Fedora rather than something else
19:22:01 <dan408> Everyone could benefit from a free operating system.
19:22:08 <dan408> So I fail to see your logic.
19:22:28 <mjg59> Debian users have a free operating system
19:22:39 <mdomsch> moving on...
19:22:44 <jwb> (and gentoo, and ...)
19:22:51 * dan408 moves on.
19:22:51 <jwb> mdomsch, please
19:22:52 <mdomsch> Q2: <j_dulaney> What do you forsee the Board actually $doing?
19:22:57 <jwb> ha!
19:23:05 <jwb> so before i was on the board, i asked that a lot
19:23:11 <number80> you mean in the future ?
19:23:56 <jwb> having been on the Board, it can be difficult to summarize exactly what happens in meeting logs and such
19:24:01 <dan408> Response to Q2: What do I see the board actually doing? More of the same. What has changed since the last election? Not much.
19:24:22 <mjg59> What do I forsee the board actually doing, or what would I like to see the board actually doing?
19:24:23 <number80> Redefine shared goals, and make it easier to contribute to Fedora (and with much less flame)
19:24:33 <dan408> mjg59: actually doing
19:25:00 <mjg59> What I forsee is a bunch of meetings with results that depend on what the board numbers are motivated by
19:25:10 <mjg59> I don't think it's a terribly meaningful question
19:25:28 * dan408 reminds everyone of http://fedoraproject.org/wiki/Board
19:25:33 <number80> I think of the board as a servant leadership, we have to remove impediments that bother our contributors and help to make it rocks
19:25:34 <mdomsch> (for the record, that was Q3)
19:25:38 <mjg59> What I would *like* to see the board do is make decisions that it knows may alienate some people
19:25:39 <jwb> the job of the Board is to ensure the fedora distro is guided by the 4 foundations.  since we don't really deviate from that, it's hard to show where they've had to step in
19:25:57 <jwb> plus they deal with trademark issues, and a few other things that aren't discussed in public
19:26:07 <jwb> to be honest, must of it is tedious work
19:26:10 <jwb> er, much
19:26:15 <mdomsch> Q4: <jsmith> Much of the Board's work involves balancing the wants of a few people against the goals and aspirations of the larger project. What is your view with regards to this balance, and how to find that balance when conflicts arise?
19:26:17 <number80> jwb: that's an impediment
19:26:25 <jwb> number80, which?
19:26:28 <dan408> mjg59: I'm sorry again I misunderstand? You want the board to make decisions that alienate people?
19:26:43 <number80> jwb: dealing with trademark and patents issues
19:26:56 <dan408> mdomsch: what happened to Q3?
19:27:02 <mjg59> dan408: I want the board to be willing to make decisions that alienate people if the alternative is not to make decisions at all
19:27:07 <jwb> number80, sure?  but it's the reality we live in
19:27:40 <dan408> mjg59: Okay I can agree with that but I believe that the board should try to not alienate people, yes tough decisions must be made for the greater good. I agree.
19:27:44 <number80> jwb: yeah, the board may relieve that from our contributor, ungrateful job but very appreciated
19:28:09 <mdomsch> dan408 I misnumbered and asked 2 twice
19:28:13 <mjg59> q4: What goals and aspirations of the larger project?
19:28:44 <jwb> q4 is throwing me a bit.  is there an example of this kind of situation coming up?
19:29:09 <number80> about jsmith Q, that requires diplomacy and a lot of listenning, and we need something like a Zen of the Fedora contributor
19:29:31 <number80> contributors may have been a bit less nicer to each other these last year
19:30:28 <number80> We want the board to act as an arbiter not as UN-like forces
19:30:54 <mjg59> mdomsch: ?
19:31:03 <mjg59> mdomsch: Maybe move on to the next question?
19:31:04 <mdomsch> I think jsmith is afk for a bit
19:31:09 <mdomsch> next question coming up
19:31:12 <dan408> Answer to Q4: This relates to the current discussion. As I said the board's primary goal to keep Fedora moving forward and prevent it from taking any steps back. To clarify, I personally believe the board shouldn't alienate ANYONE. In fact, I as a contributor I have found to be quite welcoming and I enjoy attending the public board meetings. I appreciated their unanimous approval of
19:31:12 <dan408> my spin it meant a lot that I Didn't have to go through a lot of questioning. It was just approved because all the processes were followed and everyone saw the benefit of having the MATE-Compiz spin included with Fedora.
19:31:37 <mdomsch> Q5: <misc> Quite recently, a controversy erupted regarding a poster competition linked to Fedora and Mozilla erupted. Provided you know what was this about, how would have you handled the case as part of the board ?
19:32:06 <dan408> mdomsch: Can you please provide a link to said controversy?
19:32:12 <number80> +1
19:32:25 <jwb> i've not seen said eruption
19:32:58 <dan408> Is this in reference to this? http://www.wfs-india.org/p/poster-competition-womens-and-lgbt-issues
19:34:09 <number80> probably
19:34:13 <dan408> number80 jwb according to EvilBob the question was inreference to the above link
19:35:05 <jwb> so the jist here is someone decided to give away Fedora flash drives as a prize?
19:35:22 <mjg59> Well as it currently stands, that page seems entirely appropriate
19:35:26 <mjg59> So is there some further history?
19:35:38 <number80> I see no conflict with our Foundations
19:35:41 <dan408> In my opinion, The board hopefully did not approve this. Fedora should not be getting involved in social or politicial issues whatsoever.
19:35:49 <jwb> what?
19:36:00 <jwb> how is "Free Software" neither social nor political?
19:36:02 <mjg59> Free software is inherently social and political
19:36:14 <mjg59> It's fundamentally about changing power dynamics
19:36:19 <dan408> Not necessarily.
19:36:26 <mjg59> It's an effective mechanism for social change
19:36:38 <number80> I understand that it might not please some of our community but it's about FOSS promotion
19:36:49 <dan408> I agree with that, but this is in regards to sexual preference and gender issues
19:37:08 <jwb> at any rate, i don't believe the Board has any recourse here if it is an unmodified Fedora release.
19:37:21 <number80> And it's not linked to controversial matters like racism, women rights denial
19:37:35 <mjg59> Oh what
19:37:37 <dan408> Do not get me wrong, I believe that everyone should have the freedom for sexual preference and equal rights for women
19:37:55 <mjg59> You can't divorce these things
19:38:11 <mjg59> Free software is about personal freedom
19:38:28 <mjg59> It's inherently the same thing as sexual freedom
19:38:39 <mdomsch> Q6: <notting> Various studies have shown Fedora's active contributor base to be shrinking. Do you feel that this is a problem,, and if so, how would you combat it?
19:38:40 <mjg59> You can't be in favour of one and against the other
19:38:43 <dan408> mjg59: That is out of the scope of what Fedora needs to worry about.
19:38:48 <mjg59> dan408: Oh no, it's really not
19:39:02 <number80> Q6: yes it is, it's an HUGE one
19:39:15 <mjg59> q6: Why would anyone contribute to Fedora?
19:39:17 <jwb> ignoring that, i'm not sure usage of a Fedora prize is implying Fedora sponsorship or promotion of the idea
19:39:44 <number80> I feel that Fedora community is a lot less friendlier than before, and that we have no more ass-kicking goals
19:39:45 <jwb> it can be construed that way, but the Board could ask the person to reword it or something along those lines
19:39:48 <mjg59> Ubuntu was an attractive thing for people to involve themselves with
19:40:16 <mjg59> Because it meant they were associated with something that got press and which they saw actual real people running
19:40:21 <number80> We need to work on new contributors mentoring and make them feel welcomed
19:40:46 <mjg59> And now that's less attractive because it seems like contributing to Ubuntu is just helping Canonical make money
19:40:46 <dan408> Answer to Q6: It's not just the contributor base that's shrinking. It's the user base too. Do I feel that this is a problem? Yes. It is currently pretty hard to combat. There are decisions that are currently made with out community approval. See Anaconda in Fedora 18. See Gnome 3 in Fedora 15.
19:40:47 <number80> and help the community to set new ambitious goals
19:41:11 <mjg59> But it's always seemed that way for Fedora
19:41:18 <number80> dan408: I disagree about the GNOME3 part
19:41:29 <dan408> number80: Tell that to every MATE and Cinnamon user.
19:41:31 <mjg59> The public perception is that Fedora is just a vehicle for getting work done on RHEL
19:41:42 <mdomsch> I would conjecture that the declining contributor base, and the stagnent to declining user base, are related.  Would you agree or disagree, and why?
19:41:49 <number80> dan408: there are more users of GNOME3 than both MATE and Cinnamon
19:41:52 <dan408> mjg59: Currently that's not a perception. It's a fact.
19:42:05 <mjg59> And by concentrating on the Fedora community, we do nothing to dissuade people from believing that
19:42:09 <dan408> number80: MATE is brand new, and was forked out of necessity.
19:42:47 <number80> mjg59: I think that RH CTO has helped to spread that myth, that's why we need a strong board to voice our community about these matters
19:42:47 <mjg59> "Come work on Fedora! You'll get to hang out with some cool people, but the only people who'll actually run what you produce will be paying Red Hat for it!"
19:42:50 <dan408> number80: Gnome is how old? MATE 1.6 was just released in April 2013. The entire project is barely over a year old.
19:43:15 <jwb> mjg59, so you're saying we need to grow a user base before we grow a contributor base
19:43:18 <mjg59> jwb: Yes
19:43:23 <jwb> clearly related, sure
19:43:27 <dan408> jwb: absolutely
19:43:28 <mjg59> And we don't grow a user base unless we actually concentrate on producing a product
19:43:35 <number80> dan408: i disagree about that, but it's not the right place to discuss this (i would gladly share a beer with you to discuss about that later :)  )
19:43:36 <dan408> every contributor is a user too.
19:43:42 <dan408> number80: sure
19:44:19 <dan408> last point in regards to G3, almost all of #Fedora end user IRC support do not run Gnome 3.
19:44:55 <number80> I think that the board should also spend more time communicating about the project
19:45:07 <mjg59> So, what should the board do:
19:45:14 <mjg59> 1) Define a specific Fedora product
19:45:19 <mjg59> 2) Market that
19:45:22 <dan408> in regards to Anaconda. It is currently the buggiest "package" in Fedora, and what caused Fedora 18 to miss its schedule. It is currently what 95% of the F19 final blocker bugs are opened on.
19:45:24 <mjg59> 3) Profit
19:45:41 <mjg59> dan408: The Anaconda changes went through the entire community approval process
19:45:42 <number80> mjg59: s/define/help the community to define/
19:45:45 <dan408> mjg59: Fedora is not for profit.
19:45:52 <number80> the board is no dictatorship
19:46:04 <jwb> Profit in the growth sense, not monetary i would assume
19:46:07 <mjg59> number80: The community will not be guided to a decision. We've seen that.
19:46:40 <number80> mjg59: I remember a wonderful FPL (who works at Amazon actually) who reached that ;) 
19:46:45 <mdomsch> Q7 is related: <gholms> Do you have any thoughts on Fedora outreach into new communities of interest?  What communities come to mind?  How can Fedora become involved?
19:47:11 <jwb> i'm still not sure focusing on a single product is the right solution.  companies diversify for growth reasons
19:47:32 <mjg59> jwb: Companies don't try to sell fifteen different things into the same market
19:47:41 <jwb> mjg59, true.  they go after different markets
19:47:49 <jwb> but they don't do it with a _single_ product
19:47:51 <number80> Most Fedora contributors favor the platform over the product, so we need to be supportive of the SIG
19:48:11 <dan408> Answer to Q7: We need to out reach to more universities and expand the Red Hat internship program. If "new blood" is what we're after, then let's get "new blood", literally. At the colleges.
19:48:26 <mjg59> Hey, I actually agree with dan408 for once
19:48:32 <number80> +1
19:48:34 <mjg59> College outreach is important
19:48:48 <mjg59> But, again, why would people at college contribute to Fedora rather than anything else?
19:48:49 <dan408> Continued answer to Q7: We need to reach out to Comp Sci departments and ask them why they are not running Fedora.
19:49:03 <mjg59> And let's not limit ourselves to CS
19:49:07 <jwb> i actually think college is one level too high
19:49:08 <dan408> We need to go to college campuses and pass out multi live media
19:49:17 <number80> we should build training materials and work in hand with ambassadors on that issue
19:49:27 <jwb> local high schools are a much more impressionable and relevant target
19:49:30 <dan408> We need to actually get off our computers and talk to people about Fedora!
19:49:44 <dan408> This is what being an Ambassador is all about!
19:50:03 <number80> I think that the ARM gang have impressive tools for that goal ;) 
19:50:03 <jwb> they're strapped for cash, students like doing "different" things, and it ties in with all kinds of other out-reach programs
19:50:04 <dan408> The problem with the Ambassador program is that it is focused on events, not the real life community.
19:50:14 <mjg59> So going back to Ubuntu again, one of the massively attractive aspects of its early marketing was that it was about humanity. It appealed to people's desires for social change.
19:50:52 <number80> dan408: right, but as an ambassador, most of my job has been to build my local community (town, region, nation levels)
19:51:01 <dan408> When I first joined the Ambassador program my first question was WHY are we spending time and effort preaching Fedora at Linux conferences? It's like going to CES and sell your brand of TV
19:51:06 <mjg59> Talking about Fedora as software doesn't help a great deal there
19:51:27 <dan408> number80: different regions in the Ambassador program face different isues and different approaches to tackling them.
19:51:40 <number80> dan408: right
19:52:05 <mdomsch> Q8: <pjones> How do you see the relationship between the board and FESCo? (and what distinguishes their responsibilities and authority)
19:52:17 <number80> mjg59: do you suggest that we work with other projects or companies to create new use ? (ie: Fedora Phone ?)
19:52:39 <mjg59> number80: What would Fedora Phone even be?
19:52:39 <dan408> mjg59: You don't talk about Fedora as software. You go to a comp sci major and tell him why he should run Fedora (i.e. newest versions of perl, python, knowing Fedora helps them know RHEL which is what is being widely used in the corporate world)
19:53:20 <mjg59> dan408: And then they tell you that they're doing all their software development on OS X because that's what all their Heroku howtos talk about
19:53:43 <number80> mjg59: that could be an awesome goal if we find a partner, but that would be the job of the community to decide which road to take
19:53:59 <jwb> q8: i view the relationship as very weak.  that isn't a bad thing.  FESCo is charged with making sure the distribution is technically viable, stable, and competent.  the Board theoretically provides oversight, but that is rarely needed
19:54:05 <mjg59> FESCo make technical decisions. The decisions should align with the board's guidance about the goals of the project.
19:54:08 <number80> Q8: Fesco is the ultimate authority for technical issues, period
19:54:16 <dan408> Answer to Q8: I see FESCo as one of THE MOST important groups in Fedora and the board and FESCo should be actively involved with each other. People have suggested to me to run for FESCo. I do not feel qualified because I do not feel I am on the same technical level as the current members for FESCo.
19:55:03 <number80> The board should only intervene for legal/patent/trademark issues or voice the larger community in some topics (but the decision should be taken by the fesco)
19:55:40 <mdomsch> one last question before we're out of time
19:55:42 <dan408> FESCo can dissect extremely technical issues and explain them to the board when needed if and when a board decision is needed.
19:55:52 <mdomsch> Q9: <kalev> The stable Fedora releases are currently receiving a lot of updates; some of them are bug fixes, some are feature updates.  Do you feel the current situation is appropriate?  Should we strive to do more / less feature updates for stable Fedora releases?
19:56:22 <jwb> this question comes up every election, for every group
19:56:26 <mjg59> So, for instance, if the board (with whatever project involvement) had decided that the priority for stable Fedora releases should be stability rather than feature updates, and Fesco voted to remove all karma requirements from stable updates, I think that would be a case where the board should discuss Fesco's decisions
19:56:28 <number80> we have a stable policy and a QA team for that stuff, but our QA team is man-lacking
19:56:57 <number80> mjg59: discuss but not take the decision
19:57:07 <jwb> i think we need to look at delivering updates differently.  clearly telling people "less updates" hasn't worked for the past 3 years
19:57:45 <number80> the board represents the whole community, the fesco the contributors, I believe that "he who does, should decide"
19:57:48 <mjg59> The argument is that having feature updates in stable releases gives us an advantage over Ubuntu because people can get the latest version of code
19:57:54 <dan408> Answer to Q9: It depends. For MATE Desktop it was absolutely appropriate. I pushed MATE Desktop 1.6 to Fedora 17/18. I did not notice many bugs being filed in regards to this. Users got an updated MATE Desktop without having to upgrade Fedora. It keeps the branches of the MATE Desktop packages in sync.
19:58:16 <dan408> For things like the Kernel you quite obviously are on a slippery slope there.
19:58:16 <mjg59> But what actually happens in Ubuntu is that someone sets up a PPA with newer versions and people get to make that choice themselves
19:58:42 <number80> mjg59: maybe we should give more attention to copr
19:58:43 <mjg59> So I don't think feature updates provide a compelling reason for people to run Fedora
19:59:03 <jwb> fwiw, the kernel team does try and limit update frequency as a release gets older
19:59:09 <dan408> mjg59: ACtually it does.
19:59:19 <mjg59> number80: Yup. I actually think that should be a priority. It'd provide a technical mechanism for relieving community tension.
19:59:26 <dan408> mjg59: MATE Desktop is still not officially included in Ubuntu or Debian.
19:59:35 <dan408> it is officially included in Fedora
19:59:49 <dan408> This has brought Gnome 3 abandoners of Fedora back.
20:00:06 <dan408> believe it or not, it's the truth.
20:00:17 <mjg59> (citation needed)
20:00:23 <jwb> great.  that doesn't mean it's because of UPDATES
20:00:36 <jwb> that's content
20:00:50 <number80> I think that stability vs features brings (again) another question: platform or product ?
20:01:12 <mjg59> People are only interested in a building a platform to the extent that it allows them to build their own product
20:01:15 <number80> if we had a single product, stability would obviously come first
20:01:21 <mdomsch> number80: we will let the next board decide that question then :-) 
20:01:24 <mdomsch> #topic Wrapup
20:01:40 <mdomsch> with that, thank you to all our candidates for your time today
20:01:45 <jwb> lots of overlap in the questions
20:01:48 <dan408> Thank you mdomsch for hosting.
20:02:20 <mdomsch> and to the Fedora members who posted great questions and spurred on lively debate.  I hope the answers here will help enlighten your choice for voting.
20:02:33 <number80> thank mdomsch for hosting, FranciscoD for organizing, my fellow candidates and our awesome community
20:02:45 <mjg59> Yeah, thanks to everyone who put effort into this
20:03:03 <mdomsch> #endmeeting

</body>

Fedora 19: rsyslog bremst Systeme aus

Adam Williamson hat heute auf der Entwicklerliste von Fedora darauf hingewiesen, dass das rsyslog Update auf Version rsyslog-7.4.0-1 die CPU-Last auf 100% hochschraubt, da rsyslog die Datei /var/log/messages massenhaft mit alten Meldungen befüllt:

Just a heads up for F19 / F20 users – rsyslog-7.4.0-1 is a bad update,
many users (inc. me on two systems) are seeing it
spamming /var/log/messages with old logs and sucking up 100% CPU time.
You might not notice immediately if you’re not running something that
spins its fans up. I recommend downgrading to 7.2.6-1 ASAP. Bug is
https://bugzilla.redhat.com/<wbr></wbr>show_bug.cgi?id=974335 .

Er empfiehlt allen Nutzern von Fedora 19, umgehend ein Downgrade von rsyslog auf die Version 7.2.6-1 durchzuführen und mit dem Update von rsyslog zu warten, bis das Problem behoben ist.

Update: Anscheinend ist die wahre Ursache des Problems journald und nicht rsyslog. Nichts desto trotz bleibt die Empfehlung, das Problem durch ein Downgrade von rsyslog bis zur Bereitstellung aktualisierter Pakete zu umschiffen, bestehen.

Update 2: In seinem Blog beschreibt Adam Williamson einen Weg, rsyslog auf die Version 7.4.0-1 zu aktualisieren, ohne von dem oben genannten Problem betroffen zu sein.

php-pecl-jsonc-1.3.1

Because of licensing issue (php bug #63520) with standard json extension, part of PHP, I wrote a new extension to replace it.

This new extension, temporarily named jsonc is a drop-in free alternative released under the PHP License.

This is a rename of the previously published php-pecl-json package.

The current extension license is not free as it includes an usage restriction (The Software shall be used for Good, not Evil).

So, this alternative is free, as I prefere to quote  Albert Einstein :

The world will not be destroyed by those who do evil, but by those who watch them without doing anything.

Sources are available on github : pecl-json-c

Installation with PHP 5.4:

yum --enablerepo=remi install php-pecl-jsonc

You must disable the default json.so extension (in /etc/php.d/json.ini) before you can enable the new jsonc.so (in /etc/php.d/jsonc.ini).

With PHP 5.5, installation is automatic, as the non-free json extension have been removed, This is same in some Linux distributions:

json_encode function is the same than in php 5.5.

json_decode function use the json-c library.

New feature: the JsonIncrementalParser class allow to parse data incrementally without need to load all in memory.

I plan to submit a PHP RFC to switch to this new free implementation in PHP next.

Your feedback is expected.

gd-last-2.1

RPM of latest GD library are available.

While last version 2.0.35 was released years ago (2007), the project have start again, lead by some developers from PHP project, which use this library  (for gd extension).

Most of changes present in PHP have been merged, and  PHP 5.5 bundles a version 2.1.0-alpha of this library. This allow to build PHP with the system library (guidelines) instead of the bundled copy.

The only missing function is imageantialias (rarely used and often protected by a condition as already missing in some others linux distribution). Anti-aliasing is under rewrite (planed for 2.2).

The gd-last package can be installed beside gd. Wheras, gd-last-progs and gd-last-devels replace gd-progs and gd-devel. It is a backport of the rawhide version (release too late to be included in Fedora 19).

So, this version will be used by the PHP 5.5 packages in remi-test, as in rawhide.

Installation:

yum remove gd-progs gd-devel
yum --enablerepo=remi-test install gd-last-progs

Current version (post-RC2) is in the remi-test repository, next stable release will move to remi.

It’s the price stupid!

Stop the Cap! ran a story regarding the proposed DOCSIS 3.1 standard. While many of the cable companies offer 50Mb+.

Comcast has 105Mb for $90/month,

comcast

Verizon has FiOS rated at 150Mb even 300Mb. They’re 75Mb/35Mb option is $70/month.
fios

Cox Communications even has 100Mb for $100.
coxcable

Time Warner Cable is always the hold out. They offer 50Mb / 5Mb for $75. While the other companies are offering something about $1/Mb Time Warner Cable is at $1.50 / Mb. And the upload speed of 5Mb is abysmal especially compared with Verizon’s FiOS.
twcable

And Time Warner’s CTO clearly doesn’t think we want fast internet.

LaJoie dismissed triple digit megabit speeds as a novelty that is not “very deeply penetrated” in the marketplace — marketspeak for “not attracting many customers.”

“There has not been a demonstrated appetite for it,” LaJoie said.

I suspect not many people are subscribing to the 50/5 offering so clearly their data would show little demand. But I think the problem is the price. 50/5 for $49.99 would be totally worth it. But for $75 that’s just outrageous. It would be great to have more competition here in NC, but with Time Warner Cable lobbying against competition, that will likely never happen.


June 13, 2013

Hacker's Log 2013-06-13

Fedora Tagger

  • Tagged some things in Fedora Tagger.
  • Fixed a typo in Fedora Tagger.

Tahrir-API

  • Fixed failing test caused by recent addition of created_by field to the invitations table.
  • Fixed test warning related to unicode stuff. Boy was that a pain.
    • Plenty of from __future__ import unicode_literals and unicode(). One part of the issue was that hexdigest() in the hashlib module doesn't return a unicode value.
  • Thanks to Threebean for poking me about the failing tests and Qalthos for diving in with me and fixing the unicode issue.

Tahrir

  • Continued hacking on authorization stuff. It WILL be done tomorrow.
    • Following that, I can start adding metrics, visualizations, more end-user functionality, and other cool stuff!

Miscellaneous

  • Grateful Dead show: 71-02-20
    • It really is It For The Other One

Feedback

Please, send your questions and comments in a plain text email to oddshocks at riseup dot net. I may respond publicly, so please tell me if you would not like the email content and/or your name published.

FAD 2013 - São Paulo

El pasado sábado 1 de junio se llevó a cabo un Fedora Activity Day (FAD) en la Red Hat de São Paulo, organizado por Leonardo Vaz, embajador del Proyecto Fedora e ingeniero de Red Hat. El objetivo principal de la reunión fue una serie de charlas, sobre las cuales voy a referirme muy brevemente a seguir.

El mismo Leonardo comenzó con una charla llamada "Making things happen: How to contribute to Fedora", donde nos recordó algunas de las características de Fedora: un proyecto Open Source, enfocado en el desarrollo de nuevas tecnologías, donde las contribuciones al código se hacen directamente upstream, dirigido por una comunidad de voluntarios, donde tiene su lugar la transparencia y la meritocracia. Un poco más adelante, Leo nos cuenta cómo podemos contribuir con Fedora, a saber, como Escritor de Contenidos, Diseñador, Relaciones Públicas, Desarrollador del SO, Traductor, Desarrollador Web o Administrador. Finalmente, nos habla con más detalles sobre los sub-grupos dentro del Proyecto Fedora, principalmente sobre Embajadores, Internacionalización (i18n), Empaquetadores y Pruebas (QA), donde nos explica qué tareas se realizan, cuáles son los requisitos para participar, y qué procedimientos deben llevarse a cabo para unirse a un determinado sub-grupo. Fue una charla muy provechosa y entretenida.

La siguiente charla, llamada "Contributing to Fedora and Upstream ", estuvo a cargo de Sergio Durigan Jr, empaquetador de Fedora y desarrollador de Red Hat, quien nos habló un poco sobre su experiencia con el GDB, sobre cómo es su día a día dentro de este proyecto, y su contribución upstream. Sergio nos hace saber que él es el mantenedor del GDB en Red Hat, y que dentro de Fedora él es co-mantenedor. Hubo mucha participación por parte del público haciendo preguntas a Sergio, quien nos brindó una charla muy informativa.

La última charla en forma de tutorial, llamado "Fedora Packaging ", la dio Itamar Reis Peixoto, embajador y empaquetador de Fedora. Haciendo uso del notebook de cada uno, Itamar nos muestra primero cómo crear un programa en C utilizando las herramientas Autotools de GNU, para pasar luego al empaquetamiento del mismo en el formato RPM, siguiendo los lineamientos específicos de Fedora. Una charla muy interactiva y técnica.

Finalmente, quisiera agradecer a Leo por la organización y el recibimiento que nos brindó. Confieso que no conocía la Red Hat de São Paulo y realmente me sentí muy en casa mientras estuve allá. El cansancio de haber salido a las 4 de la mañana y haber llegado en casa a las 10 de la noche valió mucho la pena, no sólo por el encuentro, sino también por las grandes amistades hechas. Para finalizar, un par de fotos.

De izquierda a derecha: Sergio, Hugo, Claudio e Itamar. (Click para ampliar.)

De izquierda a derecha: Marcos y Leonardo. (Click para ampliar.)
Spring MVC: Database MessageSource fall back to properties file

For an high dynamic application I need to allow users (admin users) to update some translation messages without having to redeploy application any time (for example, some messages about operation to accomplished change almost any week).
To allow this with the framework I’m using (Spring MVC) I decided to change the Message Resource politics, adding a database driven in priority to the “standard” properties file messages.

In your application context (i.e. root-context.xml) you have to configure the two message resource beans:

    <bean id="propertiesMessageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
        <property name="basename" value="/WEB-INF/messages/messages"/>
        <property name="defaultEncoding" value="UTF-8"/>
        <property name="cacheSeconds" value="0"/>
        <property name="fallbackToSystemLocale" value="false"/>
    </bean>

    <bean id="messageSource" class="net.mornati.DatabaseDrivenMessageSource">
        <constructor-arg ref="messageResourceService"/>
        <property name="parentMessageSource" ref="propertiesMessageSource"/>
    </bean>

The propertiesMessageSource is the one using the properties file with translated message, the messageSource (the one used by default for the Spring MVC framework) just inject the service to load messages from database and set the propertiesMessageSource has a parent (the fallback message source).

package net.mornati.configuration;

import net.mornati.model.MessageResource;
import net.mornati.service.MessageResourceService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ResourceLoaderAware;
import org.springframework.context.support.AbstractMessageSource;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.ResourceLoader;

import java.text.MessageFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;

public class DatabaseDrivenMessageSource extends AbstractMessageSource implements ResourceLoaderAware {

    private Logger log = Logger.getLogger(getClass());
    private ResourceLoader resourceLoader;

    private final Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>();

    @Autowired
    private MessageResourceService messageResourceService;

    public DatabaseDrivenMessageSource() {
        reload();
    }

    public DatabaseDrivenMessageSource(MessageResourceService messageResourceService) {
        this.messageResourceService = messageResourceService;
        reload();
    }

    @Override
    protected MessageFormat resolveCode(String code, Locale locale) {
        String msg = getText(code, locale);
        MessageFormat result = createMessageFormat(msg, locale);
        return result;
    }

    @Override
    protected String resolveCodeWithoutArguments(String code, Locale locale) {
        return getText(code, locale);
    }

    private String getText(String code, Locale locale) {
        Map<String, String> localized = properties.get(code);
        String textForCurrentLanguage = null;
        if (localized != null) {
            textForCurrentLanguage = localized.get(locale.getLanguage());
            if (textForCurrentLanguage == null) {
                textForCurrentLanguage = localized.get(Locale.FRANCE.getLanguage());
            }
        }
        if (textForCurrentLanguage==null) {
            //Check parent message
            logger.debug("Fallback to properties message");
            try {
                textForCurrentLanguage = getParentMessageSource().getMessage(code, null, locale);
            } catch (Exception e) {
                logger.error("Cannot find message with code: " + code);
            }
        }
        return textForCurrentLanguage != null ? textForCurrentLanguage : code;
    }

    public void reload() {
        properties.clear();
        properties.putAll(loadTexts());
    }

    protected Map<String, Map<String, String>> loadTexts() {
        log.debug("loadTexts");
        Map<String, Map<String, String>> m = new HashMap<String, Map<String, String>>();
        List<MessageResource> texts = messageResourceService.loadAllMessages();
        for (MessageResource text : texts) {
            Map<String, String> v = new HashMap<String, String>();
            v.put("en", text.getEnglish());
            v.put("de", text.getGerman());
            v.put("fr", text.getFrench());
            v.put("en_US", text.getAmerican());
            m.put(text.getMessageKey(), v);
        }
        return m;
    }

    @Override
    public void setResourceLoader(ResourceLoader resourceLoader) {
        this.resourceLoader = (resourceLoader != null ? resourceLoader : new DefaultResourceLoader());
    }
}

In this class you will load all messages from database during the class instantiation (with the reload method) and then you can simply access to your cached messages.

If user changes/adds messages to database with the application started, you can simply invoke the reload method, with something like this:

private void reloadDatabaseMessages() {
        //Reload Messages
        if (messageSource instanceof DatabaseDrivenMessageSource) {
            ((DatabaseDrivenMessageSource)messageSource).reload();
        } else if (messageSource instanceof DelegatingMessageSource) {
            DelegatingMessageSource myMessage = ((DelegatingMessageSource)messageSource);
            if (myMessage.getParentMessageSource()!=null && myMessage.getParentMessageSource() instanceof DatabaseDrivenMessageSource) {
                ((DatabaseDrivenMessageSource) myMessage.getParentMessageSource()).reload();
            }
        }
    }

In the end, you can configure your database model as you prefer (depends about the information you need to store). In my exampe I created a simple class with the message code (the same you have in the properties files) and messages for any supported language.

package net.mornati.model;

import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;

import javax.persistence.*;
import java.io.Serializable;

/**
 * MessageResource for DatabaseDriven Messages
 */
@Entity
@Table(name = "message_resource")
@Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED)
public class MessageResource implements Serializable {

    private Long id;
    private String messageKey;
    private String french;
    private String english;
    private String german;
    private String american;

    public MessageResource() {
    }

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id")
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name = "messageKey", nullable = false)
    public String getMessageKey() {
        return messageKey;
    }

    public void setMessageKey(String messageKey) {
        this.messageKey = messageKey;
    }

    @Column(name = "fr", nullable = true)
    public String getFrench() {
        return french;
    }

    public void setFrench(String french) {
        this.french = french;
    }

    @Column(name = "en", nullable = true)
    public String getEnglish() {
        return english;
    }

    public void setEnglish(String english) {
        this.english = english;
    }

    @Column(name = "de", nullable = true)
    public String getGerman() {
        return german;
    }

    public void setGerman(String german) {
        this.german = german;
    }

    @Column(name = "us", nullable = true)
    public String getAmerican() {
        return american;
    }

    public void setAmerican(String american) {
        this.american = american;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MessageResource that = (MessageResource) o;

        if (messageKey != null ? !messageKey.equals(that.messageKey) : that.messageKey != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return messageKey != null ? messageKey.hashCode() : 0;
    }
}

That’s all. You should have now an application that will try to load messages using the database message resource (not executing a query anytime, but reading the cached messages) and if message is not found in db it will try to look for it into property file.
In this way you ca create a page that allow you to override messages without restarting the application/web server.

Water

Hi,

This post is to spread the word – Water. To spare a moment to think about – Water. To help grow awareness about this source of life – Water. Do share!

I was thinking of writing this post since I read this column about the must watch environmental documentaries. Initially it was to be more about interesting documentaries to watch. It’s not about documentaries any more. It is about – Water.

Ever since I read that column and saw these movies – Blue Gold: World Water Wars & FLOW: For Love of Water – I’m seeing more and more similar stories and patterns. Ex: In this news they say Egypt is ready to wage war against Ethiopia for the later is planning to build a dam on the river Nile. In another story folks in Chile are protesting against a big multinational corporate which wants to build a dam on their pristine river. And today these pictures about water shortage in Delhi. What could be more ironic than to have one of the oldest river, on the banks of which lord Shri Krishna himself once played and bathed, flowing in your backyard and yet you are thirsty for Water.

Actually, being an Indian, none of this or what they show in the above documentaries comes as surprise or news to me. For these situations and fights are quite commonplace in India. Yet, what surprises me is how less do we talk and discus about these issues in comparison to all the drama and brouhaha about PRISM and surveillance states and digital privacy & rights and gay rights and gun control and if you are in India, you see drama over arrest & pardon of an actor, IPL cricket, spot/match fixing, and to top it all octogenarian senior most politician throwing tantrums like a 10 year old girl and the others cajoling him out of it. It’s crazy! All these things don’t even matter to everybody like Water does.

Even more surprising is how some of us justify wrong doings of big corporate multinationals and powerful bodies. I had heated debate wherein I was explaining about this movie Blue Gold and how people are protesting against big corporates for building dams and pumping billions of galleons of water every day from natural water sources and how it is practically drying those sources. And they come back saying private companies are perfectly justified in trying to maximise their profits and value to their shareholders, that is why they exist. I should/could not hold them responsible on moral or ethical grounds. I was absolutely stunned and surprised beyond shock for a moment.

I understand that private companies work to maximise their profits and I’m okay with that. But if you pump billions of galleons of water every day for that profit and value to your shareholders, I think it is wrong. And it should take less than common sense to see that it is wrong.

Along with all the global political and financial deficit we carry today, we also have greater crisis/deficit in being able to know right from a wrong and good from a bad.

Some of these links below:-

[1] Water shortage in Delhi – http://blog.tehelka.com/photo-blog-water-shortage-in-delhi/
[2] Egypt on war against Ethiopia – http://oilprice.com/Geopolitics/Africa/Egypts-Instability-Triggers-a-New-Proxy-War-Against-Ethiopia-and-its-Allies.html
[3] Chilean protest – http://adventureblog.nationalgeographic.com/2013/06/10/rios-libres-video-2-the-history-of-the-dam/
[4] Environmental documentaries – http://calamur.org/gargi/2013/06/07/lokmat-column-must-watch-environmental-documentaries/
[5] Blue Gold – World Water Wars – https://www.youtube.com/watch?v=Ikb4WG8UJRw
[6] Flow – For Love of Water – https://www.youtube.com/watch?v=zmWdco0glEA
[7] Satyamev Jayate – Water – https://www.youtube.com/watch?v=bqVAHBiGLic
[8] Truth About Tigers – http://www.truthabouttigers.org/home/


I for one welcome our new e4 overlords

As an Eclipse user, I have to say that having all those views in various stacks can really start taking away from the amount of space dedicated to just editing a file. Even at full screen, there’s portions of the UI that I could do without. For example, the status bar that sits at the bottom of the workbench takes up quite a bit of space for something that is rarely used. It has a progress bar built in, but I can always just refer to the progress view. The only real loss would appear to be the status line indicator for various things such as file privileges, line number/offset. Even these things don’t deserve a horizontal bar all to themselves.  Luckily this is a blog post, so naturally there’s something in the form of a solution coming up.

eclipse-with-toolbar-statusbar

Someone introduced me to the Eclipse 4 CSS Spy . There’s also a quick tutorial of it in action here . With this plugin, we can get a nice visualization of the e4 model hierarchy, along with an indication of where each model element is located in the workbench window (<ALT> + <SHIFT> + <F5> to activate ). I have to say, it’s rather shameful that I haven’t used this sooner, especially since it was probably mentioned at one of the DemoCamps I hosted in the past.

eclipse-css-spy

Just by clicking around the e4 model, we can easily see that we need to disable the MTrimbar with id ‘org-eclipse-ui-trim-status’ by setting its ‘visibility’ property to some attribute that would disable it. Looking around the Eclipse platform code base, under  eclipse.platform.ui/bundles, we find that the property we want is ‘hidden’. (See AbstractCSSPropertyClassificationHandler for the reference to ‘visibility’ and applyCSSPropertyVisibility in CSSPropertyClassificationSWTHandler for the implementation mentioning ‘hidden’)

With that discovered, we can finally write our selector. We just add the following to the theme file we’re using. Since I’m running Fedora Eclipse, this is in :

/usr/lib64/eclipse/plugins/org.eclipse.platform_4.2.2.v20130320-1959/css/e4_default_gtk.css

and we’ll add the following line :

#org-eclipse-ui-trim-status { visibility: hidden; }

If you use keyboard shortcuts for most things, you can probably get rid of the main toolbar as well.

#org-eclipse-ui-main-toolbar { visibility: hidden; }

eclipse-no-toolbar-statusbar

Being able to customize the Eclipse workbench to this extent, so easily is really awesome.


Nothing Lasts Forever

It’s very quiet round here so I’ll just post this which is my favourite film of all time. Unfortunately this isn’t a good copy, but since it’s never been released on DVD there are no good copies around.

<iframe class="youtube-player" frameborder="0" height="315" src="http://www.youtube.com/embed/Y2bXpNJSNaY?version=3&amp;rel=1&amp;fs=1&amp;showsearch=0&amp;showinfo=1&amp;iv_load_policy=1&amp;wmode=transparent" type="text/html" width="420"></iframe>

(Youtube link)