Archive

Posts Tagged ‘fedora’

Getting SSH fingerprints for machines in your network
1 star2 stars3 stars4 stars5 stars
(no votes yet)
Loading ... Loading ...

November 9th, 2011 5 comments

Some time ago we were trying to get SSH fingerprints for all machines in our local network. Solution is not that straightforward, but it’s not a rocket science either:

#!/bin/bash
tmpfile=$(mktemp)
for i in $(seq 2 254); do
    ssh-keyscan -t rsa,dsa,ecdsa 192.168.1.$i >> $tmpfile
done
ssh-keygen -l -f $tmpfile
rm -f $tmpfile

First, we retrieve the keys using ssh-keyscan, store them into temporary file and compute fingerprints afterwards using ssh-keygen. Or is there a less complex and more elegant solution?

PS: Thanks David for kicking in the right direction.

Version sorting in Ruby
1 star2 stars3 stars4 stars5 stars
(no votes yet)
Loading ... Loading ...

July 19th, 2011 No comments

Today I needed to implement “human sort” for a list of distributions we support in the Open Build Service. I wanted to sort them alphabetically but at the same time the newest ones at the top. I ended up with the following code:

module Enumerable
  def version_sort
    sort_by { |key,val|
       key.gsub(/_SP/,'.').gsub(/_Factory/,'_100').split(/_/) \
          .map { |v| v =~ /\A\d+(\.\d+)?\z/ ? -(v.to_f) : v.downcase }
    }
  end
end

@distros = [
  'openSUSE_Factory_PPC',
  'CentOS_6',
  'openSUSE_11.4',
  'RHEL_4',
  'Mandriva_2010',
  'RHEL_5',
  'Debian_5.0',
  'SLE_10',
  'Ubuntu_9.04',
  'Fedora_14',
  'RHEL_6',
  'Ubuntu_11.04',
  'SLE_11',
  'Mandriva_2009.1',
  'CentOS_5',
  'openSUSE_11.3',
  'Debian_6.0',
  'openSUSE_11.1_Evergreen',
  'Ubuntu_10.04',
  'ScientificLinux_6',
  'openSUSE_Factory',
  'Ubuntu_10.10',
  'SLE_11_SP1',
  'Fedora_15',
  'Ubuntu_8.04',
  'Ubuntu_9.10',
  'Mandriva_2010.1',
]

@distros.version_sort.each{ |v|
  puts v
}

which produces this list:

CentOS_6
CentOS_5
Debian_6.0
Debian_5.0
Fedora_15
Fedora_14
Mandriva_2010.1
Mandriva_2010
Mandriva_2009.1
openSUSE_Factory
openSUSE_Factory_PPC
openSUSE_11.4
openSUSE_11.3
openSUSE_11.1_Evergreen
RHEL_6
RHEL_5
RHEL_4
ScientificLinux_6
SLE_11_SP1
SLE_11
SLE_10
Ubuntu_11.04
Ubuntu_10.10
Ubuntu_10.04
Ubuntu_9.10
Ubuntu_9.04
Ubuntu_8.04

Nifty, right? :-) The idea is simple. I use the sort_by function which pre-computes the values that are later compared. I replace some special values like “_Factory” or “_SP”, because I want “Factory” to be the newest (100 is higher than any other openSUSE version) and “11_SP1″ to behave exactly like “11.1″. Then I split the key using the “_” delimiter and turn any string in form “digit” or “digit.digit” to float number. I change the sign, because I want versions to be sorted in the reverse direction. Good thing is that Ruby operator <=> works on arrays also, so I’m done with key modifications and the sort does the rest …

PS: I used |key,val| in sort_by block because I want to use this function also to sort hashes by their key. This way it works both for arrays and hashes with any further modifications.

Bash PS1 tricks
1 star2 stars3 stars4 stars5 stars
(no votes yet)
Loading ... Loading ...

June 8th, 2011 3 comments

Many of you know already about this feature, but some of you don’t so I wanted to share it with you. I just changed mine PS1 configuration in ~/.bashrc to look like this:

export GIT_PS1_SHOWDIRTYSTATE=1
export GIT_PS1_SHOWSTASHSTATE=1
export GIT_PS1_SHOWUNTRACKEDFILES=1
export PS1='\[\033[1;37m\][\[\033[1;32m\]\u\[\033[0m\]@\h\[\033[0m\] $? \[\033[1;34m\]\w\[\033[0;35m\]$(__git_ps1 " %s")\[\033[1;37m\]]\[\033[0m\] '

Take a look at the following picture to see how it works:

or check the video on youtube.

The number between user@host and the current working directory is the exit status of the most recently executed command (or pipeline). This is great because you don’t have to type echo $? everytime you want to find it out. The __git_ps1 magic will print git branch name if you are inside of the git repository. Furthermore it will add special characters indicating the state of the repo: % – untracked files present, + – new files added, * – some tracked files changed, $ – there is something in the stash (see git stash --help). Pretty cool, right?

GNOME Python Hackfest, AppInstaller Meeting and Bretzn Hackfest
1 star2 stars3 stars4 stars5 stars
(no votes yet)
Loading ... Loading ...

January 24th, 2011 No comments

What a cool and productive week! But let me start from the beginning …

A couple of months ago we decided to start a hackerspace in Prague called brmlab. Most of the members deal with hardware, but there are also couple of software guys like me. At the end of November we were contacted by Tomeu and he asked if they can organize GNOME Python Hackfest in our hackerspace. I was more than delighted about the idea, so we agreed and started to plan things. In the end we had 9 FOSS hackers working on GNOME and Python and I think they enjoyed their time in Prague. Hackerspace is a great concept, because these folks didn’t have to spend extra money on renting some place and our members had opportunity to meet foreign FOSS developers and try exotic hardware like OLPC XO-1.

Blogposts from Tomeu, J5 and Martin about the event.


I had to leave the guys on Tuesday evening, because I spent the rest of the week in SUSE office in Nuernberg. The first three days were dedicated to Cross-distribution meeting about application installer organized by Vincent. It went more than well, we discussed and agreed on many things, which is great and in the end we were able to give a presentation + we also created a nice AppStream wikipage as a starting point for any future work.

Vincent wrote a summary for openSUSE News and a blogpost.


This meeting was immediately followed by Bretzn hackfest organized by Frank. The main focus of it was implementing some of the things we agreed on previous meeting from the KDE/Qt perspective and porting MeeGo Garage to openSUSE. During it I was mainly dealing with appdata.xml format we described in the AppStream meeting – I created an XML schema so we can validate it and also developed a proof-of-concept generator of this piece of metadata in Python. (git repo) Hope we can get it in createrepo and dpkg-scan* utilities soon.

Frank wrote a summary for openSUSE News and a blogpost.


I would like to thank GNOME Foundation and Collabora for sponsoring the GNOME Python Hackfest, Novell for sponsoring the Bretzn Hackfest and Canonical, Debian, Mageia, Novell and Red Hat for sending their people to AppInstaller Meeting! It’s really nice and encouraging to see folks from various companies working on one common goal.

And yeah,
I am going to FOSDEM 2011
so see you there!

Why is pkg-config the best thing since sliced bread
1 star2 stars3 stars4 stars5 stars
(votes: 3, avg: 3.33)
Loading ... Loading ...

October 22nd, 2010 7 comments

For those of you who haven’t met pkg-config yet a short introduction from its project page:

pkg-config is a helper tool used when compiling applications and libraries. It helps you insert the correct compiler options on the command line so an application can use gcc -o test test.c `pkg-config --libs --cflags glib-2.0` for instance, rather than hard-coding values on where to find glib (or other libraries). It is language-agnostic, so it can be used for defining the location of documentation tools, for instance.

More and more projects are using pkg-config already, but there is still a very high number of projects that don’t. This post tries to describe why using pkg-config is a good idea.

We try to build software packages for all major Linux distributions in the Build Service. Unfortunately there are lots differences in package names. Let’s take a look at KDE 4 development library for example:

  • libkde4-devel (openSUSE)
  • kdelibs-devel (Fedora)
  • kdelibs4-devel (Mandriva)
  • kdelibs5-dev (Debian/Ubuntu)

Confusing, right? When I want to build a KDE application in the Build Service for all these distributions I have to use conditionals, which clutters the spec file. What’s even worse is that I have to actually find out these names, which is not always an easy task.

RPM has a nice feature: if a file /usr/lib/pkgconfig/foo.pc or /usr/share/pkgconfig/foo.pc exists in the package, rpmbuild adds a pkgconfig(foo) provides symbol. But what does that mean effectively?

We don’t have to require a particular package name in the list of build requirements. We just specify pkgconfig symbol instead. Once we have replaced all of these … Crash, boom, bang – cross-distro packaging made easy! What’s even more great is that it would be possible to write tools that are able to auto-generate build requirements in the spec files by simple detection of pkgconfig symbols in configure, qmake, cmake, whatever build scripts.

The most packaging headaches are caused by libraries, but often we use some utilities during the build as well. Fortunately, they tend to have the same name across distributions – e.g. desktop-file-utils, so it probably does not make sense to use pkgconfig everywhere.

I talked with lots of people at the openSUSE Conference and all are in favor of pkg-config usage. I would like to encourage everyone in the FOSS community to include pkgconfig files in their releases and even help others doing so! For example, the distribution package maintainers could create these files and send them to upstream. I will try to push a new rpmlint check into openSUSE, which will print warning (if the package contains a library without pkgconfig file) and a link how to add a proper one to the package.

FrOSCamp, FUDCon Zurich and CERN
1 star2 stars3 stars4 stars5 stars
(no votes yet)
Loading ... Loading ...

September 22nd, 2010 1 comment

After a very long journey home I’m finally back in Prague from Switzerland. The whole trip was just awesome! Michal and I left Prague on Thursday around 11 PM, shortly after our Fedora friends from Brno arrived. To book a shared van for 9 people proved to be a great idea! Btw, motto for the upcoming openSUSE Conference is “Collaboration across Borders” so we definitively stick to that! :-)

FrOSCamp

We arrived to Zurich the following morning around 7 AM and went directly to conference venue at ETH Zurich. The whole place was still empty with the exception of two booths – Fedora one occupied by Bert and FreeBSD one with Salvatore (who turned out to be a very funny guy and his trolls like “1, 1, 1, 1, 1, Debian random number generator” or “Bugs, bugs, bugs, that’s you!” to Debian people sitting next to him became unforgetabble :-) ). Together with Michal we set our HP touchscreen up and shortly after that Bruno, Gnokii and Alexander appeared. Our openSUSE booth was now complete! Wait, I should write openSUSE/GNOME booth, because GNOME had no presence at FrOSCamp, but Gnokii saved the day and offered help to Stormy. She was more than happy to accept the offer and we run a mixed booth. Bruno even made a really nice GNOME poster and because Michal is using GNOME 3 since LinuxTag, he was able to answer most of the tricky questions. (I started to use GNOME 3 on one of my notebooks after the event as well. :-) ) The venue started to fill up with other projects as well and soon it was full by presenters. Sadly, this could not be said about visitors – their count was rather low, but this was just the first year of this conference, so I hope it will get better and better in time. At least people from various FOSS projects had more time to talk among each other which is a good thing. :-)

You can look at photos by Bruno to get the idea how the event looked like.

FUDCon

Parallel to FrOSCamp there was FUDCon happening. It is Fedora conference, which is almost never standalone, but attached to some other FOSS Conference. They had a separate talk track, so visitors could choose those talks as well. The most interesting for me was the 3rd day of FUDCon, which was organized as “unconference” or BarCamp and it offered a lots of opportunities to talk about openSUSE and Fedora relationship. Also meeting new people (for example, the new Fedora Project Leader – Jared Smith and crazy Romanians Nicu and Adrian) was very nice.

Nicu has a good set of photos mapping FUDCon.

Zivilschutzbunker!

A very good thing about the conference was the accommodation. We were allowed to enter the premises of atomic bunker under the university and stay there during the nights. It offered a great post-apocalyptic atmosphere. There was even an internet connection so we were able to organize a small hackathon :-)

During the last night Zurich was attacked by aliens, but fortunately our CTJB Emergency Team from the van was present in the bunker and we were able to repel the invasion and save the world from the disaster! Meet the heroes:

Cpl. Pyxel

Maj. Kraken

Cpt. Miska

Spc. Arius

Pte. Ksyz

1Lt. Rdvn

2Lt. Stick

Sgt. Soc

Col. Mifo

Photos by xyzz

CERN

The last day of the event was dedicated to CERN visit. Journey to Geneve was long and extended our way back home to more than 10 hours, but it was totally worth it! Let the pictures speak for themselves:













I would like to thank Marcus Moeller and the whole ETH staff for driving both conferences and things related to that and I am already looking forward for the next year’s edition!

OSSConf 2010
1 star2 stars3 stars4 stars5 stars
(no votes yet)
Loading ... Loading ...

July 9th, 2010 1 comment

Last week Michal and I went boosting to an event called OSSConf which took place in Žilina, Slovakia. We didn’t know what to expect, because it was only second year of this conference, but it turned out to be a really great one!

We left our Prague SUSE offices early in the morning, so we could reach Žilina shortly after noon and not miss a lot from the conference. During our journey we stopped in Brno to pick up our rivals^Wfriends Marek and Mifo from Red Hat. The trip was rather long, but it was quite funny and soon we were able to admire the great architecture of Žilinská Univerzita.

The first two talks we saw were about Graphics software in schools from Petra Talandová and about Generating font books by Pavel Stříž.

After these, the winners of Best student’s opensource projects awards were announced. First and second place projects were led by Red Hat employees, so hats off to them (pun intended). Novell should definitively try to engage more at universities. The rest of attendees didn’t walk away with empty hands neither, because they could win a nice openSUSE T-shirt or mugs and pens from Red Hat in a raffle shortly after.

Second day started with a talk from Michal about openSUSE 11.3, followed by lots of interesting talks including Mifo‘s about Deltacloud, mine about openSUSE Build Service and Michal‘s about SUSE Studio, …

Juraj‘s about Processing.org+related projects and Pavol‘s about (Lack of) Security in publicly used technologies.

Third day was full of talks about concrete usage of open-source tools in university environment and ended with a SOIT (Society for Open Source Information Technologies) meeting. We became a members of this non-profit organization and discussed various topics how to make Slovakia more aware about open-source technologies. I was also very surprised to find a book where author describes how to create your own Linux distribution and also mentions both openSUSE Build Service and SUSE Studio. Way to go, SUSE!

We concluded this great conference with a nice trip to close Lietava Castle and the best Slovak beer Šariš – more particularly its so called “cut beer” version – half dark, half light.


I’m already looking for next year edition, see you there!

Related posts:

Photos shamelessly stolen from Marek and Michal.

Prezi Offline in Linux
1 star2 stars3 stars4 stars5 stars
(votes: 1, avg: 5.00)
Loading ... Loading ...

May 7th, 2010 22 comments

For creating my GameStore talk at LinuxWochen Wien I decided to use new and hip tool called Prezi. I’m not going to write about its features, you have to try and see for yourself. :-) What I can say is that I really like the tool, but it has one big disadvantage – it’s written in Flash.

During the event we had a wireless connection available, but it was rather unreliable, so it was no option for me to present the talk online. I started to investigate the offline options. Either you can download the full blown Prezi Desktop, which is available if you subscribe the service, or you just download the Prezi “Player”. But wait, the page claims it is compatible only with Windows and Mac OS X. Let’s see. I downloaded the ZIP archive and indeed – it contains data folder with your presentation, Windows application (prezi.exe) and Mac OS X application (prezi.app).

Let’s get hacking! Mac OS X application is in fact just a directory structure. I copied the file prezi.app/Contents/Resources/movie.swf to the same location as my data directory and tried to run flashplayer movie.swf. Wow! The presentation started to load, but unfortunately it stopped after few seconds and I ended with this:

I tried straceing the process, but found nothing unusual (like failed open calls). Then I downloaded the debug version of Flash Player, run the command again and got this exception:

An ActionScript error has occurred:
Error #2044: Unhandled SecurityErrorEvent:. text=Error #2140: Security sandbox violation:
file:///.../movie.swf/[[DYNAMIC]]/1 cannot load file:///.../data/fonts/LiberationSerif-Regular.swf.
Local-with-filesystem and local-with-networking SWF files cannot load each other.

Aha! Locally stored SWF files cannot load other SWF files, neither local ones, nor remote ones. That’s the problem. Ok, let’s change the standalone player settings. But how?! I tried various command line switch with no success. After couple minutes of searching I found that standalone Flash Player settings could be changed via Flash plugin that loads Settings manager from the Internet? WTF?! :-)

I will make it easier for you: let’s google for “flash global security settings content creators”. The first result at the time of writing this article was this one. Go to this URL, wait until the Settings manager is loaded and then click on the “Edit locations …” button.

After that select “Add directory” and choose local directory where you store your presentations. From now on you enabled standalone Flash player to run your Prezis. Congratulations!

Even though I like Prezi, I would be ecstatic if they dropped Flash and used SVG instead as its presentation and interchange format, probably using the uber-cool SVG-edit as the core. :-) It would also enable iPad users to use the tool. And yes, I know about JessyInk, but that’s not exactly what I have on mind …

FOSDEM 2010 Report
1 star2 stars3 stars4 stars5 stars
(no votes yet)
Loading ... Loading ...

February 17th, 2010 No comments

Last weekend I attended FOSDEM 2010 and it was a blast! I’ve never seen such a high number of tracks on a conference. Kudos to the organization team! During these two days I was sending a short messages via identica and twitter, because as @amedee said “the crew provided a fiber optic network, so people can compress their thoughts in char[140] blurbs”. :-) I still decided to write a short report, because not everything could fit into these blurbs and not everyone uses these microblogging services. So here we go!

Saturday

The first keynote I attended was the “Evil on the Internet” by Richard Clayton. The Janson room totally crowded as can be seen on the photo below. I expect there were around 1200 people in the audience. Richard spoke about various tricks how to identify scammers and one of the interesting points was that you can use Google Street View to check scammers’ (often fake) addresses.

After the keynote I went to see KDE SC 4.4 demo by Jos Poortvliet. It turned out to be a good choice, because I finally learned why the “Rotate widget” feature is useful. :-) Imagine a multitouch-table with 8 people around, each working with his/hers own set of widgets. Pretty cool idea!

I was interested how Maemo and Fedora manage their communities, so I attended the respective talks in the Distributions track. Maemo uses karma to measure the activity of its community members. They have 6 masters who take care of their field related issues and 5 members of community council (see http://wiki.maemo.org/Maemo.org_team team page). Max Spevack of Fedora surprised me that he had no prepared slides, but he is a good speaker so the talk was still very good. He spoke about Fedora governance “mountain” which is: Individual, Regional, SIG, Project, Board, Project Leader. One good thing about SIGs is that they can miserably without bad impact on the distribution as a whole (but they tend to be wildly successful). In the end Max recommended us reading The Starfish and the Spider book.

Then I went to see the Ruby+Rails devroom. More than 70% of people had MacBooks there, but this could be expected. :-) Nicolas Jacobeus gave us 25 tips for Ruby and Rails development and Francois Stephany told us about how Ruby is still being inspired by Smalltalk even today and used pretty funny examples to demonstrate it:

I wanted to see the last 2 XMPP talks, but their devroom was desperately full, so I went back to our stand to meet the rest of the openSUSE gang and have dinner with them.

Sunday

Second day had even more visitors and most of the smaller rooms were full. I couldn’t get to Miguel’s talk about Mono Edge, so I went to see NixOS talk. They use very interesting package management and configuration storage. See bottom of this page for more info.

After that it was my turn to give a talk on RPM packaging collaboration. It went quite well although the battery in my microphone died, so the recording will be probably fubared. I got valuable feedback from Fedora and Mandriva folks, even from Jeff Johnson. Let’s see if it raises the level of discussions on rpm.org wiki, mailinglists and IRC. The slides are already available from my Projects page.

I was finally able to make it into the Mono room where Miguel shortly presented the Pinta paint editor and Alp showed us Moonlight player which used fully-managed Theora codec to play the movie. These demos were followed by series of in-browser and desktop Moonlight demonstrations by Andrea Gaita.

Then I rushed to see Evan presenting his StatusNet project (you might know it under ther former name laconi.ca), but I was able to catch only Q&A at the end. Shortly after GregKH appeared on stage and gave very funny (as usual) guide how to contribute to Linux kernel. He also talked about the coding style and gave a perfect explanation why to care about it (of course, not only in kernel, but generally): If you have a coding style, code patterns will start to emerge and you are able to see the “metadata”.

This was the last FOSDEM talk and all I had in front of me was a looooong travel home, but definitively worth it! :-)

(Twitpic photos by: @jaom7, @Cimm, @vyruss).

Going to FOSDEM 2010
1 star2 stars3 stars4 stars5 stars
(no votes yet)
Loading ... Loading ...

February 5th, 2010 No comments

Going to FOSDEM 2010

… and I’m looking forward to meeting you all! I will also give a talk about RPM Packaging Collaboration so remember to show up on Sunday if you are interested! :-)