Pages

my android as a dnla client

I struggled so much with getting my iPhone to work as a dnla client.

now, with my first Android it took me no time :-)

I already have a server at home with mediatomb that serve our domestic media needs.

on the phone it was two simple steps:

1. install a dnla client.I tried two; bubbleupnp and soft mediaplayer. they both worked out of the box, discovering the media server automatically.

2. a bit surprisingly, I needed to install a separate video rendering agent for my avi files. mx video player did the trick. i’m surprised that such functionality isn’t bundled with the OS/phone.

very easy.very nice.

bye bye Ubuntu and Firefox

it didn’t work out very well with kubuntu and me.the final straw was the hassles with installing Skype.and I need that all the time at work.

so i’m back to an old friend I haven’t seen in quite some years.debian.

if not too polished when installing, at least it ends rock solid and with a vanilla gnome environment.the only rough patch is the incomprehensible lack of a wide set of wifi drivers during install.I mean they’re one click away from their own Web site when the initial install is done.and they work beautifully.so why not supply them -at least on the CD and DVD editions.

but Firefox is out I think.i’ve always felt the Linux support was a but half hearted in that there were no rpm or Deb editions, just a tar.gz. the iceweasel doesn’t cut it, since google mail complains the version is too old.and the Firefox tarball doesn’t install without fuzz.

oh well.chrome is a bit google clammy, so I’m back to opera.

kubuntu 11.10.. well, it's ok but I'm not impressed

My previous post outlined my very ugly encounter with Unity. I decided to give Kubuntu a try. There were strange behaviors from the install KDE from my original Unity 11.10 install. So after a couple of days I decided to make a clean install of Kubuntu from a downloaded .iso. I kept my /home partition, so it was just to delete and install a new kubuntu on the / partition.

Sound works now. It didn’t with the first KDE over lightdm over unity install I had.

But I see the KDE people haven’t lost their love for kwallet and the wifi interface seemed unresponsive and frequently ended up with “configuring interface” that seemed to go on for ever. So I turned off the kwallet. It still didn’t remember my wifi password and it still doesn’t login to the wifi at login.

I tried installing wicd instead, but I get a “bad password” from my WPA2 network. After some googling I see that this is a classic.

Why can’t it just be simple. This aren’t exactly new features are they?

I’m stuck with my kde network. And it doesn’t remember my password. Not impressive.

And then to the ATI drivers (“restricted”/”additional” drivers). In ubuntu 10.10 they simply worked. With ubuntu 11.10 the post-something will not install, but the other additional ATI drivers at least kicked in.

With Kubuntu 11.10 neither of them are willing to install.

Again, I’m not impressed.

yikes: Ubuntu 11.x – a step backwards

I’ve lived with Ubuntu for the last 3 years or so.

I tried the 11.04 alpha edition with unity and back then I was thinking that well, it’s a bold move, but surely gnome (and kde) wouldn’t be worse off with a bit of simplification and polish.

I didn’t dare migrating before now, onto the 11.10.

But even now, that was a mistake.

I’ve migrated only one host, but a host I use frequently. I came to unity with an open mind and a certain eagerness. I was eager for something even more focused and polished than Gnome. After three days I just had to throw it out. I simply couldn’t do my work. The killer was something so trivial as the alt-tab window switching. Maybe I didn’t understand it, or maybe I could’ve configured it better, but it was a constant hassle to find my applications across two virtual desktops. I frequently found that inside a single desktop, I couldn’t alt-tab back to an application (LibreOffice Writer f.ex.) I had visible a second ago. And then there was the discovery that all my Gnome panel apps were gone and couldn’t be used. Not a show-stopper, but a real hassle.

It felt like a straitjacket.

Not a good move, this one, Mr. Shuttleworth.

So, I googled how to get back to gnome3. But that was not a nice journey.  Something was fundamentally wrong and my two gnome panels disappeared after invoking a an application. From manually starting the gnome-panels, I saw C exceptions in the trace. I never got to the bottom of it but I spent half a day on it.

Then I installed KDE and run KDE over lightdm. That’s ok’ish, but my proprietary ATI drivers are not happy and I get a garbled screen from time to time.

I probably need to reinstall at some point. But I’m not so sure it’ll be Ubuntu and me together the next time.

The Higgs Boson!

“Scientists are expected on Tuesday to present perliminary evidence that the most coveted prize in particle physics – the Higgs boson – has been glimpsed.”

(http://www.bbc.co.uk/news/science-environment-16116230)

I was excited when they started building the LHC. It costed some 10 billion dollars and nobody knew whether it was money thrown out of the window.

It might be premature but I opened a bottle of wine yesterday to celebrate. :-D

A model of Wikipedia's islam

I like to learn. Islam is in the media and a part of our society. So I’d like to learn more about that. In particular I’m interested in learning about whethter there are various interpretations of the Holy Quran, how jurisprudence works in Islam and about Sharia.

I’m also a software engineer. And much of my work is creating and analysing models.

So, after reading some of the articles on Islam on wikipedia

  • http://en.wikipedia.org/wiki/Islam
  • http://en.wikipedia.org/wiki/Fiqh
  • http://en.wikipedia.org/wiki/Sharia
  • http://en.wikipedia.org/wiki/Hadith
  • http://en.wikipedia.org/wiki/Tafsir
  • http://en.wikipedia.org/wiki/Ta%27wil
  • http://en.wikipedia.org/wiki/Progressive_islam

I decided to try to make sense of it by making a UML model that (roughly, probably very roughly) reflects the text, with emphasis given above.

It should be noted that I’m a layman, I’m not a Muslim and I was not brought up in a Muslim environment, so bear over with me. Neither am I of any other religion, although I was brought up in a protestant country.

I’m just curious and trying to learn. :-)

Geography, legal status and movements

Firstly, I tried to make sense of geography, movements, organizations and the legal status of islam in various parts of the world. That lead me to this model;

Jurisprudence and interpretations

Then, I got into how islamic law works and the various interpretations one may make on the holy text;

Islamic Law

Finally, I was interested in learning a bit about Sharia, as one reads so much about it in the news;

Debt crisis and derivatives

i’m reading in the nytimes (http://topics.nytimes.com/top/reference/timestopics/subjects/d/derivatives/index.html) that the derivatives market is valued at 680 tn dollars (680 x 10^12 I presume). I also learn that the European stability Fund is at 590 bn dollars (590 x 10^9), cf. e.g. http://www.nytimes.com/2011/10/08/world/europe/slovakia-is-key-to-survival-of-euro-currency-zone.html?_r=1&ref=global-home.

So the European problem size is roughly 1 per mill of the derivatives market?

How can it be that financial markets are so fragile that this minuscule tremor threatens to unhinge the entire financial system?

I scratch my head. Strange times.

Playing around with Camel and ActiveMQ

Of the many things to like about Apache, is that it is so accessible and instructive. In two hours you have hand-on experience on a new topic or something you have wondered about.

For example, I’m in my sparetime fiddling around with Apache Camel since I’m interested in Enterprise Integration Patterns. Last night I wondered whether it would be hard to plug in my own MQ broker and producer into one of the Camel examples. The simplest is possibly the camel-example-jms-file (I’m with camel 2.8.0).

ActiveMQ

So, I pulled down ActiveMQ 5.5. Unpack and start with(in bin)

$ activemq console

Broker is running.

It is so fascinatingly simple and so many commercial vendors could learn from this. Sigh.

Then I need to produce some messages. So I tweak the example/build.xml to only produce 10 messages (max=10 in the file, I seem to remember). Then

$ ant producer

Ten messages are produced. You can look at the queue (TEST.FOO) by http://localhost:8161/admin and inspect every message enqueued. There were ten there.

Camel

Now for the consumer. In the examples/camel-example-jms-file/src/main/java/org/apache/camel/example/jmstofile/CamelJmsToFileExample.java I tweak a little bit;

 public static void main(String args[]) throws Exception {
        // START SNIPPET: e1
        CamelContext context = new DefaultCamelContext();
        // END SNIPPET: e1
        // Set up the ActiveMQ JMS Components
        // START SNIPPET: e2
        ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
        // Note we can explicity name the component
        context.addComponent("test-jms", JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
        // END SNIPPET: e2
        // Add some configuration by hand ...
        // START SNIPPET: e3
        context.addRoutes(new RouteBuilder() {

            public void configure() {
                from("test-jms:queue:TEST.FOO").to("file:///tmp/test");

            }
        });
        // Now everything is set up - lets start the context
        context.start();
        Thread.sleep(1000);
        context.stop();
    }

Then run the class (I do this via Eclipse)

And in /tmp/test I have ten messages.

public static void main(String args[]) throws Exception {
// START SNIPPET: e1
CamelContext context = new DefaultCamelContext();
// END SNIPPET: e1
// Set up the ActiveMQ JMS Components
// START SNIPPET: e2
ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(“tcp://localhost:61616″);
// Note we can explicity name the component
context.addComponent(“test-jms”, JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
// END SNIPPET: e2
// Add some configuration by hand …
// START SNIPPET: e3
context.addRoutes(new RouteBuilder() {

public void configure() {
from(“test-jms:queue:TEST.FOO”).to(“file:///tmp/test”);
// set up a listener on the file component
/*from(“file:///tmp/test”).process(new Processor() {

public void process(Exchange e) {
System.out.println(“Received exchange: ” + e.getIn());
}
});*/
}
});
// END SNIPPET: e3
// Camel template – a handy class for kicking off exchanges
// START SNIPPET: e4
// ProducerTemplate template = context.createProducerTemplate();
// END SNIPPET: e4
// Now everything is set up – lets start the context
context.start();
// Now send some test text to a component – for this case a JMS Queue
// The text get converted to JMS messages – and sent to the Queue
// test.queue
// The file component is listening for messages from the Queue
// test.queue, consumes
// them and stores them to disk. The content of each file will be the
// test we sent here.
// The listener on the file component gets notified when new files are
// found … that’s it!
// START SNIPPET: e5
/*for (int i = 0; i < 10; i++) {
template.sendBody(“test-jms:queue:test.queue”, “Test Message: ” + i);
}*/
// END SNIPPET: e5
Thread.sleep(1000);
context.stop();
}

Eclipse for my maven projects

It’s really simple;

$ mvn eclipse:eclipse
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'eclipse'.
[INFO] org.apache.maven.plugins: checking for updates from central
[INFO] org.codehaus.mojo: checking for updates from central
<..>
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 51 seconds
[INFO] Finished at: Wed Aug 10 09:20:52 CEST 2011
[INFO] Final Memory: 36M/341M
[INFO] ------------------------------------------------------------------------
$ mvn -Declipse.workspace=<workspace> eclipse:add-maven-repo
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'eclipse'.
<..>
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Wed Aug 10 09:30:38 CEST 2011
[INFO] Final Memory: 19M/215M
[INFO] ------------------------------------------------------------------------

That’s it.

Sandbox (chroot) and only sftp for restricted users

I discover to my delight that creating a chroot environment for restricted users over ssh on my ubuntu server is really really easy. It must be many years since I last tried this, because I remember it was much more painful. :-D

I ended up creating a separate area under /home for chroot environments;

# ls -ld chroot/
drwxr-xr-x 4 root root 4096 2011-07-08 22:03 chroot/

I also create a group for the restricted users;

# addgroup sandbox

Under chroot I add the restricted users;

# adduser --home /home/chroot/resuser1 resuser1
# adduser resuser1 sandbox

I wanted the restricted users to use rssh as a shell, so I edited the user entry in /etc/passwd;

resuser1:x:1001:1001:NN,,,:/resuser1:/usr/bin/rssh

Note the home directory path that is prefixed simply with /.

Then I enabled only the two services I wanted to allow with rssh, in /etc/rssh.conf:

# Leave these all commented out to make the default action for rssh to lock
# users out completely...

allowscp
allowsftp
#allowcvs
#allowrdist
#allowrsync
#allowsvnserve

Then you need to add some magic statements in your /etc/ssh/ssh_config file:

# chroot stuff
Subsystem sftp internal-sftp
Match group sandbox
     ChrootDirectory /home/chroot
     X11Forwarding no
     AllowTcpForwarding no
     ForceCommand internal-sftp

I needed to comment out a previous Subsystem command as well.

Then restart the ssh daemon:

# /etc/init.d/ssh restart

And that’s it. :-D

For debugging, you might want to tail the auth.log;

# tail -f /var/log/auth.log

..whilst you log on from a client;

$ sftp resuser1@myhost.com
resuser1@myhost.com's password:
Connected to myhost.com.
sftp> pwd
Remote working directory: /resuser1