Skip to main content

a silhouette of a person's head and shoulders, used as a default avatar

Cron Script for Karma plugin

In my last post, I wrote about the integration of Karma Plugin for Connect, with Bugzilla. Since then, I have progressed onto developing a cron script for the plugin which fetches user activities from various sources like Bugzilla, Twitter, Planet OpenSUSE etc and calculates score based on that . So now, Karma details are  fetched for every user on Connect regularly and stored in the database.

Previously, details were fetched on every view of the widget, which was a gross mistake on my part and my mentor Michal suggested that rather than fetching details on every view of the widget, some caching would be a better idea.

The best solution to that was coming up with a cron script. That solved out two purposes, one, karma details could now be fetched from the database, so there was no need to make a call to Bugzilla or other sources on every view of the widget, second, we always wanted score to be calculated on a regular basis rather than only when the user logged in, so we needed a cron script anyway :)

I am still thinking of other sources that I could use for fetching karma details apart fron Twitter, OBS, Planet OpenSUSE and Bugzilla. If any great idea stikes you, do let me know, I'll be most happy to incorporate it. 

a silhouette of a person's head and shoulders, used as a default avatar

LAMP appliance (phpmyadmin)

It has been 3 years since I published a phpmyadmin appliance with SUSEStudio.

A lot of things have changed since then, actually there was no gallery where to publish the appliance to.

Today I am publishing a new LAMP appliance that contains phpmyadmin for managing the mysql, as well as webalizer for apache statistics and webyast for managing the appliance.

Check it out at:

http://susestudio.com/a/61bKK8/lamp-server-32bit

It would be very great to get some feedback as I am planning to use it as a base for other php based appliances.

Here some screenshots:

phpmyadmin

webyast control panel

webalizer

webyast initial setup

a silhouette of a person's head and shoulders, used as a default avatar

FLISOL 2012, Santos - Quase nao rolou...

FLISOL 2012 Santos

Cheguei ate a pensar que nao teriamos o FLISOL Santos neste ano, pois apesar de muito trabalho e esforco do Paulo Kretcheu, Fernanda, Infog, Coragem, Guarini, Wallace, Gustavo, e demais participantes do Grupo de Compartilhamento do Conhecimento - Santos Dummont (com sede na baixada paulista), aconteceram imprevistos durante a ultima semana que antecedia o evento, motivo este nao pretendo entrar em detalhes aqui, limitando a comentar basicamente como que foi evento, na qual tive a grata oportunidade de participar e contribuir.

Sendo assim, vamos ao evento e algumas fotos.

Evento realizado dentro da Estacao Cidadania na Av Ana Costa, em Santos, um lugar maravilhoso repleto de charme e historia onde eh realizado um serie de atividades culturais para a sociedade durante a semana.

Devido a mudanca de endereco do evento ter sido de ultima hora e por motivos alheios ao controle e contra a vontade dos organizadores, o evento foi realizado com um numero reduzido de participantes, em contrapartida, todos que puderam participar tenho certeza de que se sentiram confortaveis e parte integrante do evento, dado que as palestras e debates eram feitos de maneira bem informal e descontraida, convidando a todos a participarem e contribuirem com suas respectivas opinioes.

Cheguei cedo, pois como era a primeira vez que o projeto openSUSE participava do FLISOL Santos, entao sabia que seria um longo dia para um embaixador openSUSE, dado o fato de que aproximadamente 90% dos participantes, ou nunca tinham tido a oportunidade de conhecer o projeto, ou nao sabiam como que andava o projeto nos dias atuais, entao fui cedo e consegui um espaco ate que bacaninha para preparar o territorio.

 Dentre as atividades planejadas tivemos pela manha a palestra do Paulo Kretcheu, abordando a importancia do software livre e de padroes abertos em ferramentas de escritorio, muito boa palestra por sinal, e que serviu perfeitamente de base e apoio para a segunda parte do periodo da manha, onde evoluimos para temas e assuntos referentes a edicao de imagem e video utilizando software livre bem como a maior penetracao da comunidade de software livre dentro de areas do conhecimento que nao a tecnologia. Aproveitei para comentar e apresentar o Protocolo de Brasilia, que tem como principal objetivo, permitir que a troca de documentos eletrônicos de escritório (textos, planilhas e apresentações) possa ser feita sem a necessidade de que todos os envolvidos possuam o mesmo programa de computador.

Apos o almoco, tivemos uma otima palestra com o Álvaro Justen – Turicas, sobre hardware livre e as funcionalidades e potenciais envolvendo a plataforma Arduino. Foi fantastico ver tamanha simplicidade para desenvolvermos ambientes realmente inteligentes, como por exemplo, acender ou apagar as luzes conforme e deteccao da presenca de alguem no ambiente, ou ainda a flexibilidade de acender ou apagar esta mesma luz, ou um led atraves de uma simples mensagem no Twitter.

"Ele fez um exemplo que fica esperando tweets para poder acender ou apagar um LED. Quem me acompanha pelo Twitter deve ter visto uns tweets estranhos dizendo “lâmpada on @CursoDeArduino” e “lanpada off @CursoDeArduino”. E o mais legal é que alguns segundos após meu tweet, lá estava o LED aceso ou apagado! Fiquei imaginando as possibilidades: “cafeteria on” heheheh." by InFog

Para o fechamento do FLISOL 2012 - Santos, tive a oportunidade de falar e apresentar sobre o projeto openSUSE, uma rapida demonstracao do OBS e fechando com uma demonstracao do SUSE Studio tambem, distribuindo ao final aproximadamente 30 midias de DVD do openSUSE 12.1, adesivos e stickers de computador.

 

Apresentacoes:

Introducao ao openSUSE

OBS em 10 minutos 

Fotos 

 

Referencias:

InFog, Kretcheu Video Blog, Forum da Cidadania,

a silhouette of a person's head and shoulders, used as a default avatar

Goolge Summer of Code 2012 – Ambassador/Event plugin for openSUSE Connect – Event#2

Event #2 (07/05-25/05) [Community Bonding period begins]

What did i do

This period was a bit hard than the last one. I had a twist on my right hand so some days i was not available to carry on to fast with the project. Furthermore i participated in KDE Akademy Es and presented openSUSE Project to people there. So now let’s focus on my progress. The coding st started at 21 of May so until the “Community perod” took place. So i focused on the current documentation. My first step was to read “getting Started with Development” . Getting involved Development means to understand better the Elgg’s event system. Talking about Elgg’s event system means to focus on the “events” and “plugin hooks” that Elgg provides. Furthermore Elgg has a “Views” system. Views are creating a section of presentation code from input data , in other words view  is the templating system of Elgg.

Elgg’s documentation provides useful information about how the Elgg’s Engine works.

More detailed Elgg’s Data Engine is formed by the following parts :

a) Entities , where ElggEntity is the base class for the Elgg data model.

b) Metadata, where you  can add extra data on your entity

c) Annotations, which are pieces of data attached to your  entity that allow users to leave comments, ratings, or other relevant feedback.

d) Relationships

e) Access controls , where you define the accessibility of annotations, entities and metadata.

f) Database schema

Plugin structure

Event calendar plugins structure is simple. Let’s have a look inside :

Actions – Where the actions of event calndar are stored into files (add_to_group , add_to_calendar, killrequest , manage , remove_from_group , request_personal_calendar, toggle_personal_calendar)

Images – Where images used by the plugin are stored here

Languages – All the available languages for the plugin

Models – Where is stored the Elgg event model

Pages – Where review_request.php file is placed.

Views – Where the views are divided into two categories , “rss” and “default”.

In “default” folder appear the “widgets” , “objects” , “input” , “settings” folders and others as well. This view contains many folders and files , so as to be editable .

Many of us we use rss , so as to be up to date . openSUSE Connect and Event calendar. provides “rss” view which is also can be configured.

Furthermore there are some other files , which are very important. These files are “start.php” , “show_event.php” , “show_events.php”. I have to mention that the “model.php” file (from models  folder) is being called on those 3 files above.

My first hacks and feelings

Begin hacking is very interesting. In other words start writing source code and make the first “hacks” , is the first step for the contribution. First you plan the process and then you begin to implement your thoughts and your plan. Moreover “hacking” for an open source project means that all your “hacks” will interact  with the community. So my first hacks for Google Summer of Code are more than interesting for me.

So focusing more on the hacks , my first hack was to read the start.php file of the plugin and understand how it works. For that reason i add comments on how functions and the source code works.

Furthermore i followed all the changes shown on event_calendar_submenu_css.patch file.

Making hacks means that you have also fix the bugs on the source code. After creating a new event , and try to show it you see like this [1]. So you can see that the bullet point which calendar plugin adds to the navigation box  (“View all events”) miss the css layout. In order to solve it and be like this [2] , i had to search for the appropiate css file. After searching and making some test commits , the final commit which solves the problem is this one.

What i am going to do

This week i will focus more on searching which features can be added during creating a new event. Furthermore i will try to add a map locator for each event. This will make the events more attractive to the users.

a silhouette of a person's head and shoulders, used as a default avatar

Integration with Bugzilla Complete!

After my last post, I worked on the integration of Karma plugin with Bugzilla. Karma plugin now assigns to users of Connect, Karma points based on the severity of the bugs they fix. And that's not it, you get a  "Bug Squasher" badge for attaining a  high score.

The best part, Bugzilla uses the same email id for registration that users register themselves with on Connect. Extracting a list of resolved bugs by a user linked with the email id of user on Connect was pretty simple :)

Others on the list are integration with Twitter for tweets about OpenSUSE, OBS activities, planet opensuse posts. I plan to distribute karma based on user activities on these, but I would really encourage people to come with ideas and let me know if I could use other sources too, to assign Karma points. 

a silhouette of a person's head and shoulders, used as a default avatar

LibreOffice Tutorial Videos

A user just asked on IRC how to print a serie of descriptions of photos, when he has a list in a spreadsheet. I answered that Mail Merge is what he is searching for - but he did not know what Mail Merge was. I found a very helpful video showing the mail merge in LibreOffice, so I want to share it with you :-)

[There is also a shortcut to Mail Merge when you understand the concept, try Tools -> Mail Merge Wizard..., of course.]

There are more LibreOffice videos out there, backed up by this nicely structured webpage. Might be worth watching the other videos too :-)

a silhouette of a person's head and shoulders, used as a default avatar

Java API to write LDTP (GUI Automation) tests


I'm happy to announce, we have added Java API support to write GUI tests using LDTP API.

Java LDTP client source:

http://cgit.freedesktop.org/ldtp/ldtp2/tree/ldtp/Ldtp.java

Dependency:

Apache codec base 64 library
LDTP binaries (Python on Linux, CobraWinLDTP.msi on Windows)

Tested on both Windows and Linux.

To compile set the CLASSPATH of the following jar files:

commons-codec-1.6.jar
ws-commons-utils-1.0.2.jar
xmlrpc-client-3.1.3.jar
xmlrpc-common-3.1.3.jar

Java documentation available here

a silhouette of a person's head and shoulders, used as a default avatar

Ruby: Why to use symbols as Hash keys ( and why not )

I have often read that for hash keys it is better to use symbols than strings. So I was interested why and what is performance impact. It is quite easy to create a test scenario to measure it. The blog post also contains technical explanation and shows potential security problem.
My test scenario is quite easy. Let’s create simple hash and lookup for a key in the hash. Lets have the keys of four different kind: short string, short symbol, long string and long symbol. For measuring I use internal ruby measuring library Benchmark. Here is code:

require "benchmark"

precomputed_string = "Very long string value"*1000 
precomputed_symbol = precomputed_string.to_sym
MAP = {
  "key1" => true,
  :key2 => true,
  precomputed_string => true,
  precomputed_symbol => true
}
Benchmark.bm(20) do |x|
  x.report("string") do
    10000000.times { MAP["key1"] }
  end
  x.report("symbol") do
    10000000.times { MAP[:key2] }
  end
  x.report("long string/100") do
    100000.times { MAP[precomputed_string] }
  end
  x.report("long symbol") do
    10000000.times { MAP[precomputed_symbol] }
  end
end

Please note that for long string key I’m using less iterations, because it would be too. And here is result from my machine:


string                4.360000   0.000000   4.360000 (  4.365123)
symbol                2.870000   0.000000   2.870000 (  2.868708)
long string/100       8.460000   0.000000   8.460000 (  8.471581)
long symbol           2.890000   0.000000   2.890000 (  2.884652)

As you can see, even for short string it is faster to use symbol then string. For longer symbol keys, the time does not grow, so the speed of hash lookup doesn’t depend on key length. As you can see, the situation is different for string keys.
Why it is? The reason is hidden in the hash implementation. Hash uses a hashing function for the lookup ( ted mI agree that it is little confusing to name in ruby Map as Hash). Symbols have this value “precomputed”, but for string you need to compute it again for whole string. For symbol its hash value is simple object_id which never changes, but string have different object for each instance ( string is not immutable like in java ), so to compare if two strings have same hash you need to compute it. Short demonstration about object_id difference:


"test".object_id
"test".object_id
:test.object_id
:test.object_id

So should you use symbol always? There is one disadvantage. To keep symbol value always same (in one ruby process), unused symbol is not removed during run of garbage collector. Here’s the code that demonstrates it:


#for string
def test val
  map = {}
  1000.times do |i|
    value = val*(i+1)
    map[value] = true
  end
  return nil
end

100.times do |i|
  test "test#{i}"
  GC.start
end
puts `cat /proc/#{$$}/status | grep 'VmSize:'`

#for symbol
def test val
  map = {}
  1000.times do |i|
    value = val*(i+1)
    map[value.to_sym] = true
  end
end

100.times do |i|
  test "test#{i}"
  GC.start
end
puts `cat /proc/#{$$}/status | grep 'VmSize:'`

My results:


String: VmSize:	   24856 kB
Symbol: VmSize:	  343324 kB

So it is a trade-off between memory and speed. It is very important for long running tasks to have control about what is stored in symbols. Consider this code snapshot for long running server:


#get option value
VALUE_TO_DB_MAP = { :external => 1, :internal => 2, :both => 3 }
def update params
  db_value = VALUE_TO_DB_MAP[params[:option1].to_sym]
end

And now consider what happens if attacker sends there non-friendly long string. He can easily cause DOS from one machine.
I welcome any questions or suggestions in your comments.

the avatar of Klaas Freitag

ownCloud 4 and ownCloud Client 1.0.2 released

It’s release day today: This morning, ownCloud 4 was released! With a very cool set of features it’s even more useful and again more fun to use.

Along with that I am happy to let you know that we also released the ownCloud Desktop Client in version 1.0.2.

It is a maintenance release with a couple of important bugfixes, such as the cross platform filename encoding problem I was already talking about. Apart from that big blocker a couple of smaller, but annoying problems were fixed. Also the GUI was polished, text changes here and there and a new icon set that looks more cool and more like ownCloud.

Version 1.0.2 is also the version that is released on all big desktop platforms the first time. Now we also offer a dmg for MacOSX as well as a Windows Installer and packages for the major Linux distributions. Have fun!

If you want to talk about ownCloud, file synchronization or such, we have a booth on Linuxtag in Berlin and I will be there. I am looking forward to meeting you.

the avatar of Robert Riemann

The Usual KDE Beginners Desktop

img

Every now and then I’m visting my best friend’s mom (generation > 50a) to update her old Pentium 4 system with the last opensuse software. Each time, I have to restore her Desktop to provide the basic features like managing opened windows, add the clock again, etc. Each time, I pay carefully attention to lock the screen afterwards. Sometimes I get doubts, that they are just fooling me, but my friend declined this, of course.

This time they disarranged the screen in a very extreme way1. Take it for amusement or for considering a clearer warning of unlocking the screen. I vote for:

You might end with a coruppted system!
Please copy this into the form field below:
I asked my son’s friend and got his permission.

:wink:

  1. Did you recognize these empty plasma panels on each edge of the screen which prevents all application to get maximized properly? ↩︎