Tuesday, June 09, 2009

» osc plugin for the lazy

After my first osc plugin that does some output colouring, I've written another one for the lazy people like me. Mind you, osc is the command-line client for the openSUSE Build Service, and it is easy to extend through plugins.

My typical workflow, when a build fails, is to do a osc cr to see the list of succeeded and failed builds and then, if applicable, do another osc bl to see the actual build output on a failed target, having to pass the distribution and architecture as parameters, e.g.:
osc bl openSUSE_Factory x86_64


Now, as said, I'm a lazy person, and I hate to do or type stuff a script could do for me. In the list of failed builds, I almost always go for the build log of the newest openSUSE version as it usually represents the most difficult target (more rpmlint tests, newest GCC, etc...), which is typically openSUSE_Factory. So why would I have to type all that, right ? ;)

The following osc plugin provides a simple osc f ("f" for "fail" ;P) command that looks at the list of targets, keeps the failed ones and performs some very crude heuristics to pick the most interesting one, which is openSUSE_Factory or, if that one succeeded, the newest openSUSE version.

The plugin is available as a .py file -- simply download it and install it into /var/lib/osc-plugins/, make it executable (chmod 755) and that's all.

If people use and like it, I'll make an RPM. Promised.

Labels: , ,

Thursday, May 21, 2009

» php-source-highlight

I spent an hour or two yesterday to write my first PHP extension in C++.

It is a very simple wrapper around GNU source-highlight that also ships its functionality as a shared library and (C++) API since version 3.0.

The whole point about that extension is that you can perform syntax highlighting using source-highlight's capabilities and broad support for many programming languages directly and naturally using a PHP function, instead of having to resort to executing a subprocess and fetching its output, or using the source-highlight CGI.

Using the extension, source-highlight is preloaded as a shared library and hence, the performance is optimal.

For example:
<?php
echo sourcehighlight("
public interface SomeInterface {
void doSomething(String a, String b) throws IOException;
}
", "java");
?>
The above would result in this:
public interface SomeInterface {
void doSomething(String a, String b) throws IOException;
}

It is currently a very first version, and I suppose that I will add more features in a near future (discussing a bit with Lorenzo Bettini, the author of GNU source-highlight), but the next step will be to implement a Mediawiki extension that uses php-source-highlight, which is pretty simple (I already wrote a few, once you know the API, it's trivial to do), in order to highlight Mediawiki markup, e.g.
<code lang="java">
public class Foo {
public static final void main(String[] args) {
System.out.println("Hello world");
}
}
</code>
Resulting in this on rendered Mediawiki pages:
public class Foo {
public static final void main(String[] args) {
System.out.println("Hello world");
}
}

Labels:

Monday, May 18, 2009

» openSUSE Conference 2009 Call for Papers Deadline

As you probably already heard, we'll have our first, very own, super-cool openSUSE Conference in September in Nürnberg.

Obviously, the success of that event depends on your presence, active participation and as such, you might be interested in holding a talk. If so, make sure to register on the Call for Papers page, as the deadline is May 20th (in 2 days time) !

Labels:

Friday, May 15, 2009

» vnstat on openSUSE

vnstat is a network traffic monitor that collects the amount of data you transmit over network interfaces (typically, your Internet uplink), and can display them
  • on a terminal:
    screenshot

  • or, since version 1.7, also as graphs:
    vnstat graph


The latter can even be watched from a browser, using a CGI script.

vnstat runs through a cron job at a regular interval (every 5 minutes by default) and collects network transfer statistics for selected network interfaces, to be able to give you information about daily, weekly, monthly traffic.

To install and run vnstat on openSUSE, either use the 1-click install for openSUSE 11.1, openSUSE 11.0 or SLE 11, or proceed as follows:
# add the "server:monitoring" repository if needed:

zypper ar -r http://download.opensuse.org/repositories/\
server:/monitoring/openSUSE_11.1/server:monitoring.repo


# (optionally adapt the URL above to match your distribution,
# e.g. openSUSE_11.0 or SLE_11 instead of openSUSE_11.1)

# download and refresh the repository metadata:
zypper refresh

# install the vnstat and vnstat-cgi packages:
zypper install vnstat vnstat-cgi


That being done, simply run the following command as root to create a vnstat database for at least one of your network interfaces, obviously using whatever connection you want to collect statistics for instead of "eth0":
vnstat-create-db eth0


And we're already finished :)

To see the results, give vnstat a few minutes to collect data (at least 5 minutes), and either see the results in a terminal:
vnstat
vnstat -h


Or point your favourite webbrowser at the following URL: http://localhost/vnstat

Note: if the URL above doesn't work, make sure to start apache2 first, using the following command as root:
rcapache2 start

Labels: ,

» Import Packman package signing keys

Short version:

In order to import and trust the GPG key that signs Packman packages, do as follows (as root):
rpm --import ftp://packman.links2linux.de/pub/packman/public-keys.asc

Long version:

Here is why you might get warnings from RPM when installing packages from the Packman repository, telling you that the signing key is unknown: in our infrastructure, the packages are built on a different host than where they are served for public consumption, and while the RPM files are signed on our build host, the repository metadata is signed on the HTTP/FTP/rsync server.

We currently use two different keys for doing that (one for the signing the packages, and another one for signing the repository metadata). But zypper and YaST2 (through their common package management stack in libzypp only support the automatic import of the key that is used for signing the repository metadata (well, after prompting you for doing so, obviously ;)).

Hence you also need to import the public key that we are using to sign the RPM files.

There are two options on how to do that:
1. use rpm --import:

Execute the following command in a terminal, as root:
rpm --import \
ftp://packman.links2linux.de/pub/packman/public-keys.asc

2. install the package rpmkey-packman:

That package is obviously available in the Packman repository, so if you already added the Packman repository to the package management stack, do this as root:
zypper install rpmkey-packman

And if you didn't, use 1-click-install to (optionally) add the repository and install the package, by clicking this link.

Labels: ,

Sunday, May 03, 2009

» tircd: Twitter from IRC

Twitter, yet another social network and instant messaging tool, yet another IM client with notifications. Annoying. Well there's an interesting alternative if you're already using an IRC client all the time, as I do.

tircd is a Twitter to IRC gateway, implemented as an IRC server. It runs on your workstation (or a server in your network), you connect to it from your favourite IRC client (e.g. irssi, xchat, konversation, weechat, ...) and can post your tweets as well as receive tweets from the persons you subscribed to.

Here is how to install it on openSUSE:
1. add the server:irc repository, e.g. like this for openSUSE 11.1:
zypper ar -r \
http://download.opensuse.org/repositories/\
server:/irc/openSUSE_11.1/server:irc.repo

zypper ref

2. install the package tircd or, if you want tircd to start automatically at boot time, install the package tircd-daemon (which will also install the package tircd):
zypper in tircd-daemon

3. if you went with the latter option, start the daemon and activate the tircd init script to be run at boot:
rctircd start

chkconfig --add tircd

If you prefer to run tircd manually, open a shell with your regular user (not root) and do this:
tircd

4. in your favourite IRC client, connect to the tircd server running on localhost:6667, using your Twitter username as the IRC nick name, as well as sending your Twitter password to the server (note that the port number can be changed in /etc/tircd.cfg for manual start/stop, and in /etc/tircd-init.cfg when running tircd as a daemon). With irssi:
/connect localhost 6667 password username

5. then join the IRC channel named "#twitter" on that server, still in your IRC client:
/join #twitter


For further information, such as adding/banning people, please refer to the tircd website.

Labels: , , ,

Thursday, April 23, 2009

» Anyone with a Czech keyboard and a few minutes on his hands ?

Bug #432627 (Backspace doesn't work in russian keyboard layout after autologin) has been open for 6 months now and has seen a lot of very useful feedback and comments from several Russian contributors.

I even proposed a change that fixes the problem for Russian keyboards, but we're just waiting for anyone with a Czech keyboard layout to test that change and see whether it breaks the keyboard or not.

The situation is a bit ridiculous (testing that with a Czech keyboard probably takes 10min at most) and a pain in the rear for everyone using openSUSE with a Russian layout.

So if you can help us close this thing and get the proposed patch through, please take those few minutes and make a comment on the above mentioned bug. That would be much appreciated.

Labels:

Monday, April 20, 2009

» Content moderation

Obviously, the Blogger CAPTCHAs have been cracked since some time, and I'm just sick of the comment spam.

Hence I finally enabled comment moderation and went through existing comments to sweep the spam -- Blogger definitely needs better tools for that :(

And BTW, this isn't a support channel, if you have questions or technical issues, ask on one of the many channels we have for exactly that purpose. Not on my blog.

Thursday, April 16, 2009

» How to build aircrack-ng on openSUSE

aircrack-ng is a well known network security tool that is capable of cracking most wireless encryption algorithms (WEP, WPA, ...). It is a very useful tool to assess the security of your WLAN, but unfortunately, it can also be abused by crackers to penetrate a wireless network.

As such, and I cannot stress this enough:
it is FORBIDDEN and a CRIMINAL ACT by (a very controversial and unclear) law in Germany to distribute aircrack-ng, as well as similar security cracking tools, -- notwithstanding the usefulness of such a tool for above mentioned security assessments.

That is why you won't find a precompiled binary package of aircrack-ng for openSUSE. We do host a nosrc RPM package in the Packman repository though. Such nosrc packages don't contain the upstream sources (in this case, the aircrack-ng tarball from the aircrack website), but merely the RPM recipe on how to properly build the package.

If you really know what you're doing and intend to use aircrack-ng for security assessment purposes (and NOT for CRACKING, which is both ETHICALLY CONDEMNABLE and a CRIMINAL ACT in certain if not most countries), here is how to build the binary package on your host (the two first lines have to be performed once, to set up an RPM building environment in your home, in order to build packages with your regular user):

echo "%_topdir $HOME/rpm" >> ~/.rpmmacros
mkdir -p ~/rpm/{BUILD,RPMS/{i586,x86_64},SOURCES,SPECS,SRPMS}

cd ~/rpm/SOURCES
wget http://download.aircrack-ng.org/aircrack-ng-1.0-rc3.tar.gz
cd ~/rpm/SRPMS
wget http://ftp.skynet.be/pub/packman/suse/11.1/src/\
aircrack-ng-1.0rc3-0.pm.1.nosrc.rpm
rpmbuild --rebuild aircrack-ng-1.0rc3-0.pm.1.nosrc.rpm


Once rpmbuild is done with building the package, you'll find a binary RPM in ~/RPMS/i586 (on 32bit systems) or ~/RPMS/x86_64 (on 64bit systems). Note that rpmbuild may complain about missing build dependencies -- in this case, install the missing packages on your host using YaST2 or zypper.
The most comfortable option for installing build dependencies being most probably the following:
zypper si -d ./aircrack-ng-1.0rc3-0.pm.1.nosrc.rpm


To have the latest available version, go to the corresponding Packman page and adapt the instructions above to the Packman nosrc.rpm download link as well as the version in the download URL at aircrack-ng.org

Labels:

Saturday, April 11, 2009

» openSUSE Search

After noticing that sgt-d has created a custom Google search for openSUSE, and given that Mediawiki's native search capabilities are.. well.. suboptimal, I quickly hacked up a nicer search form that uses the above mentioned custom Google search (because the page at Google is not branded).

Then I went on and added search forms for the openSUSE forums, Packman, the openSUSE mailing-list archive, the openSUSE Build Service packages, as well as the webpin repository index.

Might be useful: http://search.opensu.se
(note that the URL can also be abbreviated to s.opensu.se)

Labels: ,

Friday, April 10, 2009

» RSS build notifications from OBS

One of the annoying things with the openSUSE Build Service ("OBS") is that while it is acceptable that it can take a while for the build grid to process your package, it is tedious to poll the results with "osc r" (or my contributed, nicely coloured "osc cr") again and again.

Now, the openSUSE Build Service has a notification backend called "Hermes" (named so after the Greek mythology, Hermes being the messenger of the gods) that is triggered by OBS events such as build completion.

I personally don't like receiving bulks of emails to tell me that a build has succeeded or failed, my IMAP being already sufficiently crowded. But Hermes also publishes RSS feeds, including by user.

In order to follow those in your preferred RSS client (I use akregator, but there are many others, including Firefox' "live bookmarks" feature), go to hermes.opensuse.org, log in with your openSUSE iChain account, and there you'll have a page where you can configure the notifications for your builds.

I went for enabling "Build Success" and "Build Failure" as well as picking "Web / RSS newsfeed" from the list box on the right. When done, you get a list of your feeds here: https://hermes.opensuse.org/feeds/personal (or by clicking on "My Feeds" in the menu in the left navigation section).

Labels: , ,

Thursday, April 09, 2009

» openSUSE Community Week countdown

As you probably already know, we'll have a first Community Week, with the current date range being from 2009-05-11 to -17.

I hacked up a countdown image for it, in a similar fashion to the countdown images for openSUSE distribution releases: they adapt automatically to the language preferences of the browser visiting the page that contains the image, and a cron job updates the counter on the server.

You can link to the countdown images as follows:
  • 400x400:
    <img src="http://counter.opensuse.org/communityweek/large"/>
  • 256x256:
    <img src="http://counter.opensuse.org/communityweek/medium"/>
  • 130x130:
    <img src="http://counter.opensuse.org/communityweek/small"/>
You might also want to surroung that <img/> tag with a link to
http://en.opensuse.org/CommunityWeek

Labels:

» openSUSE TV links for FOSDEM 2009 talks

I just went through the FOSDEM 2009 talks/slides/videos page on the wiki to add links to our openSUSE TV channel at blip.tv.

So if you prefer to see the talks as streams with Flash instead of the Theora oggs we have on tube.opensuse.org, you can do so using the links on that page now.

To do so, I also added an "OpensuseTV" template to our Wiki, in a similar fashion to the "Video" template. It uses another icon (see on the left) and takes the blip.tv identifier as parameter (not the whole URL), e.g. like this:
{{OpensuseTV|1788318|}}

Labels: ,

Wednesday, March 18, 2009

» freshmeat.net 3 project metadata scraping

Freshmeat 3
freshmeat.net provides an invaluable service to the FOSS community by allowing us to keep track of new projects and new releases of existing projects in a single central location (at least for most of them). As such, it is especially useful to packagers.

Recently, the site has undergone a complete rewrite of its web interface and in that process, the XML project metadata that was available on the previous version of the site has been removed and will be replaced with a JSON API. I don't really care whether it's JSON or XML though, albeit XML is slightly easier to parse and process (e.g. with XPath), as long as it is machine readable.

Over the past few years, I've actually been using those project descriptions (as XML) to fill RPM spec files automatically, instead of having to tediously copy/paste the usual annoying bits (Summary:, %description, URL:, License:, ...).

Until a JSON API is available, and out of sheer curiosity, I've written a little PHP command-line script that scrapes the project metadata from the HTML markup on the new freshmeat.net site. It also resolves freshmeat.net redirect URLs to sources and website (by doing a HTTP HEAD) and tries to format the description as paragraphs, using the command-line tool fmt).

If you want to have a look on how to do that, or even use the script as-is, here it is:
fm3-scrape

And just for the record, here is the old script, which is broken now: ffxml

Labels: , , ,

Friday, February 20, 2009

» Open Letter to the openSUSE Community

Note: this is a joint post by Bryen Yunashko and me, being the two openSUSE Board members who are not employed by Novell

As you may know, recently Novell made the decision to reduce the workforce in their organization in the wake of our current economic outlook which is affecting everyone globally in all sectors of life. Unfortunately, this has also impacted some members of the openSUSE Community who were employed by Novell when, earlier this week, they were laid off.

We hear about layoffs every day now. Most of us have been hit by layoffs in recent times, if not personally then friends and family. The sadness we feel for our fellow community members is just as strong and our hearts go out to them in this time.

Some people have approached us publicly and privately and asked us what this means for the future of openSUSE. In fact, openSUSE is a community project driven both by Novell and the Community at large. Within this project, we make no distinction between Novell and non-Novell employees.

As such, those laid off are still important and vital members of our Project, and we look forward to the opportunity to continue working with them as fellow members for the good of our community, our distribution and for Free and Opensource software at large.

Our observations over the past week convince us that Novell is still committed to the openSUSE Project. It is also our observation that the community as a whole remains active, vibrant and motivated. Our colleagues employed by Novell have assured us that, while there is some frustration
and disappointment, they and the company are still as committed as ever to the openSUSE Project.

As we have mentioned, these are difficult times for everyone and hard decisions have been made by Novell. While we cannot speak for Novell and the reasons behind its decisions, we do take offense to those outside our community who have decided to exploit the hardship of our fellow community members in these trying economic times for their own personal gain in their misguided rants against the Project and misinterpreted portrayals to the general public.

We'd like to wish our friends good luck with their respective careers, hoping they will soon find another job, and also hoping that their contributions, their expertise and their commitment for the openSUSE project will sustain, not just for the sake of it, but also and foremost because they're our friends.

Labels: ,

Tuesday, February 10, 2009

» FOSDEM 2009 is over

Yet another successful FOSDEM is over.

First of all, I'd like to thank the many volunteers who helped us during the week-end, with all the non-fun parts of the job (transporting tables and chairs, cleaning up, picking up trash, help people out at the Infodesk and the new cloakroom, installing and removing insane amounts of network cables and gear, etc...), but obviously also everyone who's involved into the core team. Each FOSDEM event is the result of many months of hard work spent during our free time.

Then I'd also like to thank the people from various projects who manned their stands and organized their developer rooms. It all went pretty smooth, and thanks again for keeping rooms clean, for keeping people out when the rooms were full, as well as saving us quite a lot of time by transporting the stand tables back.

Last but not least, thanks to everyone who attended the event, it would be useless without your presence, and especially those who made a donation. Your funding is very important to keep the event alive and allow us to stick with sponsors who invest into FOSS for the sake of it, without requiring vendor talks or proprietary product marketing stands in return.

The Friday night beer event was the craze. Totally. Insane. I have absolutely no idea how many people attended but at midnight there was something around 10000 EUR spent on beer (including the 2000 EUR of free beer that was donated by Google), and we heard that at 3am it was still packed. Thanks to the Delirium Cafe for having us, the perfect location for our Beer Event.

No FOSDEM is perfect -- we'd never pretend it to be, and this year the possibly only major issue was with the network. We'll work on that and fix it for the next edition. If you have suggestions/ideas on how to make it even better, please take a few minutes to fill our feedback form.

Labels:

Wednesday, January 28, 2009

» FOSDEM 2009: keeping in touch

To keep in touch with what will be happening at FOSDEM 2009, we have

Labels:

» FOSDEM 2009: more free stuff

This year we'll introduce a shuttle bus from the venue to the Brussels Midi/South station as well as a cloakroom. Obviously, and as pretty much everything else at FOSDEM (except food and drinks), both will be free of charge.

Labels:

Sunday, January 25, 2009

» fosdem.org: other events at the same time + search

The last few days I spent some time hacking on our Drupal+Pentabarf mixture that powers fosdem.org.

When you go to an "event" page (which is actually a session, a talk, a workshop), you can now see a list of other events that take place at the same time, e.g. here (under the "Other events at the same time:" header).

Another useful feature is that the speaker and event pages from the schedule are also taken into account when you search for content, e.g. here is what you get when searching for "java".

Labels:

» Going to FOSDEM 2009

going to FOSDEM 2009

Labels: