Planet Larry

June 01, 2008

Zeth

StumbleUpon Extension is Proprietary Software

StumbleUpon is a web service that allows you to share links with other users. Sometimes readers have shared this site and my number of visitors have gone up (cheers for that).

StumbleUpon is commonly used through a toolbar provided as an extension through Firefox or Internet Explorer, and a comment-in-the-last-post reminded me about it.

This made me think, what is the licence of this Firefox extension? If you go to the StumbleUpon-homepage, there is no software licence or terms at all. If you click the "Download now - Free" button, you go through to the download-page, still no licence or terms. I unzipped the extension, looking for a software licence, nothing.

Eventually, after a bit of digging and Googling, I found their Toolbar-License and guess what it is proprietary software, so if you want to run free software/open source, then get it off your system now!

The licence only gives you:

"a non-transferable ... non-sublicensable ... license to reproduce (solely to install and execute) the Toolbar on one of your computers, in executable object code format only, for your personal, non-commercial use only,"

Of course, the "Toolbar" is released as a Firefox extension, in plain-text Javascript and XUL, not in object code format. There is not really object code at all in Javascript, object code is a C term. But the lawyer writing the boilerplate probably didn't know or care about the difference. Anyhow, the licence continues:

"You may not modify, make derivative works of, copy, reproduce, publish, or reverse engineer the Toolbar"

This is in complete opposition to free software/open source, where all users have four freedoms:

  • The freedom to run the program, for any purpose (freedom 0)
  • The freedom to study how the program works, and adapt it to your needs (freedom 1). Access to the source code is a precondition for this.
  • The freedom to redistribute copies so you can help your neighbor (freedom 2).
  • The freedom to improve the program, and release your improvements to the public, so that the whole community benefits (freedom 3). Access to the source code is a precondition for this.
Discuss this post - Leave a comment

June 01, 2008 01:28 AM :: West Midlands, England  

Are your Firefox extensions proprietary software?

In the last-post, I went through the most popular Firefox extensions and talked about whether they were good ideas or not. However, it seems that not a lot of people think about another side to this, i.e. what are your Firefox extensions licenced under?

It turns out that a lot of the extensions available through Firefox are not free/open source software at all.

One example is the StumbleUpon Extension. StumbleUpon is a web service that allows you to share links with other users. Sometimes readers have shared this site and my number of visitors have gone up (cheers for that). StumbleUpon is commonly used through a toolbar provided as an extension through Firefox or Internet Explorer, (and a comment-in-the-last-post reminded me about it).

This made me think, what is the licence of this Firefox extension? If you go to the StumbleUpon-homepage, there is no software licence or terms at all. If you click the "Download now - Free" button, you go through to the download-page, still no licence or terms. I unzipped the extension, looking for a software licence, nothing. This made me very suspicious, when people are proud of their licence, they put it right in front of you, what are they hiding?

Eventually, after a bit of digging and Googling, I found their Toolbar-License and guess what? Yes you guessed it, it is proprietary software. So if you want to run free software/open source, then get it off your system now!

Their licence only gives you:

"a non-transferable ... non-sublicensable ... license to reproduce (solely to install and execute) the Toolbar on one of your computers, in executable object code format only, for your personal, non-commercial use only,"

Of course, the "Toolbar" is released as a Firefox extension, in plain-text Javascript and XUL, not in object code format. There is not really object code at all in Javascript, object code is a C term. But the lawyer writing the boilerplate probably didn't know or care about the difference. Anyhow, the licence continues:

"You may not modify, make derivative works of, copy, reproduce, publish, or reverse engineer the Toolbar"

This is in complete opposition to free software/open source, where all users have four freedoms:

  • The freedom to run the program, for any purpose (freedom 0)
  • The freedom to study how the program works, and adapt it to your needs (freedom 1). Access to the source code is a precondition for this.
  • The freedom to redistribute copies so you can help your neighbor (freedom 2).
  • The freedom to improve the program, and release your improvements to the public, so that the whole community benefits (freedom 3). Access to the source code is a precondition for this.

Don't sell out your freedoms so cheaply! If you want the most free software computer possible, look up the licenses of your extensions.

For example, here are five popular extensions that are free software/open source:

  • Firebug: Mozilla Public License 1.1
  • Flashblock: Mozilla Triple Licence (MPL 1.1/GPL 2.0/LGPL 2.1)
  • AdblockPlus: Mozilla Public License 1.1
  • FireGPG: Mozilla Triple Licence (MPL 1.1/GPL 2.0/LGPL 2.1)
  • NoScript: GPL

Please do audit your own, and let us know what you find. Knowing which extensions are free and which are not free would be really helpful.

Digg-entry

Discuss this post - Leave a comment

June 01, 2008 01:28 AM :: West Midlands, England  

May 31, 2008

Martin Matusiak

an absurd industry

There are many things that seem reasonable to the average rational person, but then there are some that just seem absurd.

First, a little background. Security is not just a playground for hackers and software companies. It seems that way sometimes, but security has become a rather potent industry in its own right since the days of the first well publicized viruses and Windows exploits. So much so that finding and reporting security exploits is now commonly a job rather than an underground, subculture activity. There is a bunch of people who are employed to do this now, and who effectively drive the standards for security by publishing bugs in various products.

Now, whenever something has value of some kind, simple economic principles naturally imply that it can be used in a trade. Security vulnerabilities indeed have certain value. By discovering a weakness in a product that noone else knows about, you stand to gain something if you decide to use it maliciously. If not, you may still consider selling it to someone who will use it maliciously. And if you’re just not into that kind of evil, you still have a certain leverage over the vendor that sells this product, because you know more about it than they do. So you could easily contact them and say I found a weakness in your product, which allows people to steal your customers’ data. Although I don’t intend to abuse this personally, we both know there are plenty of people out there who do, and who work hard to find these bugs themselves. If this weakness in your software should remain intact, and abused by someone, you’re gonna be in a lot of trouble. So how about you recompense the efforts of my research and I will hand it over?

As a vendor, this isn’t the most pleasant email to get. But after all, this person has found something that is our fault, and we have only ourselves to blame for selling something that has such an obvious weakness in it (or we don’t think it’s serious and we’ll just wing it, hoping noone gets burnt on this). Okay, raw deal for the vendor, but if you’re selling something that your customers bought in good faith, and it turns out it could pose a threat to their data, it’s definitely your fault.

Depending on how successfully this person is able to negotiate with the vendor, the outcome may be various. But if the [let's call him a] researcher isn’t able to come to terms, the next best thing is just to make it public. Like we saw already, a vulnerability has a certain value. If you’re not able to claim this in hard currency, you’ll at least want the recognition for finding this bug so that you can hone your reputation as a security professional and maybe someone will give you a [better] job.

But there is a problem. As we know from every Hollywood corporation-vs-little-guy story, companies always respond to threats the same way: calling their lawyers. The lawyers always try the same thing: hush it up. So they send out lots of scary documents, trying to shut the guy up. And whatever your legal position is, you’ll never win, cause corporations have armies of lawyers (armies of janitors too, actually, armies of everything). So chances are they will successfully silence you and your plan of publishing the vulnerability fails. You don’t get any money, and you don’t get any credit. The vulnerability remains intact, the vendor, even if they know how to fix it, probably won’t do anything about it cause noone is pushing them to.

This is the bizzarre landscape in which an industry, which would otherwise seem absurd, somehow makes sense. These security researchers don’t have much leverage against the legal armies of corporations, so there are actually certain companies now that trade in vulnerabilities. They will buy them from researchers and then try to reclaim a profit from the vendor, or even sort of broker the deal without putting the researcher in jeopardy. This way, the researcher can either get money for it, or if that fails, publish it.

Not surprisingly, vendors make a big stink about what they call “responsible disclosure” (ie. telling them first, hoping they don’t try to silence you I guess), but the truth is they abhor these things being made public, as Jonathan Zdziarski explains at length.

*

Incidentally, if you’re at all interested in security, you should check out some of the fascinating talks on security from various security events. Conferences like DefCon generally publish all the talks online. You’ll be blown away by what’s actually possible (and not just possible, probably being done right now) and your perception of how secure you should feel online will be changed forever. If you want to be both enlightened and entertained, I would pick Dan Kaminsky, cause he likes to showboat.

May 31, 2008 08:47 PM :: Utrecht, Netherlands  

Jürgen Geuter

Centralized installing of windows software in linux environments

If you have used wine before you probably know that it defaults to installing its software into $HOME/.wine/. This is somewhat messy when you want to have software installed centralized because how do you guarantee that all users have the windows software available?

You could give everyone a default .wine dir that defines a new drive d: which is a mapped network drive and install everything there but that's all kinds of messy and probably won't work all that well. After a few tests, this is the setup that I think works best:

You create a different .wine for every application. To make sure wine uses the right one you just have to set the WINEPREFIX variable. Often you don't actually want all the users to use exactly the same instance of the windows software (because of setting or data) so they all will need their own little installation.

For each windows software you create a starter script that does invoke the software with the right WINEPREFIX set and that does make sure that a proper .wine-APPLICATION dir exists. That way you can make sure that for example .dlls and .exes are synced to the $HOME/.wine-APPLICATION/ dir of every user (for example by calling rsync). This way you can have all the users in your network use windows programs that you can store and keep updated centralized. If all your home dirs are on one central server all you will need is wine on the clients and the starter scripts that you can keep in sync really easily with a cronjob.

The .wine-APPLICATION folders are separate (every program has its own little windows so to speak) which limits weird hard to find bugs when software interacts and users only get them if they really start the software. You have some overhead because the software will be copied to every user's home but for smaller applications that are not really built for multiuser this is the best idea.

For "real" multi-user windows apps installing them on a centralized drive that is then mapped to it's own .wine dir is probably the cleanest approach.

May 31, 2008 12:13 PM :: Germany  

Zeth

Will Epiphany be able to compete with Firefox's extensions?

I recently looked at the forthcoming Epiphany browser based-on-Webkit. However, some people told me that Firefox has so many extensions that it would not be possible for a new browser to compete, even among the target audience of GNOME users. Is this true?

I am not a C hacker and don't want to be at this stage, so I can't really help with the heavy lifting in finishing the new Epiphany. However, the previous Gecko-based version allowed you to write extensions in Python, so if that is true in the new version, I could write an extension or two.

The old gecko version of Epiphany had various extensions, and a dozen or so of the best were bundled in the Epiphany-Extensions package.

Firefox extensions

It is early days because, as far as I know, the new Epiphany extension API is not written yet, however, we can do a little research about Firefox extensions, and seeing which ones are worth replicating on Epiphany. I myself have FireGPG (allows you to use GPG with webmail), Flashblock (blocks Flash movies unless whitelisted) and FireBug (see below).

There are 2353 add-ons and themes in the Firefox add-on database, several are abandoned in that they have not been updated to work with modern versions of Firefox. The bottom 1000 have had very little impact. For example, the "Et Lolcat" extension translates English to 'locat', it has only been downloaded 26 times ever. I doubt the lack of a lolcat extension is going to prevent anyone from using Epiphany.

As you might expect, outside the big hitters, the popularity of extensions tails off pretty fast. The top few add-ons have been download hundreds of thousands of times, the 100th add-on has been downloaded 10,000 times, the 1000th add-on has hardly ever been downloaded by anyone.

So lets ignore all the themes as Epiphany themes according to your desktop theme; lets also ignore all the abandoned extensions and the extensions which have never really been downloaded by anyone. So we can say there are less than 500 extensions that are actually relevant for our purposes. This is still a massive number. I cannot think of another piece of software that has 500 active extensions.

In the rest of this post, I look through the list of the top 100 downloaded-add-ons. This list of course is dynamic, so will change according to when you view it. So where I have included a number, it is the position in the top 100 when I looked at it. Do not worry I don't talk about 100 add-ons, a lot of the top 100 add-ons are themes and dictionaries which I have ignored.

The top three

Video DownloadHelper (1) - This allows people to rip videos out of sites like Youtube, as does UnPlug (37) and a million others. This could be easily replicated by Epiphany but maybe a better approach would be a "save-as" button in Gnash? Likewise Flashblock would not be required if Gnash has an option for "only play when the user agrees to".

Adblock Plus (2) provides advert blocking, as does Adblock and Adblock Filterset.G Updater (38). In the old Epiphany, there already was a decent adblock. This can and no doubt will be easily replicated by an Epiphany extension.

NoScript (3) provides blocking and white-listing of Javascript. This could be easily replicated by an Epiphany extension. Epiphany already gives you the ability to turn Javascript on and off globally, the extension just needs to give the ability to control this behaviour per site.

Not all extensions are priorities

IE Tab (7) allows Windows users of Firefox to open non-standard webpages in IE. This is not available on Firefox for Linux so is irrelevant. People should not write IE only webpages.

Next we have the replacements for Firefox's rubbish download dialog: DownThemAll (4), Download Statusbar (6), PDF Download (10), Fast Video Download (15), ScrapBook (28). Hopefully Epiphany's download dialog will be good enough out of the gate. So these are not a priority.

Foxmarks (9) and Speed Dial (29) are replacements for Firefox's annoying bookmarks dialog. Epiphany's bookmark manager is better, so these extensions are not a high priority.

Greasemonkey (5) is a higher level extension tool, it basically makes it easier to write extensions for Firefox, especially per site extensions. If Epiphany's extensions are easy to write, this will not be needed.

The Fasterfox (17) extension allows you to prefetch pages, as well as make concurrent connections, i.e. download the same page ten times at the same time. I am undecided weather this extension is a good idea for the web. I wouldn't want people using it on my sites.

A web browser is not a desktop environment or package manager

Quite a few of the extensions use Firefox as a convenient way to make and distribute an application, not surprising as Windows does not have a package manager. These extensions may have none or only tangential connection to the fact that Firefox is a web browser. Many of these in Linux would work just as fine or better as a separate application, indeed many equivalent applications already exist and are probably better.

FireFTP (18) is an FTP client, GNOME has GFTP which is perfectly fine. FoxyTunes (27) is a media player frontend, Linux has billions of media players. Forecastfox (12) tells you the weather, the GNOME desktop already tells you the weather, we can even look out a window. Likewise, FoxClocks (30) tells you the time, which the GNOME desktop does by default. After 40, we have RSS Readers such as the "Feed Sidebar" and "Sage", as well the IRC client ChatZilla. GNOME has lots of RSS Readers, e.g. Straw and Liferea, and Linux has lots of IRC Clients. The best way to use IRC is to use a client that can run 24/7 on the server, such as Irssi.

ScribeFire is a Firefox extension that provides a text editor for blogging. There is GNOME-blog available through all the package managers, but I prefer to use a real text editor. FoxSaver is an extension to provide a screensaver and photoviewer, GNOME has the Eye of GNOME image viewer and its own screensaver. ReminderFox (35) provides reminders, as GNOME already does.

PicLens (8) provides desktop effects for Firefox on Windows. It is not available for Linux, but Compiz with Epiphany does a better job. The same applies to "Tab Effect" (21) and FireGestures (24).

The Firebug (13) extension is a fantastic toolkit for web designers that turns your browser into a complete Dreamweaver clone. This would perhaps be better as a webkit based application, the same goes for "Web Developer" (20).

"Better Gmail 2" (14) provides extra options for Gmail, turning Gmail into a rich desktop application. The whole point of web-based email is that you can access it from any computer anywhere without special software. If you want to use installed software, then Gnome has Evolution which is richer than any web application.

I also skimmed through the 100 to 200 most popular add-ons, and it was more of the same. I hate to be a snob, but it seems that the most downloaded extensions are not necessarily the best ones!

Conclusion

There are many hundreds of Firefox extensions, some of them are absolutely fantastic, however many are repetitive, many also replicate things that already exist on a GNOME based system by default or are quickly available in the package manager. A large number of the extensions are old and have not been ported to modern versions, and some of them are just bad ideas.

This survey has convinced me that it is quality not quantity that matters, that with just 20 well chosen extensions, Epiphany could offer the features that 80% of GNOME users want, with 50 well chosen extensions, it could offer the features that 95% of GNOME users want. I am talking about extensions that actually have something to do with web browsing, not turning Firefox into a jukebox, or into a calendar, into a Compiz replacement, or into an operating system of its own.

Discuss this post - Leave a comment

May 31, 2008 11:40 AM :: West Midlands, England  

Sean Potter

Updates not without Woes

I made a few small changes to BIOSLEVEL tonight. This is after trying to complete a new review or two this morning, but found myself unable to complete because my camera has decided to go haywire. More on the camera later. Let's look at what I've changed with BIOSLEVEL.

Changes to BIOSLEVEL

The changes aren't too numerous, nor are they complete yet. First off, I've altered how the <title></title> tags are done, so article names are now displayed rather than just "Article & Reviews". Hopefully this improves the site's overall SEO. The second part of the update comes in the form of some buttons for our article & review pages: Digg It, E-Mail Page, and Stumble Upon.

E-mail Page will either open a new window (smaller) or within the same window a page that allows them to e-mail the article's introduction, title, image, and link to someone's e-mail. I obviously won't track e-mail addresses, but should I keep track of how many times the feature is used per article? Obviously, I haven't implemented this feature just yet.

Digg It submits the story to digg. Obviously. Stumble Upon submits the story to Stumble Upon, but I haven't added the link for this just yet. I'd also like to add some icons for Reddit and a few similar services as well. Anything to build up more traffic.

Camera Woes

My aunt bought me a Cannon PowerShot S1 IS a few years ago for Christmas. At $400 at the time, the S1 IS was only a 3.2MP camera, which is really more than I need. I spent some time debating this morning while looking through cameras on NewEgg.com

I almost bought the latest version of my camera, which boasted a whopping 8.1MP and a 12x optical zoom, whereas my camera only has a 10x zoom. I ended up purchasing the Nikon D40, a DSLR camera. It'll be my first DSLR, and I'm really hoping that my older SLR lenses will still work with it.

There's more functionality in this camera than I'll probably ever use, but I'm also up for experimenting with it. The important part, however, is that I'll be able to take shots of products to complete my reviews.

Take a peek at BIOSLEVEL for the said updates, and watch for a new review in a day or so. Also expect another entry here in the near future.

May 31, 2008 07:24 AM

Steven Oliver

Bye bitch…x ;)


That ellipses was a comedic pause. You may laugh.

Anyway, I got rid of BitchX. While I was glad that I tried it, this client called Irssi is much better. It was one of those feelings where the program just feels crappy. Irssi doesn’t feel like that yet, but we’ll see. And if you need any help simply follow this guide. Worked for me. Irssi appears to rememer commands on its own which is nice, but I’d like to edit some conf or script files. Haven’t looked for them yet, but I’ll see later

Enjoy the Penguins!

May 31, 2008 01:51 AM :: West Virginia, USA  

May 30, 2008

Jürgen Geuter

Feature uniformity in open source and opinionated software

In open source software there's a trend towards feature uniformity. Let me explain what I mean:

When for example Mediaplayer_A gets a new "killer feature" (like for example sharing of music over the net as we have it with DAAP) it does not take long till libraries emerge that implement the functionality and all the other media players integrate it, too, often most of them relying on one library (like for example libgpod for Ipod access). If there was no easy library to include to get the feature with "little" work probably way less projects would integrate it (cause reverse engineering is a whole lotta work). That is what we see in closed source software from time to time where one has that killer feature the others don't seem to be able to pull off.

Now one could say that this makes it boring (as uniformity often does) and that it spawns more of same-old, which is a valid concern. As long as the developers don't have a clear "vision" where they wanna go with their software it will spawn an army of clones, all pretty much the same thing (maybe implemented in different languages/toolkits).

I argue that it gives developers more possibility to be "opinionated". There's not the need to throw countless development hours at things that other people had already done or at reverse-engineering some kind of protocol. This frees up resources to actually invent and do things in new ways.

These new ways might scare some of your users away cause they don't like the new way but that's a sacrifice you'll have to make to write the best possible software. Staying similar to everyone might bring more people in (as in "Oh it's amarok in Python? Cool!") but creating something new and exciting is the way to push things forward.

Fighting uniformity while on the other hand profiteering from it is a tough line to walk, it's a very narrow path between being a clone and going the whole NIH-way both of which make your software of little use to the community. But it's an awesome opportunity to actually challenge the abstractions and representations that we thing are "god-given". It's a way to rethink human-interface-design because you know that many of the basic features are actually already covered.

The fact that open source gives you a large box of blocks to play with is what makes it so interesting. You just have to make the step to actually challenge the things that be.

May 30, 2008 10:59 AM :: Germany  

May 29, 2008

George Kargiotakis

Another day, another debian headache

The case is this, a debian server running Debian 4.0 etch has it’s motherboard broken. We send it for replacement but they don’t have another of the same model to send us so they send us a shiny new model. The new model houses a P35 chipset. The latest Debian 4.0 etch kernel is 2.6.18 [...]

May 29, 2008 09:21 PM :: Greece  

Jason Jones

Postgres Authentication in Proftpd

Today I was commissioned to create an FTP server here at work.  Through persistent pestering of the hideously insecure nature of FTP in general, my boss let me dedicate an entire server just for the company's need to FTP.  This was to negate the possibility of any hacking of the web server, should the FTP server be compromised.  It's even going to be  restricted to its own subnet.

All technicalities aside, my boss told me just to put up a "quick" site for a "couple" of users.  Well, I've been a web dev for long enough to know better.  A "quick" site put up quickly becomes the site everyone uses, and the subject of incessant requests for improvement.

I didn't want that to be the case for this FTP server, so I spent the time and hopefully did it right.

I'm using Proftpd 1.3.1 on gentoo (of course), and I'm authenticating through a postgres database.  Yes, it's probably overkill, but at least I'll be able to sleep at night after 5,000 people are using it each having their own repositories.

Here's how the config looks, just in case anyone is trying to do the same.

ServerName            "Natures Way FTP Server"
ServerType            standalone
DefaultServer        on
RequireValidShell    off
SQLAuthenticate        users
SQLAuthTypes        Plaintext
SQLBackend        postgres
SQLConnectInfo        proftpd@localhost username password 120
SQLDefaultHomedir    /var/ftp/default
SQLDefaultUID        21
SQLDefaultGID        21
SQLEngine        auth
SQLNamedQuery        get_user_info SELECT "username, passwd, uid,gid,homedir,shell FROM users WHERE username = '%U' LIMIT 1;"
SQLUserInfo         custom:/get_user_info

SystemLog        /var/log/ftp/system.log
TransferLog        /var/log/ftp/transfer.log
DebugLevel        9

DefaultRoot        ~

AuthPAM                off
AuthPAMConfig        ftp
Port                21
Umask                022

MaxInstances        30

User                proftpd
Group                proftpd

<Directory />
    AllowOverwrite        on
</Directory>



I created a simple table containing username, passwd, uid, gid, homedir, and shell fields and I was off!

Anyway...  I just thought of putting in a quick 'n' dirty reference for anyone trying to use postgres authentication through proftpd.

Hope it helped (and sorry it wasn't very thorough.  I had about 10 minutes to throw this together)

May 29, 2008 06:20 PM :: Utah, USA  

Zeth

SFTP in Python: Really Simple SSH

ssh.py provides three common SSH operations, get, put and execute. It is a high-level abstraction upon Paramiko.

I wrote it yesterday for my own needs, so it is still very much in the beta stage. Any improvements or comments gratefully accepted.

In short, it works as follows:

import ssh
s = ssh.Connection('example.com')
s.put('hello.txt')
s.get('goodbye.txt')
s.execute('du -h --max-depth=0')
s.close()

That is it, in the rest of this post, I walk through this line by line.

Installation

First, we need to install paramiko, if you don't have it already.

On Gentoo Linux:

emerge paramiko

On Ubuntu/Debian and so on:

apt-get install python-paramiko

If you want to use Python's easy_install then:

easy_install paramiko

Secondly, you need to grab the ssh.py module, grab it from my code-page, and save it as ssh.py.

Connecting to a remote server

To play with the script interactively, you need to start Python:

python

Now, import the ssh module:

import ssh

Next we need to initiate the connection. If your username is the same on both systems, and you have set up ssh-keys, then all you need to do is:

s = ssh.Connection('example.com')

Connection supports the following options:

host The Hostname of the remote machine.
username Your username at the remote machine.
private_key Your private key file.
password Your password at the remote machine.
port The SSH port of the remote machine.

The host is essential of course. Port defaults to 22. The username defaults to the username you are currently using on the local machine.

You need to use one of the authentication methods, a private key or a password. If you don't specify anything, then ssh.Connection will attempt to use a private_key at ~/.ssh/id_rsa or ~/.ssh/id_dsa.

So to specify a username and password, you can do it like this:

s = ssh.Connection(host = 'example.com', username = 'warrior', password = 'lennalenna')

Of course, Python also allows you to use the order to specify the arguments, so the last example can be written as:

s = ssh.Connection('example.com', 'warrior', password = 'lennalenna')

Operations

Once you have set up the connection, there are three methods you can use. Firstly, to send a file from the local machine, you can use put:

s.put('hello.txt')

The above example copies a file called hello.txt from the current local working directory to the remote server. We can also be more explicit if we want:

s.put('/home/warrior/hello.txt', '/home/zombie/textfiles/report.txt')

So the above example copies /home/warrior/hello.txt on the local server to /home/zombie/textfiles/report.txt on the remote server.

The second operation works in a similar way but in reverse:

s.get('hello.txt')

get takes the file from the remote server to the local server, again we can be more explicit if we want:

s.get('/var/log/strange.log', '/home/warrior/serverlog.txt')

The above example copies the strange.log from the server and saves it as serverlog.txt.

The last operation is execute, this executes a command on the remote server:

s.execute('ls -l')

This returns the output as a Python list.

Closing the connection

You can do as many operations you like while the connection is open, but when you are finished, you need to close the connection between the local and remote machines. You do this with the close method:

s.close()

There we go, that is all I needed to do with SSH. Please do let me know using the comments below if you have any problems using it.

If you import my module in your program and later find that you need more power or flexibility, you should be able to swap it out for the full paramiko with a minimum of fuss.

Discuss this post - Leave a comment

May 29, 2008 03:28 PM :: West Midlands, England  

Michael Klier

What Are You Doing In Front Of Your Computer All Day?

This is a question I hear way too often from my flat mates, friends and family. Most of the time, a conversation that started with such a question goes something like:

<someone> What are you doing in front of your computer all day?
<me> Hmmmmm, I'm working ... kind of.
<someone> All the time?
<me> Not all the time, but well, probably most of it.
<someone> Aren't you chatting or stuff like that?
<me> Yep, but that's not the type of chatting you're used to I guess.
<someone> What are you working on?

Now the conversation reached a point where you can either terminate it by saying something that just pops into your mind, like you're preparing something for work tomorrow (most people I met aren't interested enough in the job I have to ask further questions) or you get yourself prepared to explain:

  1. FOSS to someone who has absolutely never heard about it
  2. what the whole story really means to you
  3. and why you're participating (which way ever)

or simply that you're trying to make your NAS drive playing music, while being remote controlled via bluetooth from your cell phone (chances to terminate a conversation with this answer are actually quite good).

Regardles of which of the above options you choose, you'll have a hard time to explain something that most people (at least the ones I met) can't accept as being rational.

<me> Well, there's this Open Source project, called foo I am helping a little bit here and there.
<someone> What is Open Source?
<me> Hmmmm, well ... 
[skipping stuff about available source code, licenses, the M$ example of closed sources and so forth].
<someone> Aaaaaha (I haven't really understood 75% of what you've just said but).
<someone> Are you or the others getting paid for what you do?
<me> Actually, nope, there are exceptions of course.
<me> However, chances are that someone maybe donates a few bucks.
<someone> That doesn't make any sense at all, why are you doing this?

This is the hardest part of the story. At least for me. In fact, I have to answer the “Why am I doing this question?” (apart of the fact that Open Source makes sense) from time to time for myself to keep me on track and motivated.

Fun

I am an hobbyist. I have fun exploring new things. I'm self taught. Even though I've never studied computer science or the like, I am quite interested in programming and managed to develop I think at least average programming skills in some programming languages (yes, I make/made mistakes and like probably everyone else I am still learning). Some people I've met fail to understand why learning programming could be fun in any possible way, but to me it's just that, fun.

People

The other thing that drives me are the people. To me, Open Source also means meeting (not necessarily in real life) a lot of new interesting people (with far superiour coding skills ;-)). Often these people happen to share the same sense of humour or other interests and you can have a good time hanging around in IRC/forums (though that as well depends on the community).

Reward

And last not least, there's this warm feeling you get once you've accomplished something. When I think back to the day my first patch was merged upstream my heart still beats a little faster and it's still a great moment when that happens nowadays. I am really not addicted to the whole thing, though some would probably guess so by the time I spent in front of my computer, but I'd surely miss quite a lot if all that would be gone one day (though I can't think of how that could possibly happen other than by going blind or loosing my hands).

What about you? Why are you contributing to Open Source projects (or maybe you've even started your own)? What are your motivations?

Read or add comments to this article

May 29, 2008 12:01 PM :: Germany  

Iain Buchanan

Step 6... Profit!

Them good 'ole spam messages are getting more cryptic! This is the latest one I just recieved:
1. Find a girl
2. Invite her to your appartments
3. Use subject product V (or C)
4. Have fun
5. Take her number
6. Profit?
Beats me what that means! Maybe it's really a secret code...

May 29, 2008 05:07 AM :: Australia  

Steven Oliver

Setting up Gentoo


Setting up Gentoo has become, for me, more painful than installing these days. Everything from SLiM to Fluxbox to Conky to bitchX gives me trouble.

I’ve got everything installed and restart and SLiM won’t start despite the nVidia logo popping up. Well, apparently I had the mouse named one thing in the device section and something else in the screen section. Then I tried again and the same thing happened. Apparently on Gentoo you have to install the evdev driver independently. So now SLiM will start but Fluxbox will not after logging in. Yes, you can see where this is going. So apparently leaving the ampersand off of the command to start conky on login stopped fluxbox in its tracks. I cannot explain that one but that appears to be what happened.

I then spent the next hour or so trying to figure out bitchx. I never would have guessed that making bitchX appear in the background as part of the desktop was such a painful ordeal. Yeah, well it is. If anyone ever wants help doing it leave me a note. Maybe I’ll stuff on article in the Gentoo Wiki on it. Maybe I’ll do it for my own sake. Either way I think I now have it working. Here’s another oddity though. I set the geometery of the Eterm terminal through the command and through Fluxbox’s app file. For some reason doing that made bitchX take up 100% of my processor usage. I can’t explain that one either.

Good luck setting yours up. This is crazy. Oh yes, and lets not forget my adventures in font land. Needless to say Paludis still works flawlessly with no setup hassle.

Enjoy the Penguins!

May 29, 2008 03:02 AM :: West Virginia, USA  

May 28, 2008

George Kargiotakis

pcmanfm 0.4.1.1 ebuild

A new pcmanfm version (0.4.1.1) is out and since there’s no ebuild yet available I made one by modifying a bit the one I found about version 0.3.2.2 on sunrise overlay. I’ve included a patch I found about enabling/disabling deletion confirmations. Downloads: pcmanfm 0.4.1.1 ebuild pcmanfm 0.4.1.1-r1 ebuild confirm_delete.patch tested on x86 and ppc (thanks to comzeradd) enjoy! P.S. Looks like I [...]

May 28, 2008 11:14 PM :: Greece  

Zeth

SFTP in Python: Paramiko

In your scripts or applications, you might need to copy a file from one server to another. One way to do this is to use SFTP, the secure file transfer program, which uses an encrypted SSH (Secure Shell) transport which in turns runs over TCP/IP.

One of the Python implementations of SSH is called Paramiko (available in package managers as paramiko or python-paramiko).

Paramiko is extremely comprehensive so you can get as complicated as you like, but for me, I just want to be able to copy files from a known remotepath to a known localpath and back again.

In this post I explain how to do this using Paramiko directly, in the next-post, I look at another approach.

So we start by importing the module, and specifying the log file:

import paramiko
paramiko.util.log_to_file('/tmp/paramiko.log')

We open an SSH transport:

host = "example.com"
port = 22
transport = paramiko.Transport((host, port))

Next we want to authenticate. We can do this with a password:

password = "example101"
username = "warrior"
transport.connect(username = username, password = password)

Another way is to use an SSH key:

import os
privatekeyfile = os.path.expanduser('~/.ssh/id_rsa')
mykey = paramiko.RSAKey.from_private_key_file(privatekeyfile)
username = 'warrior'
transport.connect(username = username, pkey = mykey)

Now we can start the SFTP client:

sftp = paramiko.SFTPClient.from_transport(transport)

Now lets pull a file across from the remote to the local system:

filepath = '/home/zeth/lenna.jpg'
localpath = '/home/zeth/lenna.jpg'
sftp.get(filepath, localpath)

Now lets go the other way:

filepath = '/home/zeth/lenna.jpg'
localpath = '/home/zeth/lenna.jpg'
sftp.put(filepath, localpath)

Lastly, we need to close the SFTP connection and the transport:

sftp.close()
transport.close()

In my humble opinion, one should not have to write so many lines or care about the SSH protocol just to send a file from a to b. In the next-post, I will share my own higher level API that runs on top of Paramiko.

Discuss this post - Leave a comment

May 28, 2008 01:59 PM :: West Midlands, England  

Sean Potter

Weekly Workings

I've been very busy the past week, mostly just for the fact that I worked eight days straight. It might have been good money, but tomorrow is a well-earned break. In these past eight days, I fell behind in some of the reviews I've been writing.

I meant to post a review of the OCZ Reaper HPC DDR2 RAM I used in my reviews of the 780G motherboard and Radeon HD3870 Toxic, but fell behind because of all the extra hours spent at work. There're several more reviews to follow the review of this RAM, but my main concern right now is the RAM.

BIOSLEVEL has several fantastic reviews coming up, but what I'm really excited about is a home theater series of articles I'm trying to plan out utilizing MythTV. We have one machine that's able to act as a MythTV box itself, as well as a MythTV server so other units can connect to it. This'll be a great option for some units such as the Asus barebones I recently reviewed for BIOSLEVEL

On the bright side of my time issues, I did manage to get a little done on a new design for this site, as well as business cards for BIOSLEVEL. Once both are completed, I'll post the final designs. Or, that is, change the design of the side and post an entry about the business cards.

May 28, 2008 08:13 AM

Iain Buchanan

Logitech MX Revolution in Linux

With my Dell Precision M6300, I was given a Logitech MX Revolution Rechargeable Cordless Laser Mouse. There's a review here. This is a great looking mouse with a good feel (if you're right-handed). It has the usual buttons and wheels. Compared to other laser mice, it has the same smooth flow and precision.

The greatest feature however, and it's stand-out point is the wheel. The wheel can change from a click-wheel to a free wheel. By default in Linux (no special drivers loaded) The wheel button itself changes this behaviour, which means you don't have a middle-button (button 2). If you use this for Firefox tabs, or pasting, you will find this a real pain!

Windows users get an extra feature: Depending on how fast you scroll the wheel, the click-scroll will automatically disable, allowing the wheel to free spin for quite a few seconds. When it stops, the click-feature automatically sets back in. You can hear this with a small "clunk". Logitech claims this is great for navigating very large documents quickly. I like it because I like watching shiny things spin :)

I assumed I would be left without this in Linux however, as weird Windows driver stuff is usually not available. Think again! Thanks to Some Guy there is a program called revoco to control it. Petteri Räty (betelgeuse) has created an ebuild for Gentoo. Follow his instructions, and be sure to read the comments, as you will find some useful info there. I had to do the following:

  1. Edit revoco-0.3.c and change the value of #define MX_REVOLUTION to the value you get for you mouse from `lsusb`. Mine is c525.
  2. The auto setting was a bit whacko by default - the solenoid was clicking on and off without even moving the wheel. This worked:
    $ sudo revoco auto=10
  3. Setting the manual click change to button "6" (find button) gives you the middle click (button 2) back *woot*
    $ sudo revoco manual=6
    and also gets rid of that annoying "search" keyevent which I have a keyboard for :)
  4. But unfortunately, when I set the manual=6 option, the auto scroll feature turns off again :| But that's a small price to pay!
Now I can show off to my friends :) What fun!

May 28, 2008 07:11 AM :: Australia  

Brian Carper

mp3gain

I listen to MP3s in the car and it's annoying when the volume isn't normalized. I can't be fumbling around with the tiny buttons on my MP3 player to adjust the volume while I'm driving. I found mp3gain and used it on a bunch of files and it appears to have worked.

If anyone knows of a better program for normalizing volume of lots and lots of MP3s, post now or forever hold your peace.

May 28, 2008 01:52 AM :: Pennsylvania, USA  

May 27, 2008

Steven Oliver

Vim trickery


I found two new things to stuff in my vimrc file. I thought I would post about them here so that others could revel in the glory of v-i-m.

set backupdir=$VIM\vim71\backup
set directory=$VIM\vim71\backup

On Linux these two commands do not really appear to help you that much. On Windows though (haven’t tried on any other OSes) these two lines are a life saver.

If you have backup set in your vimrc you’ll notice that Vim leaves little backup files of every file you edit in the same location as that file. Well, generally, these are hidden files on Linux so you might very well have hundreds of them laying around and you don’t even know it. On Windows though they’re not hidden and constantly clog of you desktop along with every other folder full of text files. So the first one is a lifesaver.

The second command, the directory setting, is were Vim will store its swap files that it creates. I do not honestly know what exactly is kept in these things, but they’re temp files who are removed as soon as the editor is closed. But this command keeps them out of sight if nothing else. I’m anal about my desktop so that explains my love of the second setting as well.

I put both of mine in a directory, simply titled, “backup.” I do not know what the difference is between the vimfiles directory and the vim71 directory, but I put them in the latter. Everything else seemed to be there.

So there you have it. Two little tidbits to tiddy of your desktop.

Enjoy the Penguins!

May 27, 2008 07:01 PM :: West Virginia, USA  

Exherbo!


These new beast they call Exherbo looks tempting. Almost tempting enough to ruin a perfectly fine Gentoo installation just to see if I can do it or not. For now though I believe I will hold off and wait. At least until the new init system is fairly usable. Then you can bet your ass I’ll be all over it. But until it gets to that point I’ll have to settle for the feed. Which has thus produced some fairly interesting posts.

Being built from scratch with paludis makes this distro more than interesting. Paludis has always felt like it was only living up to half its potential on Gentoo. But various parts of the distro were holding back. Hopefully Exherbo will cure that sensation.

May 27, 2008 06:19 PM :: West Virginia, USA  

Another Install Story


If there is one thing I love, its a good install story. The trial and tribulations of the people who think they know what they’re doing and how badly they screw it up.

I actually installed Gentoo this weekend. At this point my only  saving grace when it comes to installing Gentoo is I’ve screwed up in just about every way possible so when I screw it up these days I generally know how to get out of it. Everything went great except for the vga parameter in my grub.conf. I should write down which one I use because I spend at least an hour rebooting a blank screen every time trying to figure out the right one.

One thing I have noticed though is the ridiculous amount of posts (blogs and forums) on the speed comparisons of the various package managers. Personally, numbers mean nothing to me, speed is subjective. Just like how my car feels really fast at 50 on curvy road but slow as hell at 50 on the interstate. What I’m getting to here is that the discussion of speed always leads to other talks about how terribly hard it is to setup the various package managers. Well, I’ll just tell you right now, anyone who cannot get paludis up and running within 5 minutes of installing is an idiot. The portage2paludis.bash script has worked flawlessly for me every time.

Regardless of all of that, I now have Gentoo Linux, Fluxbox, and Paludis all working together to make me a happy camper.

Enjoy the Penguins!

May 27, 2008 06:15 PM :: West Virginia, USA  

Martin Matusiak

OpenID deserves to die

Here’s my perspective on it. We all have ideas, some good and some bad. Now it’s understandable that people who have invested themselves into a bad idea, especially if they thought it was good, are reluctant to walk away from it. It’s painful to have to realize that. But the flip side is that we have to maintain the myth of Santa Claus because, well, so many kids believe in him that we can’t let them down. Bad ideas deserve to die for the good of everyone.

The first thing a good idea must have is a real problem to solve. OpenID does very well here. The point of OpenID is to solve our common problem of the internet age: many websites, many accounts, many usernames and passwords. This is probably why OpenID still appears to some people as being a good idea.

Here’s how they do it. Instead of keeping track of your accounts on all the sites you’re a member of, just let one site keep all your account records (sound ominous yet? it did to me). Now, whenever you want to login to one of your sites, instead of using your username/password for that site, you use your OpenID login, which looks like this: http://username.myid.net. This url is effectively your OpenID provider, ie. the site you use to keep track of all your accounts. So now the site you’re logging into sends you to your provider, where you login with a username/password belonging to the account on the provider site, and that logs you into the site you were visiting. So in other words, your account on the provider is the gatekeeper to all your accounts. Sounds simple, right?

I remember when I first heard about this idea years ago. The first concern I had was that in order for this to work, I need a provider to keep track of all my accounts. So I asked myself the question: whom do I trust do this for me? The answer came back: myself. I don’t know about you, but the idea of some third party storing all my logins doesn’t make me feel warmy and cuddly. As it happens, the open in OpenID means you can choose any provider you want, including yourself. You just set up some php scritps and voila, you can use http://mysite.com as your provider. So basically, instead of storing your accounts in some “account manager” program on your computer, you do the same thing on your server. This is where the concept of OpenID died for me. I don’t want to have to depend on my own OpenID provider to work in order to use other sites. I don’t want to add a dependency on my ability to login to some other site contingent on the assumption that my own site is available and working properly at all times (which it isn’t, I have a little downtime like everyone else).

If you don’t want the hassle of being your own provider, you can pick a provider from a list. This is not an attractive fallback option, because now your account on the provider is your key to all your other accounts. If I have an account on some site and I forget my credentials, big deal, I only lose that one account. But if I lose my credentials on the provider, I lose everything.

In theory, OpenID tries to improve your overall security. The hassle of keeping track of accounts is known to us all, and we get around the problem by reusing the same (or similar) credentials on a lot of sites. This is obviously bad for security, because if someone gets your password to one site, they can access all your other accounts that use this password. So security people will always recommend that you use distinct credentials for every account. Suppose you do this, and you use OpenID to alleviate record keeping. Now, OpenID actually works against you. Your account on the OpenID provider is the key to everything. With a different password on every site, you’re that much less likely to remember what it was, therefore your account on the provider is proportionally more valuable.

There is a strange irony at play here. Supposedly, the more accounts you manage with OpenID the more useful it is. But on the other hand, the more accounts you manage with it, the more you depend on it, and the more you make it the one gateway to all your online identities for a potential attacker or for abuse by a dishonest or incompetent provider.

Most importantly, however, OpenID’s solution to the login problem isn’t a very clever solution at all. Typing http://username.myid.net is not a big improvement over a username/password form. My browser already gives me the option to login without typing anything.

Those are my reasons why OpenID is a bad idea and should have died years ago. If you want more, Stefan Brands has an exhaustive laundry list of problems with OpenID.

May 27, 2008 04:15 PM :: Utrecht, Netherlands  

Dirk R. Gently

Quick Tips


Linux Quick Tips
Hello blogosphere! As I’m working on putting my bash scripts together, here’s a few quick tips that one may use in everyday life.

Background Command

Ever started a program in the terminal because it doesn’t have a menu listing, or need to see it’s error output and then realize later that you need the terminal? Opening another tab is simple enough but you really don’t need the program hogging the terminal anymore. Well, there is a way to do this.

Previously, people may have viewed my bash script that can start programs in the terminal in the background. Already running applications can be backgrounded as well. First type ctrl-Z to release the application, then using the bg program will background it’s output.

Gnome’s Middle-Click, Title-Bar Trick

For the long time I’ve been using Gnome and just learned about this one. A quick way to look at a window below the current on is to middle-click on title bar. Voila! The current window izzz lowered. More tricks can be found on Gnome Tip’s and Tricks page.

Firefox Hunt

I have the tendency that once I’m on the keyboard, I like to stay on the keyboard, so doing a search in Firefox by going to the mouse selecting the search engine, and typing in the field seems like extra legwork to me. To do a fast search in Firefox on the keyboard is as easy as: ctrl-K to move to the search box and alt-up/down to select the search engine.

Grep Two Search Terms

On the occasion that a grep search needs to look for two words, egrep it:

egrep -w 'word1|word2' /path/to/file

Fox in Hounds Teeth

This is personal advice, but take it from me - worth it. Don’t use Foxmarks Bookmarks Synchronizing Service. I used this service as I sold my old computer when I got the new. I trusted this service to hold my web bookmarks and… it didn’t. It errored with the line, “Can’t synchronize bookmarks, transfer error.” I asked about the error and only got the explanation that, “…this sometimes happens”. Also I got no explanation on why or what happened to their backup service.

There’s another Bookmark Synchronizer out there but for the life of me can’t remember the name of it. Anyone?

Thunar Custom Actions

Thunar has the ability to create custom scripts built directly into it. For the most part it’s self explanatory. For greater degree of difficultly scripts, here’s the documentation.

Have a Good Day! :)

May 27, 2008 04:13 PM :: WI, USA  

Martin Matusiak

kwin leaks memory

Something is very wrong here. Right after starting a KDE session everything looks normal.

But after running for a day we have a different story. I’m assuming this isn’t the expected behavior (if so I didn’t expect it).

This time I specifically took a screenshot to prove it, but I’ve seen it eat up as much as 1.3gb of my memory, which is rather unnerving.

kwin-kde4        4:4.0.4-0ubuntu1

Bug report.

May 27, 2008 01:00 AM :: Utrecht, Netherlands  

May 26, 2008

Jürgen Geuter

Thinkwhack

I was in a project-y mood today and since work was going good all day, I started some work on a little pet-project called "Thinkwhack".

It's somewhat inspired by smack.py but I wanna make it somewhat more flexible and useful.

What it will do is to allow you to have certain action triggered when "whacking" the laptop (if your laptop has a hdaps module which only Thinkpads have I think). Right now it's pretty simple and just plays a sound but it already has a proper systray icon so things should be easy to add there.

I play to give the user the option to play sounds or trigger other options when whacking the machine (maybe tilting also): Hide all the windows on your desktop for example, switch workspaces, run a random script.

The next step will be to get a proper motion detection algorithm in there cause right now it's not that smart, then some proper configuration.

Here is some video footage:


It's not really all that useful I admit but still might turn out to be useful later ;-)

What this definitely will spawn are a few python howtos so it's not in vain.

May 26, 2008 08:49 PM :: Germany  

Jason Jones

Ultrasound For 3rd Child

For the last two children, I've been relatively relaxed with the rest of my life, so I was eagerly awaiting and up-to-date with the happenings of our pregnancy.

This time around, I'm quite busy otherwise, and this ultrasound crept up on me.

I'm also quite amazed at the technology which wraps around the medical field.  At the last portion of the video, you can see our little boy's profile quite clearly.  It's amazing.

Anyway...  I was really excited to hear the heartbeat and see our little guy this time, as I wasn't really thinking much about it until it happened.  Kind of a spiritual occasion.

The video was quite big this time, and I haven't got around to editing videos yet, so the above is the complete ultrasound.

Thanks for watching!

May 26, 2008 03:16 PM :: Utah, USA  

Daniel de Oliveira

Unmasking Gnome 2.22 and more…


For those (like me) that are tired of 2.20 and don’t want to install autounmask for any random reason, here’s the list of packages:

sys-apps/hal ~x86
dev-python/pyxf86config ~x86
app-misc/hal-info ~x86
net-wireless/bluez-libs ~x86
media-plugins/gst-plugins-dvb ~x86
media-libs/gst-plugins-bad ~x86
media-plugins/gst-plugins-fluendo-mpegdemux ~x86
media-plugins/gst-plugins-mythtv ~x86
media-libs/gmyth ~x86
gnome-base/gnome ~x86
media-libs/gst-plugins-base ~x86
dev-libs/liboil ~x86
media-libs/gstreamer ~x86
gnome-base/gnome-applets ~x86
dev-libs/glib ~x86
dev-libs/libgweather ~x86
gnome-base/control-center ~x86
gnome-base/gnome-settings-daemon ~x86
gnome-base/gnome-desktop ~x86
gnome-base/libgnomekbd ~x86
x11-wm/metacity ~x86
gnome-extra/fast-user-switch-applet ~x86
gnome-base/gconf ~x86
gnome-extra/gconf-editor ~x86
x11-libs/libwnck ~x86
gnome-base/gnome-panel ~x86
gnome-base/gvfs ~x86
net-libs/libsoup ~x86
gnome-base/gnome-session ~x86
gnome-base/gnome-keyring ~x86
app-editors/gedit ~x86
x11-libs/gtksourceview ~x86
dev-python/pygtksourceview ~x86
gnome-extra/evolution-data-server ~x86
dev-util/gtk-doc-am ~x86
gnome-base/libgnomeui ~x86
gnome-extra/gnome2-user-docs ~x86
gnome-base/gnome-vfs ~x86
gnome-extra/deskbar-applet ~x86
gnome-extra/gucharmap ~x86
gnome-extra/nautilus-cd-burner ~x86
gnome-base/nautilus ~x86
gnome-base/eel ~x86
net-misc/vinagre ~x86
net-libs/gtk-vnc ~x86
gnome-base/gnome-menus ~x86
gnome-extra/gnome-system-monitor ~x86
media-video/totem ~x86
dev-libs/totem-pl-parser ~x86
dev-python/gdata ~x86
media-plugins/gst-plugins-meta ~x86
gnome-base/gdm ~x86
sys-auth/pambase ~x86
sys-libs/pam ~x86
x11-themes/gnome-themes ~x86
media-sound/sound-juicer ~x86
gnome-extra/bug-buddy ~x86
media-gfx/eog ~x86
mail-client/evolution ~x86
gnome-extra/gtkhtml ~x86
app-arch/file-roller ~x86
net-analyzer/gnome-nettool ~x86
app-crypt/seahorse ~x86
x11-terms/gnome-terminal ~x86
x11-themes/gnome-icon-theme ~x86
gnome-extra/swfdec-gnome ~x86
media-libs/swfdec ~x86
gnome-extra/zenity ~x86
gnome-extra/yelp ~x86
app-text/rarian ~x86
gnome-extra/gnome-games ~x86
gnome-base/libgnome ~x86
x11-libs/pango ~x86
x11-libs/gtk+ ~x86
net-misc/vino ~x86
net-im/ekiga ~x86
gnome-extra/gnome-power-manager ~x86
www-client/epiphany ~x86
dev-python/gnome-python-desktop ~x86
gnome-base/libgtop ~x86
gnome-base/gnome-volume-manager ~x86
gnome-extra/gnome-screensaver ~x86
gnome-base/libbonobo ~x86
gnome-base/librsvg ~x86
app-misc/tomboy ~x86
dev-dotnet/dbus-sharp ~x86
dev-dotnet/mono-addins ~x86
dev-dotnet/dbus-glib-sharp ~x86
gnome-extra/evolution-webcal ~x86
x11-misc/alacarte ~x86
dev-libs/atk ~x86
gnome-base/libbonoboui ~x86
gnome-extra/gnome-media ~x86
app-text/evince ~x86
app-text/libspectre ~x86
gnome-extra/gcalctool ~x86
app-admin/sabayon ~x86
x11-themes/gtk-engines ~x86
x11-themes/gnome-backgrounds ~x86

May 26, 2008 08:29 AM :: São Paulo, Brazil  

Brian Carper

Emacs undo is horrible

Emacs has a, well, "unique" undo system. It only has undo, no redo. When you undo something, the act of undoing is added as itself onto a stack of undo actions. When you've un-done enough things, you do "something, like move the cursor, and that breaks the chain. From there if you undo again, you will traverse back over the undo actions you just did.

This is supposedly powerful. It does help with the following situation:

  1. Type something.
  2. Type something #2.
  3. Type something #3.
  4. Undo undo undo.
  5. Type something #4.

In most programs once you reach step 4, you can redo to get back to the text you just undid But once you reach step 5, the first three things you typed are lost forever. You've gone back in time and changed history, eradicating the old future and replacing it with a new one. You can never get back to the old future. Emacs undo, on the other hand, where undo actions are just like any other actions and pushed onto a stack of actions, does let you undo back first three things you typed.

However in practice this doesn't work so well. This site has a nice quote:

“By [undoing] repeatedly, you can gradually work your way back to a point before your mistake. This is convenient if you’ve made a mistake four or five commands back. It is marginally useful if you’ve made a mistake twenty or thirty characters back. And it is completely useless if your mistake is ancient history.” - Learning GNU Emacs (page 42)

The problem being, supposing you undo 20 times, and break the chain (by moving the cursor for example), if you then decide to undo one step FURTHER back, you have to undo all 20 of your previous undos, undo 20 more times, then undo once more. Eventually you end up feeling like you're going up and down a roller coaster of undos.

If you hate this, which you probably do, you could use redo mode, which gimps up Emacs undo/redo to be like any other program's, i.e. you get the same behavior as Microsoft Notepad. (Although when I tried it, it was buggy as heck, failing to undo my actions properly, mangling text from different lines together and whatnot.)

Vim's undo system on the other hand is far better and equally powerful. You have a standard undo / redo option via u and CTRL-R. You also have a second completely different way to undo: you can "go back in time". In the above example, Vim will create two undo "branches" and you can jump from one to the other even if you undo and "break the chain" by typing something new.

Doing :undol lists the branches, in a somewhat confusing format. But you can just pound g- and g+ to go to older / newer text states, or use :earlier with a human-readable time (say, 10s or 5m) and it will take you to that point. These will get you all the power of Emacs' undo stack, with none of the pain or confusion. See also :h undo-two-ways.

This is one of many instances where Vim wins, hands-down. Vim's undo system isn't as reprogrammable as Emacs, but it's so powerful and so perfectly what you'd want that it doesn't matter. This is beautifully typical of Vim. I don't have a year to figure out all the nooks and crannies and edge cases and idiosyncrasies of Emacs undo system, let alone the time it'd take to write a custom, crusty elisp script to buggily re-implement it.

Being an "extensible text editor" doesn't help much when such basic functionality is so broken. Unless you want to play your undo history back like a movie, in rainbow colors, which I don't. I want undo/redo that works.

May 26, 2008 06:54 AM :: Pennsylvania, USA  

Iain Buchanan

No Mio P560 for Australia :(

Earlier this year I enquired about the Mio P560 - a great looking PDA/GPS with windows mobile 6. At the time it was "due to be released within a few months". I just got an email saying it will no longer be released in Australia:
Dear Iain

You enquired about the Mio P560 a little while ago and this is to let you know that this model will not be released in Australia.

Sorry we are unable to assist you at this time.

Kind regards
mioEshop
I have looked through so many GPS models it's not funny - that elusive perfect handheld is proving to be very... well, elusive!

Compare the .com product list with the .com.au product list!

May 26, 2008 05:26 AM :: Australia  

May 25, 2008

Dan Ballard

Turning your laptop into a wired to wireless router for your wirelessly challenged friends

Say you're at a party and the only internet is a wireless router and for whatever reason, no one can plug into it. Wireless internet only. You with your fancy laptop are sitting pretty and this is just fine. They your friend shows up lugging his clunky old desktop that only has an ethernet port for internet connectivity. Is he out of luck? Turns out not, because you an come to the rescue!

It's really easy, especially with Ubuntu.

To start with, you need to be a router, so you need firewall software that can do NAT (network address translation). This is part kernel side (NAT and iptables options enabled and modules loaded) and part user space side, in the form of the program 'iptables', so make sure it is installed, which it is by default on Ubuntu (I think).

Now all you really need to do is add two routing rules, one says anything coming on the ethernet port should go through the NAT procedure, which basically means it's IP headers are tweaked to make it look like they originated from your computer and then you send them along to the internet. The second rule helps facilitate this (I'm a little less sure what it does, but it's needed).

In this case we are assuming the interface eth0 is the wired network and eth1 is the wireless. Change as required.

iptables --table nat --append POSTROUTING --out-interface eth1 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT

Next you just need to tell the kernel port forwarding should be turned on, and you can do this through the wonderful /proc filesystem.

echo 1  > /proc/sys/net/ipv4/ip_forward

Now you're pretty much ready to go. Connect to the wireless, presumably though NetworkManager or your wireless toll of choice. Then enable the wired network manually.

ifconfig eth0 up 192.168.1.1

This turns on eth0 with a local network address of 192.168.1.1. Now plug your friend's computer into the ehternet port with a crossover ethernet cable or into a hub and then the hub into you with regular ethernet cable and have them manually pick an address on 192.168.1.* (or whatever local network you chose, it doesn't matter) and set you (192.168.1.1) as the gateway router.

If this is a little much for them or they are running an OS that makes this non trivial, than its really another easy step for you to set up a DHCP server and do all the configuration for them :).

So install dhcpd, on Ubuntu it's 'dhcp3-server', on Gentoo I think it's just 'dhcpd'.

Now we have to configure it. We have to tell it the gateway router, which is us (192.168.1.1), the nameservers (the servers in /etc/resolv.conf) and the pool of IPs to use and what interface/network to listen on.

Open the config file, on Ubuntu '/etc/dhcp3dhcpd.conf'.

The relevant parts are as follows

...
# servers in /etc/resolv.conf
option domain-name-servers 192.168.0.1;

...

# the local network you created
subnet 192.168.1.0 netmask 255.255.255.0 {
        #IPs free to assign
        range 192.168.1.100 192.168.1.200;
        #your computer, the router
        option routers 192.168.1.1;
}

And that's it. (Re)Start the server

/etc/init.d/dhcp3-server restart

And you are now serving all the information your friend's computer will need to automatically connect properly.

They should now be online once they restart their internet connection.

One annoying thing about Ubuntu vs Gentoo is that on Ubuntu, the init system is a bit more kludgy and old fashioned. Any server software installed is automatically configured to start at boot time, forever, which in this case isn't what you want. You only want the dhcpd server to run very rarely, at parties, the rest of the time it's a waste. So we need to turn it's auto starting off. Apparently the /ubuntu init system barely supports this, we have to force it.

update-rc.d -f dhcp3-server remove

Now just turn it on when you need with its init.d file.

May 25, 2008 08:23 PM :: British Columbia, Canada  

Daniel de Oliveira

(easy) LVM on Gentoo


LVM (Logical Volume Manager) is a great piece of software which allow you to deal with Logical Volumes. Using LVM, you are able to extend/reduce your filesystems which is pretty handy when you need more space.

Let’s get the easy way to do that.

Obs.: My post about LVM on ubuntu have a lot of info, so I’ll paste the important info about LVM here

What is LVM?

LVM (Logical Volume Manager) is a great piece of software which allow you to deal with Logical Volumes. Using LVM, you are able to extend/reduce your filesystems which is pretty handy when you need more space.

A lot of distributions support out of the box in installer. Unfortunately, Hardy Heron doesn’t offer this on the Desktop Install CD.

What can I do with LVM?

* Resize volume groups online by absorbing new physical volumes (PV) or ejecting existing ones.
* Resize logical volumes online by concatenating extents onto them or truncating extents from them.
* Create read-only snapshots of logical volumes (LVM1).
* Create read-write snapshots of logical volumes (LVM2).
* Stripe whole or parts of logical volumes across multiple PVs, in a fashion similar to RAID0.
* Mirror whole or parts of logical volumes, in a fashion similar to RAID1.
* Move online logical volumes between PVs.
* Split or merge volume groups in situ (as long as no logical volumes span the split). This can be useful when migrating whole logical volumes to or from offline storage.

What can’t I do with LVM?

* LVM does not provide parity-based redundancy across LVs, as with RAID4, RAID5 or RAID6. This functionality is instead provided by Linux metadisks, which can be used as LVM physical volumes.
* Converting regular filesystems into LVM filesystems online (you also can copy the stuff to a logical volume).

Implementation

LVM keeps a metadata header at the start of every PV, each of which is uniquely identified by a UUID. Each PV’s header is a complete copy of the entire volume group’s layout, including the UUIDs of all other PV, the UUIDs of all logical volumes and an allocation map of PEs to LEs. This simplifies data recovery in the event of PV loss.

In the 2.6-series Linux kernels, the LVM is implemented in terms of the device mapper, a simple block-level scheme for creating virtual block devices and mapping their contents onto other block devices. This minimizes the amount of relatively hard-to-debug kernel code needed to implement the LVM. It also allows its I/O redirection services to be shared with other volume managers (such as EVMS). Any LVM-specific code is pushed out into its user-space tools, which merely manipulate these mappings and reconstruct their state from on-disk metadata upon each invocation.

To bring a volume group online, the “vgchange” tool:

1. Searches for PVs in all available block devices.
2. Parses the metadata header in each PV found.
3. Computes the layouts of all visible volume groups.
4. Loops over each logical volume in the volume group to be brought online and:
1. Checks if the logical volume to be brought online has all its PVs visible.
2. Creates a new, empty device mapping.
3. Maps it (with the “linear” target) onto the data areas of the PVs the logical volume belongs to.

To move an online logical volume between PVs, the “pvmove” tool:

1. Creates a new, empty device mapping for the destination.
2. Applies the “mirror” target to the original and destination maps. The kernel will start the mirror in “degraded” mode and begin copying data from the original to the destination to bring it into sync.
3. Replaces the original mapping with the destination when the mirror comes into sync, then destroys the original.

These device mapper operations take place transparently, without applications or filesystems being aware that their underlying storage is moving.

How can I learn more?

http://en.wikipedia.org/wiki/Lvm
http://tldp.org/HOWTO/LVM-HOWTO
http://sourceware.org/lvm2/
http://www.gentoo.org/doc/en/lvm2.xml

Requirements

* Gentoo 2007.0 livecd/livedvd or any other distribution livecd able to load lvm modules and applications.

Preparing

1) Start dm-mod (if not started yet)

modprobe dm-mod

3) Redetect disks and/or start lvm stuff.

vgscan
vgchange -a -y

Preparing Disks

Let’s create a boot partition outside of LVM and all the rest for LVM (120Mb for /boot in 2*40Gb hardisks).


$ sudo fdisk /dev/sda

The number of cylinders for this disk is set to 4865.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-4865, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1033-9729, default 9729): +120M

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (17-4865, default 17):
Using default value 17
Last cylinder or +size or +sizeM or +sizeK (17-4865, default 4865):
Using default value 4865

Command (m for help):t
Partition number (1-4): 2
Hex code (type L to list codes): 8e

Command (m for help):w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.

$ sudo fdisk /dev/sdb

The number of cylinders for this disk is set to 4998.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-4998, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-4998, default 4998):
Using default value 4998

Command (m for help):t
Partition number (1-4): 2
Hex code (type L to list codes): 8e

Formating Partitions

1) Format /boot partition
$ sudo mke2fs /dev/sda1

2) Create physical volumes for LVM

$ sudo pvcreate /dev/sda2
$ sudo pvcreate /dev/sdb1

3) Create volume group (I’ll use rootvg, like AIX)…

$ sudo vgcreate rootvg /dev/sda2

4) …then add the second physical volume

$ sudo vgextend rootvg /dev/sdb1

5) Create the logical volumes.

$ sudo lvcreate -n rootlv -L 15G rootvg
$ sudo lvcreate -n varlv -L 5G rootvg
$ sudo lvcreate -n homelv -L 30G rootvg
$ sudo lvcreate -n usrlv -L 15G rootvg

6) Now you’re able to *see* this logical volumes in Ubuntu Installer.

7) After installation ends, don’t reboot yet. Mount your logical volumes, proc and dev.

$ sudo mount /dev/rootvg/rootvg-rootlv /mnt
$ sudo mount /dev/rootvg/rootvg-usrlv /mnt/usr
$ sudo mount /dev/rootvg/rootvg-varlv /mnt/var
$ sudo mount /dev/rootvg/rootvg-homelv /mnt/home
$ sudo mount -t proc proc /mnt/proc
$ sudo mount -o bind /dev /mnt/dev

You know the rest… and don’t forget to put LVM support on kernel.

May 25, 2008 03:10 PM :: São Paulo, Brazil  

Zeth

Is Django stable?

I have a friend and fellow member of the Python West Midlands group. Whenever, someone mentions Django, he asks the person "but is it stable?". This has been repeated so much that is has become a local in-joke. However, lets take the question seriously.

To explore this further, we need to ask what does stable mean? I.e. can we replace the word "stable" with something else to provide some more meaningful questions:

  • Can Django handle traffic loads?
  • Is Django actively maintained, i.e. are bugs being fixed?
  • Will the Django API evolve in the most backwards compatible way possible?

Lets take these one at a time.

Traffic loads

Django's frequently-asked-questions says:

Is Django stable?

Yes. World Online has been using Django for more than three years. Sites built on Django have weathered traffic spikes of over one million hits an hour and a number of Slashdottings. Yes, it's quite stable.

The first sentence is a testimony, useful but not a direct answer. In the second sentence, 'stable' is used as in 'strong table', i.e. Django can handle a heavy load, (i.e traffic rather than physical objects).

It goes on to explain that Django has a "shared-nothing" approach, i.e. you can throw more servers directly at whatever bottleneck you have. If the database is the database, then you can add more hardware to the databases, if it is images the are the problem, you can add more hardware to the media servers, and so on.

Is Django maintained?

The next question is whether Django is actively maintained. One simplistic measure is to look at the bug database and see what is going on. In what follows I use "ticket" in the broadest sense, i.e. not just a confirmed code error, but also enhancement requests, invalid bugs and so on.

At time of writing, Django has 1092 open tickets, out of which, 311 are new and unreviewed, I would guess that half of these are valid problems, and half are not.

Meaning the other 781 open tickets have reviewed by someone at least once. Some have been triaged and are waiting to be worked on, some are