Monthly Archives: December 2015

4 posts

Testing Diaspora – Part 3

diasporaThis is the third time I am testing Diaspora. I never wrote about the other attempts, but between Christmas and New Year a had a bit of time writing this together.

Motivated by the article at Heise about diaspora, I decided it is time to give diaspora another try. I did try the first version after the crowdfunding campaign and one or two years later.

For this test is registered at “despora.de” right here: https://despora.de/u/ctron

The first thing I have to say is that it still is a problem to start right away. There are a lot of pods (diaspora servers) running, where you can easily create a new account right away. But then … I did register an account at joindiaspora.org a few years back. Just to find out now that this pod runs on a pretty old version of diaspora and does not accept any new registrations. It looks kind of dead to me. Now I have my account on a pod, I can download my account data. But I cannot migrate my account to a new pod. I have to start from scratch and lost all my social activity. Not that I did much with that account ;-)

So in the end you somehow want to be in control over your pod. And having a diaspora ID which contains your own domain name is just another reason for that. But setting up diaspora is a nightmare. Looking at the different ways, you do need a full virtual server or pay at least $15 each month for running your own cloud instance at some cloud provider when using the Bitnami variant of diaspora. Bitnami again has changed diaspora in some ways, so that diaspora themself ask you to look into the Bitnami wiki first. A few other cloud based approaches ask you to fork and edit the diaspora git repository for a start.

I wouldn’t mind paying a few bucks for hosting my own pod, but paying for a full blowing virtual server and setting up things like redis for one or two accounts on this hud is just oversized.

Joining a pre-existing pod on the other hand, seems like a bad idea, unless you really know who is running the pod. In the end you trust your social account and data to somebody you either don’t know and are not sure that they will keep the pod (and thus your social identity) running as long as you like it.

Of course the same is true for Facebook, Google+ and all the others. But diaspora wants to make a change. So setting up a pod or getting an account that you really control must get simpler!

As it looks to me, right now the diaspora software itself targets installations for a bigger number of users. So each pod should by capable of running as many accounts as possible (although diaspora itself is decentralized). And it really is good that there is a protocol between pods which can be implemented in a different way. So there are implementations of the diaspora protocol which are not based on the diaspora source code itself.

But back to the problem of running a pod that you control. Either there is a “light version” of a pod, which supports a few users instead of a thousand, then sharing a virtual server would be much easier. A docker container, an OpenShift instance, some micro instance on Google Cloud or AWS. That would be much cheaper.

At the same time this would allow one to run diaspora in a Raspberry Pi like device at home. If you are only hosting one or two accounts, your local DSL line is pretty much sufficient for running your own pod.

As sad as it is, I guess this means seeing you all for part #4 in a few years. If you have some spare time, I think contributing to diaspora is a great idea, because the idea behind diaspora is great. But right now, it simply is not my cup of tea.

Christmas presents – sell/recycle for charity

Before and on Christmas most people think about people in need, and hopefully donate something. Not necessarily money, but presents as well.

But after Christmas there are lots of unwanted presents and things you don’t need, don’t like or will ever use. In most cases these items end up in the trash, at some shelf or, at best, being returned to the store.

Now just think of a different way. If you could just put those presents up at E-Bay, in a charity special. You start an auction, put up your unwanted presents and select some registered non-profit organization that will received the money. E-bay won’t charge you for the transaction, at least for those charity auctions.

Sounds like a great idea to me.

Test driving “Mattermost” at the Eclipse Foundation

Mattermost Logo Thanks to @bruncedric and the Eclipse Webmasters we were able to quickly start a test of Mattermost at https://mattermost-test.eclipse.org.

“Mattermost” is a Slack/HipChat/… like web messaging system (aka webchat). I don’t want to go into too much detail of the system itself, but the main idea is to have a “faster-than-email” communication form for a team of people. Comparable to IRC, but more HTML5-ish. It also features a REST API, which can be used to automate inbound and outbound messages to the different channels.

Why not Slack or HipChat? Simply because the Eclipse Foundation requires its IT components to be based on open source solutions and not rely on any service which can go away at any moment, without the possibility to rescue your data in a portable format. Which is quite a good approach if you ask me. Just imaging you have years of data and loose it due to fact that your service provider simply shuts down.

So right now there is a Mattermost instance at https://mattermost-test.eclipse.org which is intended to be a setup for testing “Mattermost” and figuring out how it can be used to give Eclipse projects a benefit. Simply adding more technical gimmicks might not always be a good idea.

Also does Package Drone have a channel at mattermost.

So go ahead and give it a test run …

… if you have troubles or ideas … just look at eclipse/mattermost.

Parsing RPMs in Java

RPMThe core idea of Package Drone is to extract meta data from files and generated some sort of repository index. And although Package Drone’s main focus is on OSGi, we did want to implement a YUM repository adapter and for this we needed to extract metadata from RPM files.

Package Drone itself is written in Java. So I wanted some sort of Java approach. Of course it would be possible to run the rpm command in the background, parse the output somehow and gather the meta data information from that. Or make a JNI wrapper to librpm and extract the information with a native library call. However this is not only prone to error, but also a nightmare when it comes to porting.

So I really was looking for a plain Java solution, which also was compatible with the license of Eclipse (EPL). I came across jRPM and redline.

jRPM was last updated around 2005, still has an Apache 1.1 license and simply stuck in the past. redline is more up to date and sounded promising at first, but then the library is really more like a jar file with some “main” entry points and an ant task. There is no clear API for programmatically reading the RPM files. And the legal aspect was a little bit troublesome to me. 28 contributors according to GitHub, no CLA, an “MIT license” from a company simple named “FreeCompany” and the Google Tracking code backed right into the Maven POM file. So, I had to do it myself ;-)

A fresh start

So not to fall into the same pitfalls, I did start to write a parsing library first, instead of directly writing the Package Drone extractor module. This way there is now a clean library which can parse RPM files. It also is an OSGi bundle, which was necessary for Package Drone, but does not make use of any OSGi functionality. So it still can be used as a simple JAR file. Licensed under the EPL, as requirement for Eclipse projects anyway and the Eclipse CLA and IP process to take care of the legal aspects. And if you are an Eclipse project, you even don’t need a CQ to use it.

What’s the catch?

I did implement what I needed. And that was reading RPM metadata and building a YUM repository index. So writing RPM files or reading/writing signatures is not possible at the moment. However there are plans to sign YUM repositories and RPM files as well. So this limitation is only a matter of time. Also are there some fields which are not mapped to enums. RPM used numeric IDs internally, many are mapped, but not all. You can still access those, but by number not by enum in that case.

Also is this library currently not on maven central. But again, I am also working an a “deploy to Maven Central” feature in Package Drone, which will clear that blocker.

So where are we now?

So the code is right here on GitHub. In a few weeks we will have a binary download, but right now the Eclipse IP process has to clear the way first.

Looking at the source code of the test case you can see how this library works. Instead of working on a plain File, it can work on an InputStream, which can be important if your RPM file comes from a remote location.

The following example shows how to extract metadata and content from an RPM file.

[code language=”java”]
try(RpmInputStream in = new RpmInputStream(new FileInputStream("file.rpm"))) {
String name = (String)in.getPayloadHeader ().getTag (RpmTag.NAME);

CpioArchiveInputStream cpio = in.getCpioStream ();
CpioArchiveEntry entry;
while ((entry = cpio.getNextCPIOEntry ()) != null) {
process ( entry );
}
}
[/code]

There is also the older JavaDoc, which has to be updated to reflect the change to org.eclipse.packagedrone.

What’s next?

Of course a binary release at Eclipse, an updated JavaDoc and publishing the binaries to Maven Central. Beside extending the library to be able to sign and write RPM files.

If you like to help or need some help using it, just let me know!