Posts for Sunday, February 7, 2010

What does all that crap actually mean?

I run open source software. A lot of it, I guess it comes close to 95% of my daily software usage. I run Firefox, Linux and a bunch of other free software things. I also support Creative Commons by making all my stuff licensed under free and simple licenses. But I am somewhat of a techy which admittedly most people ain't.

For most people the whole discussion about free software and open source and open knowledge and participatory culture is just hogwash: Why would they care about whether their software comes from some company or some guy in his/her basement? It's not like commercial software costs money (it doesn't, you just download it). What people care about is that the tools work.

This often leads to discussions about "freedom" and other fluffy, abstract words that lead absolutely nowhere due to lack of understanding, different definitions of words or general not-giving-a-shit-iness. Why is it so hard to explain the situation for the free software people and why is it so hard to understand as the average guy?

The problem is actually quite simple: For the tech person that says "but you can edit the source code!" this doesn't just mean that you can edit the source code, it means that you have regained access to the important means of production. In a world where software rules (like the virtual/online space) software is the same as a big ass factory is in the real world.

For the non-programmer, non-techy person that is sometimes hard to understand: What is the use of having source code if you cannot program anyways? That doesn't help, does it?

In fact it does. Let's try to milk this a little more till we get something clearer (and yes, I did just intentionally kill that metaphor ;-)).

Using free software is like getting back to a somewhat pre-industrialized world. No longer do you have to buy things at a big ass store, you can make things yourself. Imaging that when you need a certain tool, you can just build it yourself.

A reply could be: "But I don't want to have to make all my tools by myself!". Another one "But I don't have the skills!". And both points of view are absolutely valid, in fact, I agree with both of them. I don't have the skills to build all I need and I don't want to have to. Industrialized production has its merits! On the other hand, that is a somewhat wrong conclusion.

Having access to the source code does not mean that you have to do everything yourself. Let's try to bring the example to the real world.

Imagine a workshop. Not just one like the one you might have at home in your basement with a few basic tools to fix your bike. A bigger room with "real" machines, machines like say laser cutters and stuff like that. Machines experts use in their workplace. Of course you do not have the skills to use those machines. Maybe some but probably not all of them. But on one wall of the room is a big shelf, a library of "recipes" that allow you to build stuff that other people (that did in fact know how to deal with the machines) designed: You need a special screw so you go to the library, take out the construction manual and just walk through it. You take a piece of metal, you put it into a lathe and program it like the recipe says, a few minutes later you have your screw.

"But", I hear some people say (this is in fact just a figure of speech, I am not hearing voices ;-)), "if the screw I need isn't there, I'm [pun alert] I am still screwed!". Not at all my friend. You take the recipe of something similar, look who wrote it, go to that person and ask him/her: "Hello, you designed this thing which is kinda like the thing I need, could you maybe design something similar to it with the following properties?". And in order to show the other person that you respect their time, you can also add "I'd pay for your time.".

That is open source. It does not mean that you have to do everything yourself. It does also not mean that you cannot just build stuff and sell it to people: Building a bicycle is a pain in the ass and if you can do it well, you can sell those products to people that just don't want to do it themselves. The point is that people can modify it, change things, build on top of the knowledge of others, there always is money in betting an people being lazy or short of time ;-).

So don't focus on open source software being about some kind of "freedom", nobody cares about freedom (look at how many devices Apple sells!). Show them that open source is basically just the old tradition of science and engineering applied to real life (well in the case of software the "virtual life" obviously). It's basically just what you do with your neighbors: Each has something to offer, you throw all different abilities into a pot and see what kind of soup comes out.

Creating multi-page PDF files with GIMP and `convert`

Occasionally I have to sign some document (old style, with a pen) and send it electronically. Sometimes those are multi-page documents. Since it is uncommon to send it back as multiple image files after scanning, and multi-page image formats are uncommon as well, I’d like to send them as PDF file. Before I discovered this method, I used to insert the scanned images into OpenOffice Writer, and then create the PDF with it. This works, but it is a bit cumbersome to tell OpenOffice Writer to maximise the images (eliminating page borders, etc.), especially when there are a lot of pages. It just doesn’t feel like a real solution.

So, here we go:

Prerequisites:

  • GIMP (I’m currently at version 2.6.8, but this will probably work with older versions as well)
  • GraphicsMagick (tested with 1.3.8) or ImageMagick (tested with 6.5.8.8)

Procedure:

  1. Get the scanned pages opened as layers of one image in GIMP. If they are available as files already, you can use File / Open as Layers….
  2. Make sure that the layers are ordered in the following way: Page 1 must be the bottom layer, the last page must be the top layer. You can reorder them via the “Layers” dialogue (activate it via the Windows / Dockable Dialogues menu if you don’t see it)
  3. Save As… and choose “MNG animation” or just add “.mng” to the filename. (In case you are wondering, MNG is the animated counterpart to PNG).
    A dialogue window saying “MNG plug-in can only handle layers as animation frames” will come up – choose “Save as Animation” here and press the Export button. In the next dialogue you don’t need to make any changes to the defaults, just press the Save button.
  4. Now, open a console window and simply enter
    convert document.mng document.pdf

That’s it – you now have your PDF file ready for sending!

Update (2010-02-08):
As chithanh pointed out in comment 1, there is another convenient way to accomplish the same. It does not involve GIMP, but instead requires pdftk to concatenate PDF files. Please see comment 2 for details.

avatar

Countdown to KDE 4.4 and the new KDE website: 2 days left

Only 2 days left until the KDE SC 4.4 is released, but apparently the website design is due out on the 8th! Yes, that’s tomorrow. Today’s update shows a stage in the mockup which is natural to designers – the rejection stage. A new idea (in this case, minimalism) is chosen and we try out something new to see if we like it.

View the full update here. Full progress can be seen on my WIPUP profile.

Related posts:

  1. Countdown to KDE 4.4 and the new KDE website: 4 days left
  2. Countdown to KDE 4.4 and the new KDE website: 3 days left
  3. Countdown to KDE 4.4 and the new KDE website: 5 days left

Posts for Saturday, February 6, 2010

avatar

Countdown to KDE 4.4 and the new KDE website: 3 days left

Yep, it’s just 3 days left until KDE SC 4.4 is released and we see even more polish on yesterday’s design for the KDE website. We’ve now shaped it into a full design and we’re debating which ideas we like from this and which should be thrown away.

Click here to check it out. As usual the full progress can be seen on the WIPUP profile.

Related posts:

  1. Countdown to KDE 4.4 and the new KDE website: 2 days left
  2. Countdown to KDE 4.4 and the new KDE website: 4 days left
  3. Countdown to KDE 4.4 and the new KDE website: 5 days left

Posts for Friday, February 5, 2010

avatar

I missed this perfectly healthy rotating kitchen?

<object height="360" width="480"><param name="allowfullscreen" value="true"><param name="allowscriptaccess" value="always"><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=7887463&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00ADEF&amp;fullscreen=1"><embed allowfullscreen="true" allowscriptaccess="always" height="360" src="http://vimeo.com/moogaloop.swf?clip_id=7887463&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" width="480"></embed></object>

Related posts:

  1. TEDIndia: The thrilling potential of SixthSense technology by Pranav Mistry – how could I have missed this?

avatar

Countdown to KDE 4.4 and the new KDE website: 4 days left

Another day and we continue to see development on the KDE website redesign. We’re fleshing out the KDE webdesign mockup seen yesterday into a full page and it’s taking shape slowly but surely.

Check it out here.

As usual you can see the full series (3 in total now) on my WIPUP profile.

Related posts:

  1. Countdown to KDE 4.4 and the new KDE website
  2. Countdown to KDE 4.4 and the new KDE website: 2 days left
  3. Countdown to KDE 4.4 and the new KDE website: 3 days left

avatar

Syslinux from Linux!

This post tells you how to launch syslinux from a Master Boot Record (MBR).

Recently I was locked out of a customer-provided laptop with their development environment, and access to their source code repository via vpn.  I suspect their domain controller propagated an update last time I was on the vpn which has locked me out.

They're overseas and about 12 hours flight time away, so with their permission I used ntpasswd to reset the Administrator password.  The boot CD (downloadable as an iso) uses syslinux, which is fine, except that instead of wasting CD-Rs I like to use USB keys.

I copied the contents to a blank FAT32-formatted usb key, but it has no boot sector yet.  I installed grub and tried to make a grub menu file from the syslinux.cfg with these tips for converting a syslinux .cfg file to a grub .conf file.  I failed because the syslinux.cfg has the line:
 append rw vga=1 initrd=initrd.cgz,scsi.cgz

And I don't know how to append the two cgz's into one grub initrd line.  Normally grub uses an initrd like this:
 initrd /initrd.cgz


So I decided to install syslinux from linux.  The man page makes it look easy:
 syslinux [-sfr] [-d directory] [-o offset] device

When I ran "syslinux /dev/sdd1" and booted the laptop with this usb key, it just gave me a blank cursor blink.  This is because the laptop is looking in the MBR of the usb key and finding nothing.  The syslinux man page shows some hints:
Booting from a FAT partition on a hard disk
SYSLINUX  can  boot  from  a  FAT  filesystem  partition on a hard disk
(including FAT32). The installation procedure is identical to the  pro-
cedure  for installing it on a floppy, and should work under either DOS
or Linux. To boot from a partition, SYSLINUX needs to be launched  from
a  Master  Boot  Record  or  another  boot loader, just like DOS itself
would. A sample master boot sector (mbr.bin) is included with SYSLINUX.
Well, that's nice to know, but how do I put that on my usb key?  Follow these steps:

1. Start with a FAT32 formatted usb key (it can have other data on it) and some syslinux-based boot image.  I'm using the latest ntpasswd iso cd080802.  Unpack the contents to the root of the usb key.

2. Copy a boot sector to the code image of the MBR of your to-be-booted usb key:
sudo dd if=/usr/share/syslinux/mbr.bin of=/dev/sdd bs=440 count=1
  • /dev/sdd is my usb key
  • Look at Wikipedia for an explanation of the MBR layout
  • your mbr.bin might be in a different location.  It should come installed with syslinux

3. Run syslinux to make the partition bootable:
 sudo syslinux /dev/sdd1


4. Mark the partition as bootable (may not be necessary)
 sudo fdisk /dev/sdd

Select a, 1, w to make the first partition bootable.  CHECK THESE OPTIONS FIRST!

5. Insert USB key to your PC / laptop and boot (so long as your BIOS is setup and capable!)

Posts for Thursday, February 4, 2010

avatar

Countdown to KDE 4.4 and the new KDE website: 5 days left

Right, it’s a day later and it’s time to see where we’ve gotten with the redesign of the KDE website.

As most of you noticed yesterday, the main gripes were with the header of the design. Today’s update is a small but necessary one – one that shows the start of a new design idea. Very often the start of a design determines its success at the end, and people may or may not take an instant like/dislike to it.

I’d like to stress to those that perhaps didn’t quite get it that this work has already been done, I’m simply posting it out of good humour and I thought people would be interested.

Well, here it is.

Previous entries can be viewed in the WIPUP profile page.

Related posts:

  1. Countdown to KDE 4.4 and the new KDE website: 4 days left
  2. Countdown to KDE 4.4 and the new KDE website: 3 days left
  3. Countdown to KDE 4.4 and the new KDE website: 2 days left

Posts for Wednesday, February 3, 2010

avatar

How to Restrict Access to Terminal Servers

After finally completing my Group Policy re-write for Windows 7 this week I have gone back to working on the plans for our migration to Exchange 2010. Currently we do use an Exchange 2003 server but only a few users are on it and it is only there to provide compatibility for a couple of specialised programs that are on our Terminal Servers. With the move to Exchange for all users possibly the biggest change will be that now all users have a Windows user account potentially allowing them access to the Terminal Servers when they shouldn’t have any.

In order to do this you could make use of the builtin group called ‘Remote Desktop Users’ which aslong as your using Windows 2003 R2 should have been setup when you installed the Terminal Servers role and by default has permission to connect remotely to any Terminal Server.

It is also possible to customise which users and groups can connect remotely to a Terminal Server so you make your life easier and reuse existing groups to control access, or setup multiple groups if you wanted to limit certain users from connecting to particular Terminal Servers. To do this you can either edit the Local Security Policy on each Terminal Server or apply the changes via Group Policy, the option you are looking for to set this via Group Policy can be seen below (the Local Policy method is also very similar to this and should be easy enough to find):

Allow log on through Remote Desktop Services

Enable the 'Allow log on through Remote Desktop Services' Option

Inside this you can add all the users and groups who should have remote access.

While this may seem like all that is needed and while all the users and groups specified can now logon to the Terminal Servers you apply this to you will likely also find that infact *any* user can still login to the Terminal Servers. To correct this we need to make one final change as by default anyone in the Users group can access the server due to the ‘Allow log on locally option’.

Allow log on locally

Remove the Users group from the 'Allow log on locally' option

While you might be concerned about the warnings given in the ‘Explain this’ tab advising you to not remove users, if you read the relevant section on the link provided it explains that it is safe to do this aslong as you dont remove important users from the list and aslong as users who should have access are granted permission to do so elsewhere.

Hopefully if this has all worked you now have a Terminal Services environment where only those users explicitly allowed can gain access.

avatar

libQtGdata

I was trying to sync some google stuff (some contacts and calendars) with korganizer and kaddressbook there are nice plugins for libgcal to get an akonadi google resource. Unfortunately I was unable to fully sync both the calendars and the contacts. This are known issues but there has been no activity in the git repository for quite some time.

When taking a look at the gdata API the API seems OK and best of all well documented. So I started yet another project: libQtGdata. The aim of the project is to provide a base class to login to google and have some modular system that allows for extension to each of the google API’s, so not limited to contacts or calendars but also youtube, feedburner….. etc.

There currently isn’t much and it is quite a mess but logging in already works. Now I now the code is not very clean but after 4 weeks of intensive C coding it takes a little time to write neat code in Qt again.

avatar

Countdown to KDE 4.4 and the new KDE website

I like dabbling in web development and design and so I was quite happy to be able to participate in the redesign of the new KDE.org website due to release in conjunction with KDE SC 4.4 on February 9th. This was what I was working on during the past week and I must say I’ve learned and experienced quite a lot from trying to contribute.

So every day, including today, I will release an image showing stages in the process of creating the KDE webdesign mockup. They can be found in a newly setup WIPUP project, which can be seen in full at my WIPUP profile.

Today we start off with the original mockup (not done by me) from a user with the alias it-s. Have a peek.

Related posts:

  1. Countdown to KDE 4.4 and the new KDE website: 4 days left
  2. Countdown to KDE 4.4 and the new KDE website: 2 days left
  3. Countdown to KDE 4.4 and the new KDE website: 3 days left

Posts for Tuesday, February 2, 2010

avatar

OpenSSH: Reuse existing connections / Reverse tunnel

OpenSSHYou often hear the phrase “the swiss knife of …”. Well, for networking, OpenSSH clearly deserves that title in my opinion. Besides the obvious feature of providing secure logins with different options for mutual authentication, it can also be used to transfer files. It is also a core component of software like git, which depend on ssh to securely push changes instead of reinventing their own server and dealing with the whole authentication/authorization stuff once again.
I’ve blogged about using SSH to access hosts behind a firewall/router more conveniently, and I really suggest you sit down and read the manpage front-to-back, it will probably be rewarding for your current workflow.

Reusing a connection
Anyway, today I wanted to present another advanced feature, one I only stumbled upon while learning for an upcoming exam. The slides mentioned the possibility to share connections on one SSH-channel (to the same destination, obviously). Now, why do you need more than one connection in the first place? Well, sometimes you just need the space, and using screen just doesn’t cut it. Or you use git or scp to the same host you’re logged in already interactively. In that case, you just have to establish one connection and any further connection will use the first one. The benefit? Login is way faster, almost instantly, because the whole handshake and authentication doesn’t have to take place again. The caveat: You’ll have to close your master-connection last, otherwise the other connections will drop too. For me that’s no problem, since the host I use most of the time is also the host I’ve got a session open with 24/7 (IRC).

I’m just gonna show the fully automated version here, though you can use it manually as well, just when you need it. A better description can be found here. To automate it, put this in your ~/.ssh/config (you don’t have a config yet? shocking!):
ControlMaster auto
ControlPath /tmp/%r@%h:%p
As usual, you can put it at the very top to apply for all hosts or you can activate it for specific hosts by putting below a Host declaration. Now all you have to do is use ssh host as usual. You’ll see it’s working when you terminate the connection:
Shared connection to host.de closed.

Reverse tunnel
Yes, you can tunnel with OpenSSH. You can even have it act as a SOCKS proxy, which is really neat when combined with Firefox-plugins like FoxyProxy. But you can also reverse-tunnel your way out of a closed network (or NATed network for that matter) when you don’t have access to any intermediate host (like the router/firewall). It’s easy:
ssh -NR 12345:localhost:22 home.deThis assumes you’re issuing the command from the machine that you want to access (from home) later on. It will bind the port 12345 on home.de so that it is forwarded to port 22 (SSH) on the local host. Yeah, it requires some reverse thinking too to get it right ;) The -N-switch prevents a login, by the way. Obviously it is of little use if your home.de has a flaky dialup connection, so you might want to reverse-tunnel to a stable endpoint (or use something like autossh).

QGraphicsScene used as a QAbstractItemView II


Again some thoughts about this complex topic, but this time with content not as last time when i accidentally published an unfinished article – i’m very sorry for that.

updated diagram illustrating the QGraphicsScene used as a QAbstractItemModel

the primary difference to the last one i published is that there is the other view i’ve integrated into the automate project – the ‘TreeView’

extending QGraphicsItem to be used with a QAbstractItemModel

Q: what is this section about (in a few words)?

A: now as QGraphicsItem is used to represent QModelIndex‘es they need a way to query data from the Model, this is how it can be done

in qt4 there are a few different classes using QGraphicsItem as a base class. originally i wanted to extend the items with virtual inheritance [1] but then the ‘dreaded diamond‘ problem showed me that it can’t be done since i could NOT change the way a QGraphicsTextItem would inherit from QGraphicsItem (read: i couldn’t add the keyword virtual between

‘public _here_ QGraphicsItem’

and if that can’t be done the virtual inheritance can’t be used). of course one could now change the qt core library but that would be wrong ‘in concept’ since my application should be able to be used with any version (for example qt 4.4) not just one single version i’ve changed.

so after hours of figuring i came up with the class GraphicsItemModelExtension [2], it makes use of pure virtual functions and since QGraphicsItem(s) do have a data() and setData() function which is exactly the same function name used with the Model i had to rethink the function calls. now data() and setData() for the Model used from a QModelIndex via GraphicsItemModelExtension are named modelData()/setModelData() instead.

but what makes you want to use the GraphicsitemModelExtension class? in contrast to my previous attempt it stores the QPersistentModelIndex and you don’t have to rely on an existing scene() which is then casted from a QGraphicsScene into a GraphicsScene which then would provide a Model* which finally would be used to query data.

the basic concept after adding an item to the QGraphicsScene is that one needs to query data right in the constructor, for instance you need various properties as ‘label’ or ‘color’. since the normal item now has index() it can instantly (even when not added into a scene() yet) query the Model for data. NOTE: right after an item is added to a QGraphicsScene it does NOT have a scene() yet, if you try to query scene() from a constructor of a QGraphicsItem you WILL get NULL which was a big flaw in my previous implmenetaions. but now that problem is gone and because of the nature of pure virtual functions (yes QGraphicsItemModelExtenstion is actually an abstract base class) it helps to design new custom GraphicItems.

again ‘why i used properties instead of another hierarchy layer’

in the automate [3] project i had a TreeView which does have several columns and one can display one property per column, this is done by the data(..) implementation and is quite easy, just see my code. however in the spring random map generator project [4] i need the properties not in one row per column but instead all properties should be top down with:

module name
propertyName propertyValue (displayed by a delegate)
propertyName propertyValue (displayed by a delegate)
propertyName propertyValue (displayed by a delegate)

so i can’t use the data(..) function as i did last time. now i need one QModelIndex per row but my model currently does not have properties as QModelIndex’es at all. so what should i do? i’m still not sure about this… but as soon as i found a nice solution i will write about it.

links

[1] http://www.parashift.com/c++-faq-lite/multiple-inheritance.html

[2] http://github.com/qknight/springrts.com-random-map-generator/blob/master/src/frontend/GraphicsItemModelExtension.cpp

[3] http://github.com/qknight/automate

[4] http://github.com/qknight/springrts.com-random-map-generator

Posts for Monday, February 1, 2010

avatar

Sanctuaries

Ok, it all started with my friend Chetan letting this out yesterday:

"Windows will never be virus-free. Those anti-virus companies need to survive, don't they?"

Hmmm. That one reminded me of this one:

"World will never be rid of wars. The weapons industry needs them!"

The mention of war led to remind me of this one:

"Not everything man does is evil to nature. After all, some of us DO try and help and preserve animals. There ARE sanctuaries."

Right. Like there would be a need for sanctuaries if man hadn't threatened their existence in the first place!

This led to Vika remembering someone saying this:

"Americans didn't massacre the Indians. They're helping them preserve their culture.."

Like Vika says... nifty!

the future of the internet


before thinking about ‘the future of the internet’ let’s have a look what the ‘internet’ actually is. the internet consists of two low level protocols, that is: tcp and udp and the most prominent protocol ip. and many other protocols are building on this, as http for instance. you are currently reading this blog page using http, that means you are also connected to the internet.

if you want to be a part of the internet you need a internet address – in short an ‘ip address‘. since most of use are using ipv4 that means often ppl share one ip which is bad since you can’t address some person sharing an ip with someone else directly. Sharing usually means NAT – network address translation – and it also means that the internet does not work correctly. NAT is a failure and was never meant to be in the original design of the internet.

say you call your friend and he has no phone in his room – but one at his mother’s room. usually you can’t call between  [22,8] o’clock. the same thing is true for nat – you usually can’t reach the other person directly.

the only possible solution to this problem is ipv6. however we fail to integrate it. we currently fail at a lot of things (germany 2010):

  • apply ipv6 a standard before others do it (and we have to accept their policies & concepts)
  • removing 24h disconnects for dsl
  • creating balanced upload/download links
  • instead of forcing providers to make dsl uptime 99.9%, we still heavily rely on the telephone system which has in comparison far better service guarantees (for instance dialing 112)
  • have more applications using osi-layer 5 (session layer) instead of binding a session to ip:tcp states

So ‘what was the internet again’?

Actually the internet is much more than just what you can do with your browser using http. Before looking at http in detail let’s have a look at popular protocols which do NOT use http.

  • the first thing which comes into my mind are all the network implementations for games which most often use UDP and in some rare cases use TCP. this is a very big class of applications
  • then we have SIP and similar implementations as ’speech over ip’ in short VOIP. most internet providers tend to like SIP. gamers often use TeamSpeak or Mumble but there is skype folks as well. the most notable difference between all sip like implementations and skype is that skype’s implementation bases on a p2p structure but since it is closed source one can only speculate how chat and speech is using this framework.
  • then there are the chat clients in various flavors ranging from irc & psyc and to IM protocols as xmpp(jabber), irc, msn, aim & others. these chat clients – more often than not – have also webinterfaces which let’s YOU access the service via http as well. using http is a very interesting approach since it uses http for that and http usually DOES NOT WORK WELL with such an service but we’ll have a look at that later
  • p2p filesharing which is (at least bandwidth wise) the most popular internet service. i think about bittorrent (kademlia) or other similar concepts (this does not include services like rapidshare!).
  • last but not least there is a concept  known as ‘middle ware‘.
    for a very long time i did not understand the importance of having a ‘middle ware’ when designing internet protocols. corba and it various implementations for what one would call a ‘middle ware’ and from the protocol designer’s point of view it gives you a very high degree of object interoperability.

    • when a game developer has to write network code usually the choice tends to UDP since the laggy nature of TCP flow control can’t be ignored when one uses a internet connection with lots of packet loss. however UDP basically does not care for lost packages at all which kind of ‘overcompensates’ the problem one wants to solve. so most developers extend UDP until all needed features are there. when the network code is done and objects as players interact with other players via the network (read ip here) the game developer basically has created his own ‘middle ware’.
    • the concept using a ‘middle ware’ is very easy to understand: you don’t want to care what the network looks like you just know it’s there but instead of writing parsers for tcp or udp streams with ‘object serialization‘ and ‘object marshaling‘ one can just use an adapter in the programming language of choice which handles all this. of course using custom types here is most often not as easy as using core types as ‘int’, ‘double’, ‘float’ and ’string’ but handled in most cases.

http problems

so after looking at the use case of ip let’s have a look at http and what problems http has and how they are solved. the biggest issue using http is not the performance hit introduced by html/xml and bandwidth loss on the other hand. instead the biggest issue when using http is the fact that http is a ‘polling’ only protocol so a client might download a webpage as: http://www.lastlog.de but then closes the connection. this works well when you only want to look at webpages and if you are only interested in client side events as mouseclicks & similar. but if you want to implement an interactive chat using http it gets more complicated since you would have to query the server every second for new messages from other users (even if there was no new message at all). the server CANNOT connect to your browser and tell you about ‘the new message’ right away as it is done in all the IM protocols.

so there are some new concepts as spdy:// from google [1] but there are other similar ideas as well. all lead to a next generation http protocol with callback capabilities. opera for instance features ‘a socket in the browser‘ which is a interesting concept. both concepts transform the ‘user’ from a pure consumer into a ‘consumer/producer’.

in the first days most internet providers had ‘terms’ in their ‘terms and agreements‘ which forced you to offer no webservices with your private internet connection. the situation since the internet was introduced has changed and providers now sell devices as the fritz-box with DDNS clients for services as dyndns.org preinstalled. this change needs to be extended further as the classic pattern of ‘private’ and ‘commercial’ usage merge more every day. it gets hard to distinguish between the service levels needed for either of the two scenarios. we need to extend:

  • service guarantees (uptime/bandwidth)
  • extend upload (currently internet connections are pure consumer connections)
  • extended QoS guarantees where i think of ‘big bandwidth but high latency‘ vs. ‘small bandwidth with low latency‘ since the normal ‘telephone line’ will vanish soon we need some way of backup line for emergencies of various kinds

So after some history, what makes opera with websockets revolutionary? It’s the ‘ease of use’ to put content online. You don’t need a provider to host your stuff, just host it yourself! But there are pitfals as upload bandwidth is small even with VDSL, i don’t know why… my scale of guesses range from:

  • ‘reducing costs since most users are consumers’ to
  • forcing users to ’shut up’ and to sell enterprise servers for much money

there are many points for both sides and i don’t have much background to make a good guess.

Some final thoughts:

  • Currently I’m waiting for a revolution: the upcomming ‘ipv6′ could make skype ‘vanish’ since traversing NAT is the biggest problem in creating a ‘free clone’ of skype (this is also valid for SIP). also filesharing as p2p will work much better.
  • http will be extended with something like spdy:// very soon, which will make ajax programming pattern much more powerful
  • the normal browser will not host only some ajax scripts but will also host parts of the database and programs nowadays running on the webservers only and therefore turn into a local webserver. the first step was ajax, the second step needed is spdy:// and the third step to make this work will be adapted software for webservers to run in such a scenario. looking at the success of http is that it is a easy to use protocol with working standards and it can pass nearly every firewall. it basically hosts all kind of services. the next big step will be to make the browser to look like a application. again – the first step is something like google docs, the second step was making it a tv with plugins as flash. the next revolution for example is compiling c/c++ code in a way that it runs on top of the flash plugin [2]. in the end the browser and any normal host application merge…
  • flash will vanish – since the biggest use case is streaming videos and commercials, so guess what users will disable once most videos are played using the in-browser player (which has also huge performance improvements)?

links

[1] http://www.chromium.org/spdy/spdy-whitepaper

[2] http://www.flashmagazine.com/news/detail/play_doom_online_-_thanks_to_adobe_alchemy/

Posts for Saturday, January 30, 2010

Joined identi.ca

It has finally happened — I succumbed to the microblogging craze!

Until now I never felt any urge to use a microblogging platform, because I think that if something is worth telling, you should tell it right and that SMS'ing the world in general is rather stupid. The only real use I can think of would be to join a group you belong to communicate there when writing a blog post or e-mail would be too much.

So, now that I plan to actively participate in FSFE (and hopefully FSFE Slovenia soon) and therefore found a use for it, I created an identi.ca account.

This being said, I still think people are (ab)using this medium way too much for just outright garbage...

hook out >> trying to figure out how to get Gnash to work in Konqueror
<!--break-->

fake a dual monitor display!

Wouldn’t we all love to have a beefy workstation with at least two giant lcd monitors? Alas, I have a slim laptop with a small screen. And another laptop, almost 10 years old, albeit with a nice and large screen. I naturally prefer to use the newer machine for performance, but it also means making do with a small monitor.

I can tell you it’s a real pain to author latex documents this way, I can’t fit both the kile and evince on the screen at the same time. It wasn’t until recently that it hit me what I was doing wrong. There are three processes involved here:

  1. Document editor.
  2. Compiler (I run a loop that invokes make continuously in the background).
  3. Document viewer.

Come to think of it, this applies just as well to coding if you think “running the code” on the last step.

Well, X11 is a display server, for peet’s sake! So you have the editor on the workstation, but then you log in from the other laptop (with the larger screen) and run evince to display there.

Just do:

oldlaptop$ ssh -XYC workstation

Don’t ask me why -Y, I don’t know, but that’s how I get my ubuntu to allow remote connections.

Posts for Friday, January 29, 2010

Faunus is alive!

Finally, after an epic battle with disk encryption, the kernel and initramfs — my brand spanking new shiney matt ThinkPad is up and running!

World, be prepared for Faunus — the horned god of the forest!!!

Compiling even KDE on this puppy was a dream. I find it surreal how quiet and cool it is even when put under loads as high as 5 and 8 :3

hook out >> gotta run to the faculty for a meeting

Posts for Thursday, January 28, 2010

avatar

How dumb is Slashdot?

OK that title is a bit provocative.  I enjoy reading Slashdot as much as the next guy, and I'd always laughed at the comments about Slashdot readers being dumb, but this post got me rolling my eyes in frustration: "2 Displays and 2 Workspaces With Linux and X?"

The OP asks about buying a second monitor and setting up two screens - one large desktop or separate X screens.  Firstly, I would expect a question like this from an Ubuntu noob, followed by lots of answers like RTFM, Google it, see this FAQ, etc.

However on Slashdot, there are so many people who still don't realise that one large desktop doesn't mean windows have to maximise to two screens.  So few people seem to know about xinerama and yet they're still giving advice!  Someone said that "Windows 7's easy dual monitor setup lets you maximise to one window - can Linux do that?" (sheesh, only for years now...)

Slashdot users have some fantastic, intersting, and informative posts.  Unfortunately, unlike a regular email list where only the people who might actually know the answer reply, everybody on Slashdot wants to reply.

Quad Erat Rant-astrandum!
avatar

bash.rss to feedburner

According to the statistics many of you use my bash.org rss feed. The traffic generated by this feed has grown over the last year and right now it is around 70% of the total traffic of this website (around 600MB a month).

Just out of principle this is a bit much for a RSS feed so I decided to move the feed to feedburner. Thanks to a .htaccess rule the feed is already forwarded. This means that current subscribers to the feed should not notice anything ;)

Happy reading :-)

avatar

Debian adventures

This is post is a rant. So don’t complain, I warned you.

<rant>
On my laptop (Macbook 4,1) I run Debian testing/experimental which was running quite smoothly since I installed it apart from the couple few weeks.

The first problem I faced was java not running inside browsers. Firefox, Iceweasel, Opera, google-chrome…nothing. I spent at least 2 hours installing/uninstalling various java packages, moving plugins to new locations and I couldn’t get it to work. I was furiously googling about the issue until I hit the jackpot: squeeze : in case you have no network connection with java apps …

Today I upgraded xserver-xorg-input-synaptics from 1.2.0-2 to 1.2.1-1. Even though it is a minor version bump a kind fairy also told me to reboot…I rebooted and my touchpad was not working properly, tapping was lost, I couldn’t use synclient because shared memory config (SHM) was not activated and so on and so on. My dynamic config using hal was there, /var/log/Xorg.0.log said that I was using the proper device and lshal showed correct settings for the device. I read /usr/share/doc/xserver-xorg-input-synaptics/NEWS.Debian.gz nothing new. After some googling another jackpot: Bug#564211: xserver-xorg-input-synaptics: Lost tapping after upgrading to 1.2.1-1. For some reason touchpad config has moved to udev from hal and the maintainers didn’t think it was important enough that needed to be documented someplace or put it in README.Debian…

The last issue I am having is with linux-image-2.6.32-trunk-686-bigmem not working correctly with KMS and failing with DRM.
[ 0.967942] [drm] set up 15M of stolen space
[ 0.968030] nommu_map_sg: overflow 13d800000+4096 of device mask ffffffff
[ 0.968085] [drm:drm_agp_bind_pages] *ERROR* Failed to bind AGP memory: -12
[ 0.968159] [drm:i915_driver_load] *ERROR* failed to init modeset
[ 0.973067] i915: probe of 0000:00:02.0 failed with error -28

linux-image-2.6.32-trunk-686 works fine with those though.
[ 0.973466] [drm] set up 15M of stolen space
[ 1.907642] [drm] TV-16: set mode NTSC 480i 0
[ 2.137173] [drm] LVDS-8: set mode 1280x800 1f
[ 2.193497] Console: switching to colour frame buffer device 160x50
[ 2.197435] fb0: inteldrmfb frame buffer device
[ 2.197436] registered panic notifier
[ 2.197442] [drm] Initialized i915 1.6.0 20080730 for 0000:00:02.0 on minor 0

Xorg is amazingly sluggish using linux-image-2.6.32-trunk-686-bigmem kernel. I search the debian bugs database and noone seems to have reported such an issue. But google came up with: [G35/KMS] DRM failure during boot (linux 2.6.31->2.6.32 regression). The issue looks solved so I will try and report it to Debian and see what comes out of it…
*Update* Bug Report: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=567352

If you dare to comment saying “that’s what you get for using experimental” I really hope and curse you to spend 3 hours today to try and figure out what has changed in a minor version upgrade of one of your installed packages.
Even worse, if you are on those guys that kept telling me “don’t use stable, testing is stable as a rock, never had a problem in years…” then I curse you to spend a whole day trying to reconfigure something with no documentation :P
<rant></rant>

avatar

Firefox Personas

Firefox Persona's - inevitable Bling Bling or worthwhile (but still Bling Bling)?

If you don't know what I'm talking about, I just upgraded Mozilla Firefox to version 3.6.  The what's new? page is different this time.  Instead of the usual congratulations, security notes and links, I'm greeted with "Thanks for supporting Mozilla’s mission of encouraging openness, innovation and opportunity on the Web!" and "Choose Your Persona".


If you mouse-over any of the "persona" thumbnails, Firefox's theme changes dynamically. Cool.  Note only that but there's been quite a bit of design effort into making these personas look sleek, integrated, and elegant.

From This

To This!

I would be happy with the old Netscape look for years to come (why did they need to keep changing the logo anyway?) but I guess the iPod yungun's of today are attracted to shiny silver objects, and that goes for the software world too.  In the age of "I'll buy anything new from Apple just  because it's cool" it's inevitable that Firefox adds some chrome!
avatar

Emerge multiple packages at once

You may or may not already know about this feature, but you can emerge multiple packages at once in Gentoo.  If you have any semi-recent machine (2 years old or newer) you should definitely be using it.

Being source based - and hence compiling everything before you install it - any build time speed improvements are welcome.  We already have the -j option which can be passed to make via make.conf:
MAKEOPTS="-j3"
Various sources say to set this number j = N(CPU) + 1 or j = 2N(CPU) + 1.  I find the former is sufficient.

But what about configure?  Before you compile a package, you have to configure it, which typically can only use one CPU.  In addition there are other operations that are disk-intensive while not being CPU intensive (for instance, unpacking source code).  And finally some packages are just "broken" and internally set -j1.

So it would be nice to build (unrelated) packages simultaneously.  While one configure script is running, another could be compiling, further utilising those MeGaHurTz you paid so dearly for!  Recently I tested this for the first time.  I ran emerge like so:
$ emerge -vauDN --jobs=2 world

After looking through the output, this is how it proceeds:
Total: 70 packages (66 upgrades, 1 new, 3 reinstalls, 3 uninstalls), Size of downloads: 0 kB
Conflict: 23 blocks
Portage tree and overlays:
[0] /usr/portage
[1] /usr/local/portage

>>> Verifying ebuild manifests
>>> Starting parallel fetch
>>> Emerging (1 of 70) x11-libs/qt-xmlpatterns-4.6.1
>>> Emerging (2 of 70) sys-devel/binutils-2.20
>>> Jobs: 0 of 70 complete, 2 running Load avg: 5.56, 2.53, 1.67

And just to prove that two packages are emerging:
$ genlop -c

Currently merging 2 out of 70

* sys-devel/binutils-2.20

current merge time: 1 minute and 27 seconds.
ETA: less than a minute.

Currently merging 1 out of 70

* x11-libs/qt-xmlpatterns-4.6.1

current merge time: 1 minute and 28 seconds.
ETA: less than a minute.

A little while later, my load average settles down around 4.8:
>>> Installing (18 of 70) dev-python/pytz-2010b
>>> Installing (16 of 70) x11-libs/qt-script-4.6.1
>>> Emerging (19 of 70) dev-util/subversion-1.6.9
>>> Emerging (20 of 70) dev-lang/python-2.6.4-r1
>>> Jobs: 17 of 70 complete, 1 running Load avg: 4.84, 4.84, 3.94

You may come across some packages that are interactive, such as skype, which forces you to view and accept their EULA.  In that case the concurrent jobs are disabled.  If you wish to go ahead with all non-interactive jobs (a good idea!) run emerge like so:

$ emerge -vauDN --jobs=2 --accept-properties=-interactive world

Note this feature is not supported in older versions of portage.  I tested with sys-apps/portage-2.1.7.16
avatar

Listing packages installed from overlays

Gentoo provides an official package repository, and the mechanism for creating third-party repositories, called overlays.  Overlays can be home-made, developer-made, community-made, you name it!

It occurred to me that I wanted to list all installed packages that come from overlays.  (I'm doing some house cleaning, so I'm removing overlays I don't need anymore).  There appears to be no way to generate this list via equery (the "gentoolkit" method of doing various package queries).

This one-liner should do the trick.

$ for i in /var/db/pkg/*/*; do if ! grep gentoo $i/repository >/dev/null; then echo -e "`basename $i`\t`cat $i/repository`"; fi; done

The output of which looks (only slightly messy) like:
revoco-0.5    Orpheus Local Overlay
synce-gvfs-0.3.1    SynCE
synce-serial-9999    SynCE
synce-trayicon-0.14    SynCE
nautilussvn-0.12_beta1-r2    Orpheus Local Overlay
evolution-data-server-2.28.2    Orpheus Local Overlay
gnome-hearts-0.3    Orpheus Local Overlay
nautilus-python-0.5.1    rion
nautilussvn-0.12_beta1_p2    Orpheus Local Overlay
mozilla-thunderbird-bin-3.0_beta2    Orpheus Local Overlay
libgii-1.0.2    Orpheus Local Overlay
grub-0.97-r9    rion
usb-rndis-lite-0.11    SynCE
xorg-server-1.7.4    Orpheus Local Overlay

You can see here that I have various packages installed from the SynCE overlay, the rion overlay and my homespun "Orpheus" overlay.

It assumes your overlay was set up correctly with the file profiles/repo_name containing the overlay name, at the time of install (not available in earlier versions of portage).
avatar

iPad, what about you?

Now I really couldn’t resist. Really – and if you haven’t heard of it yet I guess Apple needs to get more fanboys, or at least ones who talk more. The iPad was released yesterday, and is the embodiment of magical Apple orgasm. Here’s a picture. Apple loves pictures.

Apple iPad

Yep, it’s simply one big iPod/iPhone with a bad accent.

I preach the economics of technology. Simply put I am mostly ridiculed for that theory by anybody who’s glimpsed at economics and doesn’t know much about technology. On the other hand it turns out that everybody I’ve talked to who does keep a close eye on the tech industry agrees almost instantly that yes, the success of products in the technology market are due to developer interest, and only developer interest in the long-run. Now I remain a firm believer of this myself and have been trying to find exceptions to this rule. One that was suggested was the Apple iPod, which as we all know was a runaway success. However seeing that lately the traditional iPods have started to phase out in favour of iPod Touches (where all the developer interest is) this example simply reaffirms my theory. The other fine suggestion was an interesting one, too – computer games. These, I believe, have a much longer period until developer interest deals the final blow – and in some cases are completely consumer-determined. These are an anomaly. I challenge people to find others.

But but but – for the rest the theory will apply. So why don’t we look at the iPad from the perspective of a producer-determined success?

If anything, Apple hit the jackpot. It’s not a secret that developers have been looking forward until the time we had a sensible tablet platform to work wonders on. When Apple decided to allow iPhone apps to run on it natively unchanged, not only does this mean that developers don’t need to bother about learning a brand new system (simplifying things a bit here), it also means that porting over applications are quick and easy. 140,000 applications immediately available to a consumer? I’ll take that, thank you very much.

I’m not too knowledgable about Apple products but I do know that iPhones can be “jailbroken” – a way of breaking your deal with Apple to enjoy a bit more freedom. If this iPad can be jailbroken to run third-party applications that don’t have the Jobs seal of approval and bypass other random restrictions I’m sure will exist, that’ll blow developer interest sky-high.

One thing many people seem to confuse developer interest with is that they think the degree of developer freedom is proportional to the interest received. No, this is not true. Developer interest arises and shifts prone to as many factors and more as consumers. If a developer thinks consumers will like it, regardless if they do or don’t, they will devote time to the product. So despite the face analysis that the iPad has 140,000 developers already upfront (on the assumption that there is on average 1 developer per app) we can’t ignore the other main factors.

In the beginning I mentioned that developers have been looking forward until we had a sensible tablet platform – so when I say other main factors, this is the one I’m talking about. Once they get over the fact that it’s quite simply a fat iPod Touch looks-wise, we’ll have to question whether or not the time is ripe for a tablet platform to come or if this is just going to be classed as another failed attempt to make a tablet successful and the “perfect” tablet is yet to come. What determines how other developers see this is how well Apple has upgraded the in-house apps to take advantage of the bigger screen.

Well folks, as you can see even though we’ve not once considered the consumer’s point of view it doesn’t get us much closer to guessing how successful it’ll be. No – the economics of technology should not be shunned to a corner and disrespected but instead embraced as a new way to look at success in technology.

Related posts:

  1. The economics of technology
  2. On the nth day of Christmas, my true love gave to me nx, (n-1)x, (n-2)x…
  3. The Google Operating System – Chrome.

Planet Larry is not officially affiliated with Gentoo Linux. Original artwork and logos copyright Gentoo Foundation. Yadda, yadda, yadda.