Planet Larry

August 14, 2008

Zeth

Native XML storage with Berkeley DB XML - part one

XML databases have not really broken through yet in a big way, primarily because SQL has proved more resilient than expected in storing a wide range of data.

SQL has limits

For example, object-relational mappers such as SQLAlchemy, the one inside Django and ActiveRecord in Ruby, have become very popular recently, as they all you to serialise in-memory objects and store them in a database. Very little SQL experience is required and you can create very elaborate relational storage.

However, when you have data that is not relational at all, converting it to rows and columns can be either lossy or a lot of work, and often you end up unable to round-trip, i.e. you can get the data in, but you cannot get it out again in the original format.

The most common approach is not to even try, i.e. often people will not store XML in a database, but run a series of XML files though some XSLT stylesheets and then store the compiled HTML in a database. This removes XML's advantage as a processable exchange format. In order to get the data in a different way, the human has to go back to the beginning of the pipeline and rerun the complication and database import. If you want to allow other computers to make flexible requests over the Internet, well then you are out of luck.

Meanwhile, a lot of the XML extensions to SQL databases are still relational underneath, for example, with MS SQL, you can give it XML, which it then splits up into rows and columns; you can then also ask for the data back in XML, which it then retrieves from the rows and columns and outputs in XML. You have not actually gained very much however, as your data is still stored in rows and columns, you have to output the data before you can process or query the XML. This can prove very long-winded with highly complex hierarchical data, it can sometimes prove faster to just dump the XML to disk yourself.

Even worse is storing a whole XML document within a single SQL field in a single row. Again, this is using a database instead of a hard disk.

Elliotte Harold's article, Managing XML data: Native XML databases is a few years old so the software examples he mentions are probably a little old, however the discussion of why one might want an XML database is quite good, this interview with Jonathan Robie is also worth browsing.

Berkeley DB

Berkeley DB, more commonly BDB or just DB, is the classic embedded database, Started in 1991, it is used more or less everywhere. Despite some recent completion from SQLite, it is still by far the leading embedded database. It bundled inside in everything: Linux, BSD, OS X, OpenOffice, Python, Apache, Sendmail, Postfix, subversion, GNOME and no doubt millions of other things.

DB, like much of software that powers the world, was started at the University of California, Berkeley. It was then spun off in Sleepycat Software, which was bought by Oracle a few years ago. Note DB has nothing to do with Oracle's eponymous relational database product. They are at the complete other end of the spectrum, Oracle database is for large corporate data storage, while DB is a fast and light embedded database.

DB is also non-relational, i.e. there is no SQL interface, there are key-value pairs stored in byte arrays and that is more or less it. If you want SQL or network interfaces, then you stick that on top, for example DB is one of the back-end options for MySQL.

Berkeley DB XML

The folks at Sleepycat/Oracle have been working on Berkeley DB XML for a couple of years, but it is not so well known as its older brother. DB XML is a layer on top of DB that forms a fully XML-native database with "XQuery-based access to documents stored in containers and indexed based on their content". (Source)

There are two good things about it. Firstly, it is an XML database written in C and C++, not in Java. Secondly, it is a proper XML database, not putting XML into SQL columns.

The other notable XML database is the Java-based eXist which seems to be more well known, primarily among Java XML developers. eXist is more of a service, rather than something light to embed into applications. It also rumoured to be significantly slower than DB XML, but I have never used eXist so I can't show any benchmarks for that.

There are also a load of proprietary and half-finished XML databases we do not care about. Including the abandoned Java XML database called dbXML which has no relation to the Berkeley on but confuses everyone because the sourceforge page is often the first search engine result.

Install Berkeley DB XML - Windows

Go over to the Oracle/Berkeley DB XML homepage and grab the installer. I have not used it so I have no idea what happens, hopefully it is straightforward.

Install Berkeley DB XML - Posix platforms

DB XML works on all major posix compatible systems, including Linux, OS X, BSD, Solaris and so on. Installing it varies according to distribution. If your distribution has packaged it, then lucky you, you just install it through that. Of the two distributions I usually use as examples on this site, Gentoo Linux and Ubuntu Linux, the former has a DB XML package, the latter currently does not.

Install Berkeley DB XML - Gentoo

sudo emerge dbxml

The package is new, so if you are running stable, then the emerge command will moan and tell you that the package and some of the dependencies are not yet in stable. You will need to add these to /etc/portage/package.unmask, see Using Masked Packages in the Gentoo Handbook for more details.

Install Berkeley DB XML - Ubuntu

Hopefully, in the near future, you will be able to go:

sudo apt-get install dbxml python-dbxml

But we are not there yet. When we are there, the rest of this post will be irrelevant. Therefore this following part will date badly, I will try to remember to update it as events unfold, but if you are reading this paragraph in 2009 or later, it means I have forgotten and it might be worth checking other sources.

What follows shows how important packagers are. Almost any complex package will need to be optimised for that distribution, and normally all the work is done for us behind the scenes. The pointy-heads in the Mozilla corporation that didn't want Firefox to be patched downstream in the distributions are not living in the real world. But that is another story. Let's get going.

Dependencies on Ubuntu

First, we need to get the dependencies. We need Berkeley DB, xqilla and libxerces, the latter two are not all yet in the default Ubuntu repositories, but my mate txwikinger has packaged them for us in his private archive. You need to add these lines to the bottom of your /etc/apt/sources.list with a comment so you remember why you put the lines there:

# Deps for DBXML
deb http://ppa.launchpad.net/txwikinger/ubuntu hardy main
deb-src http://ppa.launchpad.net/txwikinger/ubuntu hardy main

Then run: sudo apt-get update

sudo apt-get install libdb4.6++ libxerces28 xqilla

sudo apt-get install libxerces28-dev libxqilla-dev libdb4.6++-dev

Working directory

We need to have a working directory, in my examples we will assume ~/Sandbox, but use where you like.

mkdir ~/Sandbox/

cd ~/Sandbox/

Go over to the Oracle/Berkeley DB XML homepage and grab the tarball and extract it into your ~/Sandbox directory, or you can just use the commands:

cd ~/Sandbox

wget http://download.oracle.com/berkeley-db/dbxml-2.4.13.tar.gz

tar -xvvzf dbxml-2.4.13.tar.gz

Compile DB XML

The tarball from Oracle contains a lot of dependencies which we have already installed. So ignore the 'buildall' instructions, as they compile all the dependencies which takes all day. You then have half a dozen or so packages that are in your main system folders but are not managed by Apt, this is not really the done thing.

Now because we are doing it the proper Unix/Ubuntu way rather than the Oracle big-tarball-of-mud approach, we want to use the shared library of xqilla that we installed earlier. There is a slight problem in the configure file which stops it from working. Open the following file in your text editor:

~/Sandbox/dbxml-2.4.13/dbxml/dist/configure

In line 4396, change .la to .so

So the line:

elif test `ls "$with_xqilla"/libxqilla*.la 2>/dev/null | wc -l` -gt 0 ; then

Becomes:

elif test `ls "$with_xqilla"/libxqilla*.so 2>/dev/null | wc -l` -gt 0 ; then

Now we can build DB XML

../dist/configure --with-berkeleydb=/usr/lib/ --with-xqilla=/usr/lib/ --with-xerces=/usr/

cd ~/Sandbox/dbxml-2.4.13/dbxml/build_unix

If that works without error, you can type:

make

sudo make install

Now if that works without error, you can try to run dbxml:

/usr/local/BerkeleyDBXML.2.4/bin

./dbxml

Type help to see the list of commands. Press Ctrl+D to quit when you have had enough.

Python Bindings on Ubuntu

So far so good, now we need the Python bindings:

cd ~/Sandbox/dbxml-2.4.13/dbxml/src/python/

Now we have to do a little more patching to let the Python bindings know where dbxml is installed.

Open setup.py in your text editor We are going to add three lines, in each case make sure the indentation lines up with the line above it.

After line 18, add the following line:

db_xml_home = '/usr/local/BerkeleyDBXML.2.4'

After what is now line 65, add the following line:

INCLUDES.append(os.path.join(db_xml_home, "include"))

After what is now line 69, add the following line:

os.path.join(db_xml_home, "lib"),

Now in dbxml-2.4.13, there is another little bug we need to deal with first.

Open the following file in your text editor:

~/Sandbox/dbxml-2.4.13/dbxml/dist/swig/dbxml_python.i

Go to line 533, and change 'Vaue' to 'Value'.

So change:

class XmlInvalidVaue(XmlException):

To:

class XmlInvalidValue(XmlException):

Now this file eas used to automatically generate the Python bindings, so the generated file needs to be fixed too. The dbxml developers need to generate them, but until they do, we can just fix it ourselves. Open the following file in your text editor:

~/Sandbox/dbxml-2.4.13/dbxml/src/python/dbxml.py

Go to line 121, as before change:

class XmlInvalidVaue(XmlException):

To

class XmlInvalidVaue(XmlException):

Now we can finally install the bindings:

python setup.py build

sudo python setup.py install

Now lets test it, which involves, yes you guessed it, more patches:

cd ~/Sandbox/dbxml-2.4.13/dbxml/examples/python/

Now edit examples.py using your text editor. Remove the 3 from line 9. So from:

from bsddb3.db import *

To:

from bsddb.db import *

Now you can go:

python examples.py 7

Which should give you:

Running example 7.
book1 = <book><title>Knowledge Discovery in Databases.</title></book>

If you have that then everything should be in working order. This has been a very long post so I will break here and come back to DB XML in Python another day.

Discuss this post - Leave a comment

August 14, 2008 11:12 PM :: West Midlands, England  

Brian Carper

Westinghouse BBB rating: CC and falling

Thus continues the ongoing saga of Westinghouse, their low-quality electronics, and their incompetent or evil (I can't decide which) customer service department, who likes to take your broken crap and never bother sending you a replacement.

I filed a complaint with the Better Business Bureau in California, and Westinghouse never bothered responding to my complaint. The sort-of-good news is that Westinghouse's AAA rating has dropped to CC. There are 58 unanswered complaints listed on that site. I hope their rating keeps dropping until it lands squarely in the mud where it belongs.

Not that the BBB rating is going to do much good in the bigger picture, and it's not going to return the money I wasted on the monitor I'll probably never see again, but every bit of new business I can prevent that company from attaining is another victory in my mind. I've already cost the company far more money in new business than it would've cost them to just send me a fixed monitor to begin with. Plenty of people have let me know they aren't going to buy Westinghouse brand from now on. For every person that bothers leaving me a message on this website to that effect, there are likely many more silently avoiding the company, which is good.

I think another good idea would be for people to file some complaints with the California Attorney General's Office. Oh how I wish it was financially feasible for me to fly to California for a week and sue them myself. But maybe the AG can take action if enough people make a stink.

I'm going to be writing a letter to Westinghouse's corporate office, and I'm going to post their reply or lack thereof. I have little hope that I'll ever hear a response.

I've been getting a lot of people leaving comments describing their dealings with Westinghouse, and their encounters with Westinghouse's policy of making crappy broken electronics, then giving you the cold shoulder when you mail their crap back to them and try to get it fixed and returned. I feel bad (and angry) for everyone in the same boat as me, trying to get the people at this shyster company to do their damned jobs, so I'm not going to keep quiet about this.

(Previous posts: The beginning, Update 1, Update 2, Update 3, Update 4, Update 5, Update 6.)

August 14, 2008 05:07 PM :: Pennsylvania, USA  

Jason Jones

Life Ramblings / New Site Design

I haven't written in awhile, so I thought I'd just kind of ramble and see where my mind goes.

Lately, I've been working on a new layout for ILoveMyJournal, as well as quite a few structural changes.  The desire to make this site better came when my little bro. wrote a pretty personal and inspiring entry, and about the same time, my posted wedding video got quite a few comments.  I'm not sure if that makes any sense at all, but I don't really care right now.

I just want this site to be the best it can be, and over the year its been up (has it already been a year?), I've noticed quite a few areas where it could use a bit of work.

Here's a quick screenshot of the new site's main page.  The design is quite drastically different, and there are a load of new features which the current home-page doesn't have.



Some of the obvious features added are the 5-star rating system, the home-page search (which returns results in 3 areas immediately available on the home page: newest posts, highest rated posts, and most viewed posts), home-page pagination, which allows you to view all of the public posts page-by-page, and a vertical tag-cloud.  I've never found tag clouds to be easy to read, so I did the whole "getting bigger with more posts" thing, but kept it vertical.  I hope people like it.

I've also re-done the "write" page, making it a bit easier to write your entry...  Here's a shot of me writing this post:



So, there ya have it.  I'm working on this site like crazy (between 6 - 10 hours per day), and I've almost got it functional.  There's so much I want to do with it, it's frustrating to have these cool features and enhancements and not be able to put it live yet.  Ah well..  What do they always say about patience? *grin*

Ummm....  Work is going really good, even though I got wrote up for hardly working.  hehe...  I talked with my boss and we've got a plan going that'll keep me in my seat more.  I just like living life a bit too much, and it's hard to live it behind a computer 8 hours a day.  Ah well..  I found out my boss really does appreciate my work, though, and that's good.

My kids are healthy and happy.  My wife is getting more and more beautiful, and my Mustang GT is still the shiz-nigget.

So, anyway...  Keep the faith, ya'll, and let me know what you think of the screenshots.  Personally, I can't wait to get it all live.

Take care.

August 14, 2008 04:46 PM :: Utah, USA  

Iain Buchanan

nVidia xinerama on a Dell M6300

I wrote recently about my efforts to get two screens going, with the primary screen not coming off the primary video output. I used a neat trick, the option:
Option         "UseDisplayDevice" "DFP-0"
The downside with that method of separate X screens, is that you can't drag a window from one to the other.

Now I decided I should try using xinerama. The use should be almost identical, with the advantage that I can drag windows from one screen to the other. There are other subtle advantages such as better panel integration, and general WM goodness.

1. Firstly, compile everything with xinerama support.

If you use a binary distribution, this is probably done for you. For gentoo, add this the /etc/make.conf:
USE="... xinerama"
I prefer this to using /etc/portage/package.use in this case, because you want to catch all future installations that can support this USE flag.

Now, recompile everything that can use the USE flag:
# emerge -vauDN world
(v)erbose, (a)sk, (u)pdate, (D)eep, (N)ewUSE
again, binary distro's ignore this step!

It shouldn't be necessary to include nvidia-drivers in the recompile, but you will need the installed.

2. edit xorg.conf

You must start with a working xorg.conf, and you must have only one display set up or this step will fail:

# nvidia-xconfig -c /etc/X11/xorg.conf-20080728 -o /etc/X11/xorg.conf --twinview --dynamic-twinview --twinview-orientation=LeftOf --twinview-xinerama-info-order=DFP-2,DFP-0 --constant-dpi --use-edid --use-edid-dpi --damage-events --render-accel

The options are:
  • -c uses a specified input file. I do this so I can start from the same point each time, rather than a constantly changing xorg.conf file
  • -o writes to this file
  • --twinview enables twinview
  • --dynamic-twinview enables dynamically change twinview settings
  • --twinview-orientation=LeftOf sets the second monitor to be left of the primary
  • --twinview-xinerama-info-order=DFP-2,DFP-0 says that DFP-2 (DVI) is the primary display
  • --constant-dpi --use-edid --use-edid-dpi --damage-events --render-accel are other settings I play with to fine tune performance.

3. Restart X

You probably know how to do this. Logging off usually does the trick.

If everything worked you should have:
  • log in screen on one display only
  • desktop extended to second display
  • windows open completely on one display and not in the middle
  • windows snap to the edge of one display
  • windows can be dragged to the second display
  • both displays can be treated like one large screen (my geometry is now 3840x1200!)

August 14, 2008 02:38 AM :: Australia  

August 13, 2008

Dirk R. Gently

Output Color on Bash Scripts - Advanced


In my previous blog I talked about basic bash script colored output using the tput command. The tput command is great for basic coloring (providing seven colors to choose from) but falls short if additional coloring is required. Here we can use hardcoded ANSI coloring. Warning - not all terminals support ANSI (Most do though).

ANSI color coding is in this form:

/033[38;5;160m

The ANSI sequence means: {ESC}[{attr};{fg};{bg}m

{ESC} or /033 represents the ANSI escape-sequence. The escape is not the top left key but a ANSI designation a code is about to be input. {attr} represents the outputs attributes (properties such as blinking and bold text), {fg} is the foreground color, {bg} is the background color, m means the sequence ends.

An example:

echo -e "My favorite color is /033[38;5;148mYellow-Green/033[39m"

The variable -e is required here because echo doesn’t normally interpret backslashes as escape-sequences. Also 033[39m tells bash to end the coloring.

echo -e "My favorite color is /033[38;5;148mYellow-Green/033[39m and /033[38;5;128mViolet/033[39m"

Freexx has nice converter that converts hexidecimal code to the corresponding ANSI foreground escape sequence. It can be found halfway down the page called xterm256-conv2.tar.bz2.

Install and:

echo d3d7cf | conv-rgb2xterm

I also use a nice script called colortest that listed xterms 256 colors in hexidecimal format.

colortest -w

References:

August 13, 2008 09:09 PM :: WI, USA  

Johannes Gilger

PuTTYcyg just replaced rxvt for me

putty_icon.gifI like PuTTY, I’ve been using it for years. In my last post I talked about Cygwin and it’s rxvt (which already works pretty good). I also joked about using PuTTY to ssh into localhost.
Well, for the people who want to use PuTTY for their local Cygwin there is a solution: PuTTYcyg. PuTTYcyg is just a patched version of PuTTY which adds “cygterm” as a connection-type. If you wan’t to use it with a desktop/tray shortcut you have to call putty.exe -cygterm - where putty.exe is of course the patched PuTTYcyg version.
The reason for me to use PuTTYcyg instead of rxvt is the Full-Screen-mode of PuTTY. Besides that I guess there are other advantages over rxvt (like being able to change font and terminal-emulation-options for the running session). Oh, and don’t fear, of course it supports 256 colors just fine ;)

August 13, 2008 02:15 PM :: Germany  

August 12, 2008

Leif Biberg Kristensen

DDL cleanup

I’ve removed two attributes from the schema. One is the living flag from the persons table, - it was really legacy data from TMG, and I have never used it much. YMMV.

The other one is the relation_type in the relations table. As it actually is nothing but a duplication of the parent’s gender attribute from persons, it’s an unnecessary complication of the model. The reason why I put it there in the first place, is as stated in the “Into the Blue” article, that I wanted to ensure that only one parent of each gender would be entered for any person. There are other ways to achieve this, and I’ll probably do roughly as suggested by Greg S. Mullane years ago, when I first pondered the problem. I’m still a little shaky about triggers, though. As long as I’m entering and editing relations from the application interface, where the link for adding a parent only will show up if there is no parent connected already, there’s no great danger of messing it up. So, I’m feeling quite comfortable without this constraint for now.

In order to remove the relation type, I had to rewrite a very essential piece of code, the get_parent() function. Here’s the old version:

CREATE OR REPLACE FUNCTION get_parent(INTEGER,INTEGER) RETURNS INTEGER AS $$
DECLARE
    person ALIAS FOR $1;    -- person ID
    rel_type ALIAS FOR $2;  -- gender code (1=male, 2=female)
    par INTEGER;            -- person ID of parent, returned by func
BEGIN
    SELECT parent_fk INTO par FROM relations
        WHERE child_fk = person AND relation_type = rel_type;
    RETURN COALESCE(par,0); -- will return parent ID if it exists, 0 otherwise
END;
$$ LANGUAGE plpgsql STABLE;

The new version must of course query the parent’s persons.gender attribute rather than the relations.relation_type:

CREATE OR REPLACE FUNCTION get_parent(INTEGER,INTEGER) RETURNS INTEGER AS $$
SELECT COALESCE(
    (SELECT parent_fk FROM relations r, persons p
        WHERE r.child_fk = $1
            AND r.parent_fk = p.person_id
            AND p.gender = $2), 0)
$$ LANGUAGE sql STABLE;

Note that I’ve rewritten the function in SQL rather than in PlpgSQL.

Now for some real testing of the two queries:

pgslekt=> explain analyze select parent_fk from relations where child_fk=1 and relation_type=2;
                                                      QUERY PLAN

----------------------------------------------------------------------------------------------------------------------
 Index Scan using child_key on relations  (cost=0.00..10.92 rows=1 width=4) (actual time=0.018..0.020 rows=1 loops=1)
   Index Cond: (child_fk = 1)
   Filter: (relation_type = 2)
 Total runtime: 0.047 ms
(4 rows)

pgslekt=> explain analyze select parent_fk from relations r, persons p where r.child_fk=1 and p.gender=2 and p.person_id=r.parent_fk;
                                                          QUERY PLAN

------------------------------------------------------------------------------------------------------------------------------
 Nested Loop  (cost=0.00..27.48 rows=1 width=4) (actual time=0.049..0.053 rows=1 loops=1)
   ->  Index Scan using child_key on relations r  (cost=0.00..10.91 rows=2 width=4) (actual time=0.018..0.022 rows=2 loops=1)
         Index Cond: (child_fk = 1)
   ->  Index Scan using persons_pkey on persons p  (cost=0.00..8.27 rows=1 width=4) (actual time=0.011..0.012 rows=0 loops=2)
         Index Cond: (p.person_id = r.parent_fk)
         Filter: (p.gender = 2)
 Total runtime: 0.127 ms
(7 rows)

The first query runs in 0.047 ms, the second one in 0.127 ms. While the latter is three times slower, we’re talking fractions of milliseconds here. No big deal in a single-user application.

August 12, 2008 07:01 PM :: Norway  

Ow Mun Heng

python-2.4 to python 2.5 upgrade hell

It's been a while since the last post.

Not much been happening except that I'm missing out on life due to work commitments which seriously sucks.

In any case, been battling with the python upgrade on my gentoo box at home.

I've been having undefined symbol issues with pygtk and pygobject all through last week and I just solved my issue like 10 min ago and thus I can go to sleep already.

Main issue is the borking when I was compiling a python app which needed gtk support. Only thing, it, it also needed "threads" support which, for some reason, is not default turned on in Python2.5 but is on python2.4!

Hence, I spent the last week pulling out hairs trying all different permutations of WHY did it USED to work and doesn't now.

it ended up as a simple USE flag which was not checked during the ebuild checks.

Why.. Oh.. Why...

August 12, 2008 03:11 PM

Jürgen Geuter

ReadItLater Firefox Extension

You all know the problem: You find an interesting article on the web but you don't have the time to read it now. So you bookmark it and often forget it instead of coming back and reading it. Crappy situation.

The Readitlater Firefox Extension comes to the rescue, you get a new icon in your address bar that looks like this:

Clicking that icon will add that page to your "read later" list. You can also rightclick links and send them to the "read later" list.

The extension can upload your list to a central place so you can use it from more than one browser, you can get an RSS feed of things you need to read and all that jazz but what it comes down to is just a very convenient way to keep track of things you want to read later. Check it out, it's available here, you can also check out the demo.

August 12, 2008 10:36 AM :: Germany  

Martin Matusiak

long passwords are evil

I’m writing this partly in response to Jürgen’s post a week or so back about passwords. Of course, he’s not the only one to advocate long passwords, a lot of people are doing that these days in the name of security. Today’s sad reality is that if your password is not “test” or “password” you are more secure than most people.

I do think, however, that any idea for improvement should stand to be evaluated on usability. After all, my first loyalty is to the user in me. Failing to do that produces wide adoption of bad ideas like captchas that are directly hostile to users. (Incidentally, that’s why so many people who build systems for others build them badly. The implication of using it every day never takes a foothold.)

Short passwords have too little entropy, therefore they are easy to break.  Granted. So the response is “use long passwords”, or better yet “not passwords, pass phrases”. Such as oh bugger, my cat has cancer. With or without the spaces and punctuation it makes a perfectly acceptable password in terms of length. But tell me now who is willing to actually type these monstrosities?

The evil of password typing is reduced by our methods to avoid typing them all the time. Use public keys with ssh, never type the password again. Save passwords in the browser, avoid typing those. It’s a fabulous usability gimmick.

But short passwords, bad for security, are great for another closely related purpose: being able to actually type them in. If you have a short password you don’t need much practice to be able to type it. It’s a sort of sweet spot between usability and security, more secure than nothing, not too painful to type if you have to. My password input rate might be something like 98%. I rarely fail to log in. But with pass phrases of 29 characters like the one above, how confident would you be? You don’t see what you’re typing either, just echo characters at best. I expect the likelihood of typing it correctly falls dramatically, maybe to as low as 75-80% for the average user, in the average point of his learning curve to learn typing it (does not apply to hackers with stellar typing skills yadayadayada). If you’re doing something once, 80% is pretty good odds. But if you’re doing it everyday, it’s no longer odds, it’s a statistical average. Imagine if those were your parking odds. One in five times you fail to maneuver through the opening of your garage, I don’t think you’d be happy.

I tested myself on cancer cat just now, 6/10. On a sentence I’ve never typed before. And that’s while seeing the characters on the screen.

And then there’s the chance that you’ll forget it, or remember it wrong, switch a character in your mind, use the wrong case. It’s hard to estimate how likely that is, but with long passwords it seems rather likely. Inputing passwords is not an approximation, it has to be exact. And it’s not just one of those phrases you have to remember *exactly*, you need one for every distinct password you keep.

Security is a social problem, not a technical one. If you force people to use long passwords they struggle to input (for christ’s sake, they *already* use post-it’s on the monitor), we will just embrace ways of avoiding passwords all the more. Passwordless ssh is great, but if I’m using every trick in the book to avoid typing my long password, I haven’t had enough practice typing it when I actually have to type it.

That is, if I even remember it correctly. And I somehow doubt sysadmins will give you more tries to type a long password than they currently give you, 3 tries or whatever it is. And then you’re locked out.

It’s the perfect anti-security. The bad guys have a shot at my account (but they have to be pretty clever), but I myself am locked out.

August 12, 2008 08:16 AM :: Utrecht, Netherlands  

August 11, 2008

Dirk R. Gently

Output color on bash scripts


Using Linux for awhile users find it’s fairly easy to learn basic bash scripting to perform multiple commands. If you’d like to add a little bing to your scripts you can color command output in a fairly straight forward way by using the tput command.

Now, what I like to do is define the colors the tput can produce at the beginning of the bash script:

TXT_BLD=$(tput bold)
TXT_RED=$(tput setaf 1)
TXT_GREEN=$(tput setaf 2)
TXT_YLW=$(tput setaf 3)
TXT_BLUE=$(tput setaf 4)
TXT_PURPLE=$(tput setaf 5)
TXT_CYAN=$(tput setaf 6)
TXT_WHITE=$(tput setaf 7)
TXT_RESET=$(tput sgr0)

A command bracket follow by the definition can now be used. For example:

echo "A great color is ${TXT_YLW}yellow${TXT_RESET}."

Here’s my snapshot utility which provides coloroutput on how to use it.

#!/bin/bash
# snapshot - take a screenshot of a selected part of the screen.

SCREENNAME=$@

TXT_BLD=$(tput bold)
TXT_RED=$(tput setaf 1)
TXT_GREEN=$(tput setaf 2)
TXT_YLW=$(tput setaf 3)
TXT_BLUE=$(tput setaf 4)
TXT_PURPLE=$(tput setaf 5)
TXT_CYAN=$(tput setaf 6)
TXT_WHITE=$(tput setaf 7)
TXT_RESET=$(tput sgr0)

# Utililization
if [[ -z $SCREENNAME ]]; then
    echo " ${TXT_BLD}${TXT_GREEN}*${TXT_RESET} ${TXT_YLW}snapshot ${TXT_RESET} to take high quality JPEG snapshot."
    echo " ${TXT_BLD}${TXT_GREEN}*${TXT_RESET} snapshot is saved to current folder, extension automatically appended."
    exit;
fi

# Take Snapshot (quality 95 is best quality and compression).
import -quality 95 "$SCREENNAME".jpg

In another blog, I’ll write about using additional colors for bash scripting output.

August 11, 2008 10:53 PM :: WI, USA  

Johannes Gilger

mutt 1.5.18, msmtp 1.4.16 and screen 4.0.2 with Cygwin

mutt 1.5.18 works fine with Cygwin (as I just discovered). Building it from source I used

./configure --prefix=$HOME/local/stow/mutt --enable-imap --with-homespool --with-ssl=/usr --enable-hcache --enable-locales-fix

This is assuming you installed the openssl-libs and openssl-devel packages (those can be installed using Cygwins own installer .exe). For header-caching (you really want it when using IMAP) you’re also gonna need some version of berkeley-db, which can also be installed using the Cygwin setup.exe.

msmtp (an SMTP-client which can be used in conjunction with mutt when sending mails over a server which uses TLS/SSL) works equally fine. With version 1.4.16 just do

./configure --prefix=$HOME/local/stow/msmtp --with-libgnutls-prefix=/usr

GNU screen is available as a Cygwin-package (4.0.3) but if, like me, you want 256 colors (and with a spiffy vim-theme you do ;) you have to fall back on building it yourself. You have to apply two patches though: Patch 1 (found here) and Patch 2 (found here). After that

./configure --prefix=$HOME/local/stow/screen --enable-colors256

should do the trick. To actually get 256 colors working use this in your .screenrc:

# terminfo and termcap for nice 256 color terminal
# allow bold colors - necessary for some reason
attrcolor b ".I"
# tell screen how to set colors. AB = background, AF=foreground
termcapinfo rxvt 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
# erase background with current bg color
defbce "on"

Careful! If your TERM (the one you start screen with) is not rxvt then you need to adjust that. To see if 256 colors work I use this script (found here).

August 11, 2008 05:26 PM :: Germany  

Jürgen Geuter

Is Mono evil?

A few years ago Miguel de Icaza, who had started the GNOME project before,
announced his intention to create a Linux version of Microsoft's .net
runtime that would allow running Programs build for the .net platform to
run on Linux without emulation or virtualized Microsoft operating systems.

While C#, the language for .net back then, was an open ISO standard, the .net runtime itself, the class library, basically all the rest that makes up .net includes patented technology and Microsoft's intellectual property which is not free.

De Icaza's project which was called Mono found itself confronted with a lot of criticism: Many vocal opponents of his project claimed that implementing the .net stack for Linux was just a way to cement Microsoft's hegemony on the desktop, it was dangerous for Linux and free software because it would open both up for legal attacks by Microsoft's legal department. That criticism reached its ultimate height when some the GNOME project added some software to its extra stack that relied on Mono (the core of GNOME would always run without Mono installed but some software that generated quite some following like Tomboy, F-Spot and Banshee that provided additional functionality rely on the evil trojan horse than many people thought Mono to be).

Novell, the company pushing Mono the most due to its investment into "business Linux", later even signed a "do not sue us" pact with Microsoft that would protect their SuSE customers from Microsoft which later led to some changes in the newer GPL version trying to make that kind of deal, a deal that would pick out one from the set of distributors and give it a blessing while still threatening the rest, impossible.

Now after all of that has had a few years to cool down, with Mono still not up where Microsoft's implementation is (but getting better every day), with many distributions shipping the Mono-based GNOME extensions by default where do we stand? Is Mono evil? Is it bad for the free desktop?

The legal question is still somewhat lingering: While the C# language is obviously not a problem there still is the question about whether implementing the .net framework is legal. The mono runtime itself can run a lot of .net code but it's not based on any code by Microsoft, it's a clean-room implementation, but the class library itself might be problematic. I'm no lawyer but I can understand why that makes people uncomfortable, though on the other hand, considering how software patents are handled in the US, everybody can pretty much sue everybody else into the next millennium for implementing the double-click or something similarly retarded. There is a valid legal concern but that one's there as soon as you touch your text editor.

Novell's actions still suck monkey butt. It was a bad move to sign some patent deal with Microsoft and it made Novell look really bad in the free software community. Even if we assume they meant to do good it was still a rookie mistake and retarded. But, even though many people working on or with Mono are paid by Novell, Mono is not Novell so while one supporter of the technology did something bad those actions shouldn't define one's view on the technology.

Let's look at some of the good things Mono brought us.

We have gained great software like GNOME Do, Banshee, Tomboy or F-Spot, software that enhances our desktops, that makes our work easier and that sometimes even attracts new users.

Some universities and schools are starting to teach C#/.net in their programming classes nowadays often replacing Sun's Java technology, which means that there's a bunch of new people knowing a language they can use to write software for Linux. Of course they could have done that in Java, but who really ever wrote desktop applications for Linux in Java when there was no working free Java runtime for many, many platforms? C# is not better than Java, it's pretty much the same shit (and it really smells) but it has gained some traction on the Linux desktop which is more than Java ever managed (and more than even an open Java will ever manage). Mono lowers the barrier of entry to coding for Linux and that is good.

Developers writing code on Linux have always had many ways to write platform independent code (I personally use Python and GTK+ for example) and with Mono there is another way that might be more accepted by customers (because they might already have the necessary dependencies installed on their machines), this is good for our developers cause they are not forced to wander of to Windows-Land to write software that their customers are willing to pay for. Also we allow people deeply invested into the Linux desktop to learn new skills while contributing to Linux that will help them finding Jobs later. Many students like working on stuff in Linux and if they can add a GNOME Do plugin while learning .net we all win: The free software desktop gains new functionality and the student or learner gains a new skill that looks good on his resume.

All in all I think that Mono is good for the desktop. I wouldn't include Mono as hard dependency into GNOME due to the legal problems, but offering it as option to users is a great benefit. The legal problems shouldn't be ignored and if possible be solved, but apart from that Mono is good for us. A better desktop motivates new users, motivates developers and makes the desktop more attractive for external entities to get involved into it. We shouldn't implement everything in Mono but if someone wants to write his software based on Mono we shouldn't talk bad about him cause of that (sure, choosing a language as retarded as C# or Java says something about a developer's state of mind and we can and probably should make fun of that guy for it, but he's not sacrificing babies to Satan).

A lot of the criticism of Mono looks very simplistic, not based on thought and reason but based on "we hate Microsoft they have to die". That attitude can sometimes be fun and all but it's not helping to improve anything. It stuns us, it wastes energy in users and developers and it makes us look really bad. When criticising, invest some thought first.

August 11, 2008 10:50 AM :: Germany  

Christoph Bauer

The OQO odyssey - Part 3

This article is part of the OQO odyssey series - You can find the previous posts here and here.

In general, installing linux shouldn’t be a great problem - I guess those were my words right before powering up the umpc again for starting the bootstrap process as I used to do. But I have missed several things: Battery and heat. The case of the oqo acts as a passive cooling element and got that hot I wouldn’t dare to carry it with me in a bag. As I said the oqo’s a hot thing, I wasn’t thinking of that.

Back to the topic. After trying to build the binutils package the battery was drained again and so I had to change my plans: building the packages in a chroot on my laptop. And so I did - unpacking stage 1, mounting portage, sys, proc and doing the bootstrap which didn’t take that long. Regarding the oqo, I just leave things as they are right now, as the partition scheme can be reused - even portage. You never know.

For keeping yourself busy while bootstrapping and emerging, I recommend a good old classical game like Rock ‘n Roll Racing on the SNES console, reading a book, housework - just something to keep yourself busy. Yeah - even browsing my blog will do fine as the process might take a while.

After the bootstrap process, emerge -e system builds 190 packets which means you want to do something else in the meanwhile. Housework and reading kept me busy - and hacking some configuration files. It won’t hurt, if they are in a good shape.

I haven’t had any further highlights at the installation worth being mentioned. Just one thing: The GRUB Setup should be done on the oqo for having correct data at the boot record. That’s all folks!


Copyright © 2007
Please note that this feed is for private use only. All other usage, including the distribution or reproduction of multiple copies, performance or otherwise use in a public way of the images or text require the authorization of the author.
(digitalfingerprint: 0f46ca51d0fa4e6588e24f0bf2b80fed)

August 11, 2008 06:37 AM :: Vorarlberg, Austria  

August 10, 2008

Martin Matusiak

easy peasy full system backup

You know how when someone accidentally deletes their files or their hard drive crashes or some other apocalyptic event occurs, the first thing people ask is “where is your backup”? Of course, we’ve all seen it (*ahem* been there :/ ). It’s a bit unintuitive, because backups have no equivalent in the real world. If you drive your car into a lake, there’s no way to get it back. But making backups is the single best way to prevent losing your stuff. So do it!

Don’t backup “my files”

But don’t just backup “my documents, my pictures, my whatever”. If you computer crashes and you have a backup of “my files”, then sure, it’s not a total loss. It’s better than nothing. But it’s not what you actually need. You need the whole thing

This “my files” nonsense is born out of the fact that the delightful company that produced your operating system doesn’t want you to be able to make a backup of it. Because if you did, you could make trivial copies of the operating system, and they don’t like that idea. Have you ever asked yourself why in 30 years, through all manner of viruses, blue screens of death and hardware crashes Microsoft has never given you or sold you a full system backup program? It’s not because they never thought of it. (Or because no one asked for it).

Making full backups is easy

If you’ve ever installed Gentoo manually (ie. not with one of the automated installers)… yes, the demographic for this one is not immense. But then that’s why we’re here, to spread the happy message! :happy: Anyway, if you have, then you know immensely easy (this is astonishing especially if you have a Windows background) it is to make a full system backup. In the course of a Gentoo install (and yes, I’m about to reveal the big secret here…*drumroll*), you boot from the livecd, you mount your root partition, you download a tar of a minimal Gentoo filesystem that has your basic /bin/ls and so on, and then you just…. untar it. That’s it. No magic, no voodoo, no secret foobared locations on the filesystem that can’t be written to, just extract the archive and you’re done!

To put it bluntly, this is all you have to do:

tar zcvf backup.tar.gz /

And to restore the backup:

tar zxpvf backup.tar.gz -C /mnt/root_partition

Put that in perspective to the Windows world where a whole industry has sprung up to solve problems that Microsoft deliberately introduced with their *ahem* novel engineering. Idiotic programs like Norton Ghost that you have to get your hands on just to do the same simple thing that you can do with tar on a decent operating system.

Making it more convenient

Granted, you could just use the above tar command, but you may want something a little more convenient. For starters, you may want to skip some files on your file system. The method I use is inspired by a script posted on the gentoo forums a long time ago. I used that script for years without really understanding it, but a while back I decided to rewrite it to suit me better.

Besides just tarring the files it also writes a log file that you can grep to see if some particular file of interest is in the backup, it timestamps the backup with the current date/time and it keeps track of how many backups you want to keep.

Backups are made in a special backup_dir location. This directory is supposed to hold lists of files (recipes, if you like) you want to backup. For example, a simple recipe could be called full.lst:

/
--exclude=/backup/*.tgz*
--exclude=/proc/*
--exclude=/sys/*
--exclude=/tmp/*
--one-file-system

Download this code: full.lst

The syntax for the file is that of tar, and it’s a list of things to backup. / means the full file system will be included. But certain directories are excluded, /backup because we don’t want to include our old backup files in new backups, /proc and /sys because they are virtual file systems and don’t contain “real” files, and we don’t care about /tmp. Finally, we say --one-file-system, which prevents mounted disks, cds and things like that to be included.

And here is the script that makes this possible. Run it, it will produce a backup file that is compressed. Try to get it below 4.3gb and write it on a dvd+rw, now you have a backup system. :party:

#!/bin/bash
#
# Author: Martin Matusiak <numerodix@gmail.com>
# Licensed under the GNU Public License, version 3.
 
backup_dir=/backup
num_backups=1
 
 
verbose="$@"
lists=$backup_dir/*.lst
ext=tgz
date_params="%Y-%m-%d-%H%M"
nice_val="nice -n20"
 
# colors
wh="\\e[1;37m"
pl="\\e[m"
ye="\\e[1;33m"
cy="\\e[1;36m"
re="\\e[1;31m"
 
if [[ "$verbose" && "$verbose" != "-v" ]]; then
	echo "Usage:  $0 [-v]"
	exit 1
fi
 
if [ ! -d $backup_dir ]; then
	echo -e "${re}Backup dir $backup_dir does not exist.${pl}"; exit 1
fi
 
 
for list in $(ls $lists); do
	name=$(basename $list .lst)
	file_root=$backup_dir/$name.$(date +$date_params)

	stdout="1> /dev/null"
	stderr="2> $file_root.$ext.err"
	if [ "$verbose" ]; then
		stdout=""
	fi
 
	cmd="cat $list | $nice_val xargs tar zlcfv \\
		$file_root.$ext $stderr | tee $file_root.$ext.log $stdout"
 
	trap 'echo -e "${re}Received exit signal${pl}"; exit 1' INT TERM
 
	echo " * Running \\`$name\\` job..."
	if [ "$verbose" ]; then echo -e ${ye}$cmd${pl}; fi
	echo -en $cy; bash -c "$cmd" ; echo -en $pl
	status_code=$?
 
	if [ $status_code -gt 0 ]; then
		# Dump error log
		echo -en $re ; cat $file_root.$ext.err
		echo -en $pl ; echo "Tar exit code: $status_code"
	else
		# Kill error file
		rm $file_root.$ext.err
	fi
 
	# Evict old backups we don't want to keep
	num=$num_backups
	for evict in $(ls -t $backup_dir/$name.*.$ext); do
		if [ $num -le 0 ]; then
			rm -f "$evict"
		else
			num=$(($num-1))
		fi
	done
 
	# Report number of files in backup
	echo -n "$(wc -l < $file_root.$ext.log) files"
	echo ", $(ls -l $file_root.$ext | awk '{ print $5 }') bytes"
 
done

Download this code: backupsys

Worse is better

I’ve been thinking about how to handle backups most effectively, and it occurs to me that backups are a case of “worse is better”. The thing is you could make a really nice and easy application to make backups, but .tar.gz is still the optimal format to store them in. Wherever you are, you have tar and gzip available, and restoring backups usually happens under somewhat constricted conditions, sometimes without network access. So you want to avoid introducing dependencies, it’s safer to make do with the tools that are there already.

So it may not be the most elegant system, but it’s damn reliable.

Limitations (NEW)

Basically what I’m saying is that if you have no backup system then using tar is a pretty decent system. At the very least it has worked well for me the last 5 years. That isn’t to say you shouldn’t use a different method if you have different needs.

What about scaling? Well, I think this works quite well up to backups of say 4gb or so. My root partition is using 12gb of space at the moment. The purpose of this method is to back up your working system with all the configuration, applications and so on. Not to back up your mp3 collection, I would exclude that (not least because it’s pointless to compress mp3 files and other formats that already are well compressed).

What about the bootloader? (NEW)

Some people have asked how this backup method concerns the bootloader. The answer is that it does backup the files that belong to the bootloader (in /boot). It does not backup the actual boot sector of your hard drive (which isn’t represented as a file). So if, for example, you want to restore the backup on another computer (which I’ve done lots of times), you’ll still need to use grub/lilo to update the boot sector.

UPDATE: Apologies to the indignant Windows users. I pretty much wrote this in rant mode, without doing any research and what I wrote about Windows is just from my own experience. I would have been more thorough if I had known this would make the frontpage of digg and draw so many hits.

August 10, 2008 03:50 PM :: Utrecht, Netherlands  

Niel Anthony Acuna

laptop love

i got annoyed because i have four extra keys on my laptop keyboard that doesn’t
work as expected when i’m in gentoo. i’m callin’ them “compaq keys” coz i dont
know what they are called and its tiresome to know anyway…

in windows vista:

compaq key1: starts a program ‘dvdplay’ i think…
compaq key2: toggles the volume on or off
compaq key3: lowers the volume
compaw key4: does the opposite of key3

so i modified my keymap settings so that compaq keys2-4 are mapped to function keys
F13-F15 (i only have F1 to F12…)

-- .Xmodmap --
keycode 160 = F13
keycode 174 = F14
keycode 176 = F15

and my corresponding .fluxbox/keys file

 -- snip --
	
# windows key
Mod4 x  :maximize
Mod4 d  :ShowDesktop
Mod4 a :ExecCommand aterm +sb -tr -trsb -fg darkgray -fade 50%
Mod4 w :ExecCommand audacious
Mod4 e :ExecCommand /usr/bin/emelfm2
Mod4 b :ExecCommand /usr/bin/firefox
Mod4 y :ExecCommand /usr/bin/gaim
Mod4 m :ExecCommand /usr/bin/sylpheed
Mod4 v :ExecCommand /usr/bin/gvim
	
# laptop keymap
F13 :ExecCommand /bin/bash ~/.mykbd
F14 :ExecCommand /usr/bin/amixer sset PCM 5%-
F15 :ExecCommand /usr/bin/amixer sset PCM 5%+
	
 -- snip -- 

now, volume on/off toggling presented a mild challenge mainly because i didn’t
find implicit mute/unmute capability in amixer’s man page. so i did a little bash
mojo to get the desired functionality i want.

.mykdb

#!/bin/bash
SYSMIX=`which amixer`
GET_SPKR_STAT=$SYSMIX
STATUS=`$GET_SPKR_STAT get Speaker | grep -i off`
	
if [[ -z $STATUS ]]; then
        $SYSMIX sset Speaker off 1> /dev/null
else
        $SYSMIX sset Speaker on 100% 1> /dev/null
fi  

it took me a whole goddamn 10 minutes to figure out that [[ ]] needs a space
separator on its expression field.

lesson learned. seriously, don’t do bash, brainfuck, and perl when you are sleep
deprived.

August 10, 2008 04:26 AM :: Zamboanga, Philippines  

August 09, 2008

Jason Jones

Youth Conference 2008

I don't even know where to begin, to tell you the truth.  I'll do my best, but I've got a novel inside me for what happened yesterday.  All in all, it was quite simple, but at the same time it was probably the most profound thing which has happened to me in years...  and I have no idea how to portray it.

Let me begin with the following: Mohawk, Enemy Territory: Quake Wars, Guitar Hero, Toilet Papering, Settlers of Katan, Drums, Getting Toilet Papered, The Temple, Waterbaloons, Testimony, Sleep Deprivation, and the longest day of my life.

Yup, that ought to do it.  Now, as for putting all of that into some coherent journal entry...  Well..  Here goes.

First off, I got called to be the Young Men's 1st Counselor about 2 weeks ago, and at that time, I had received another calling precisely 1 week previous as a Sunday School teacher.  So, I was obviously confused as to what had just happened.  Being called for 1 week, and then getting released is quite unusual, so...  I went with the flow.

Since yesterday's Youth Conference, I have received quite the confirmation as to why our wonderful bishop was inspired to give me this calling.  Yeah, it kind of came as a quiet smack to the back of my head, actually.  But, let me figure out where I'm going to begin this entry.  How about at the beginning...

I had a tough time even wanting to be associated with Youth Conference, actually.  It seemed a week ago, like the whole thing was rushed together, poorly planned, and I was expected to do stuff for which I didn't even know the purpose.  I just wasn't catching the vision - mostly because I couldn't find anything being thrown at me.

Well.  Friday came and I was making last minute calls to people telling them that I couldn't get off work in time to do the things which had been asked of me, and trying to compensate.

I finally got off at 3:00pm, 3 hours after the shin-dig began.  The watersliding had ceased, the lunch which I was to supervise was being cleaned up, and I found myself just sort of walking around a bunch of 14 to 18 year olds who were happy, wet, and looking for rides to bring them home to change their clothes.  I ended up bringing two of em' home and back, and then we had some spiritual nourishment planned.  We learned about dating and righteous use of media.  The talks were good, but the momentum just hadn't shown up yet, at least for me.

After the instruction, the youth were going to babysit our kids as a service project, accompanied by a few leaders, as the adults (all in the ward were invited) went off to attend a session at the Provo Temple.

My wife arrived with Collin and Luci, and quite simply, chaos ensued soon thereafter.  Imagine, if you will, approximately 20 14 to 18 year olds running around with approximately 30 2 to 8 year olds, while 3 or 4 leaders tried to make some sort of organized effort to channel it all.

Needless to say, both my wife and I were concerned for our children's well being, but Sarah gathered herself and told me she had felt good about it earlier in the day.  At the last moment before time wouldn't permit us to leave, Collin got really interested in watching The Incredibles, and Luci was okay with following one of the leaders around.  We left in a hurry, and ended up attending a fantastic endowment session.

The endowment session was exactly what I needed to get into the mood of the Youth Conference happening around me.  ...  I love the Spirit.

When we arrived back at the Chapel, we found that the chaos had been lifted a bit, and more importantly, we found Luci and Collin as happy as kittens on yarn balls.  Collin was throwing a basketball around the gym, and Luci was helping him chase it.

We had some rootbeer floats with all the youth, as the adults came and went, recovering their children.

At this point, it was still somewhat unclear as to what was supposed to happen next.  I knew the young men were supposed to go home with their leaders, but I wasn't sure whether that was me, or someone else.  Well, that decision was made quite quickly after talking to one of the priests.

All I said was, "106 inch projected TV with Guitar Hero", and it really was truly amazing the speed with which all the young adult guys seemed to hover around me.  It took all of about 3 seconds for the word to spread, and a consensus reached:  They would all be staying with me.

In all, there were 7 of em'.  2 priests and 5 teachers -  Bryce, Zack, Ben, Jake, Josh, Martin, and Brigham.  Harmless enough, right?  Hehe...  I just gotta grin.

It took only a couple minutes after we arrived for some things to be established.  One, these were very respectable, albeit a bit rambunctious, young men - and Two, we were in for a very, very, very fun night.

When the guys got down into the basement, there were a few who started opening doors, and soon they saw my drumset.  Martin seemed like he was beside himself in heaven.  He started playing the drums a bit, and soon we were having a "drum-off" of sorts.  We both played and he was pretty good!  I was rusty as all get-out, but I played like a mad-man.  That lasted about 15 minutes.

Before long, Bryce was off hooking up his playstation 2 to my projector, and we got some guitar hero going.  I've never seen anyone play that game on Expert, but I've heard it's nuts.  Well, they were right.  It's nuts.

Two of the guys were competing and they played some song called "Frying Flames" or something like that and holy cow.  I have no idea how they did it, but they both got over 50%.  Not sure if that's respectable within the elite of Guitar Hero or not, but I was beyond impressed.  I couldn't stop laughing and clapping out of sheer amazement.

We then broke out the computers and laptops and got a game of Enemy Territory:Quake Wars going, and the guys were soon in love.  It was beautiful.  Martin could not get over the whole setup of my basement and he let me know it.  He asked when he could move in.  I was flattered.

Now, while all of this was going on, I had a plan being thrown around the corners of my brain.  While I was coming back from the Temple, I was hit with a stroke of genius, and soon found out that all the young women were staying at one house.  I made sure to find out which house it was.

Then, after guitar hero faded a bit, I got the young men together and told them of my evil plan to toilet paper the house where the young women were staying.  I've never seen more smiles in my life.  They were all in.

By this time it was only around 10:00pm, so we needed something else to do.  Zack noticed my mohawk and asked if I would give him one.  He didn't need to ask twice.

About 2 hours later, Bryce, Zack, and Brigham had some pretty awesome hair-do's.  Yup..  All three of em' got mohawks.  Talk about connection...    I hope the Bishop knew what he was getting himself into...

So, right around 1:00am this morning, Zack, Bryce, Brigham, Ben and I set out to do our dirty deed.  The rest of them were wholeheartedly engaged in playing Enemy Territory, and wouldn't be budged, so the rest of us all packed into the minivan and got ourselves 48 rolls of 2-ply.  We then headed over to the house...

Now, it's been a considerably long time since I've done anything like this, but when I did do it earlier in my life, I did it well.  So...  While we were driving over there, I explained to them the whole philosophy of "get in, get dirty, get out!"  We had to be silent and deadly fast.

When we pulled up, I noticed that across the street was a home of a family in our ward whom I know, so we pulled into his driveway, parked the car, and I told the guys to leave all the doors open, so we could run back and forth to get more rolls....

...and the party began...

There was a mid-sized tree (about 40 feet high) in their front yard which I started to pummel.  I must have got 15-20 rolls up in that tree alone.  All the while, the other guys were getting their car, their front door, their back yard, flowers, anything that would hold TP.

While doing this, we had to dodge one car, and someone thought they heard something, so we ran around the corner and hid.  This must have been about 20-30 minutes into the ordeal, and it was taking us way too long.  I told the guys to get the rest of the loot, spread it around as fast as they could, and get back to the van.

Three of the guys headed to the back yard with the last rolls, while Zack and I stayed in the front.

All the while we were doing this, I've gotta tell ya, I was high on adrenaline.  I was having the time of my life.  The weather was perfect, with a stiff breeze blowing from the east.  The toilet-paper-packed tree in the front had lines of TP blowing in the breeze.  They looked liked big streamers.  It was beautiful.

So, Zack and I were throwing out our last rolls on the porch about 5-6 feet from the front door, when I hear the door knob rattle, and then the door begin to open fast.

I didn't stick around to see what was going on.

By the time the door was half-way open, with girls screaming on the other side, I was half-way down the street with Zack in hot pursuit.  We hid behind a trailer about 30 feet out.  There were 4 girls who were screaming threats to their unidentified attackers.  That's when they saw where we were hiding, and 2 of them started after us.

We took off heading east and went across the street.  I soon noticed the girls had given up and weren't following us anymore, so I told Zack to double back in the field across the street from them, until we were right across from the toilet-paper-strewn house.  We could hear them, but we weren't close enough to tell what they were saying.

Now, keep in mind, that we had the van right across the street from the house down west by only about 20-30 feet.  All the girls would have to do is walk down the street a bit and they'd see the van with all the doors and windows wide open.  We would have no choice but to give ourselves in if they found it and decided to camp there.

At one point, Erin (one of the girls) walked probably 10 feet from the van, and I thought for sure she had seen it.  A quick prayer later, and I saw her walk back up to the house, apparently unaware of it.

Now, at this point, all I had to do was hop the 8-foot wood fence between me and the van, get in, and zoom away, and we would be home-free.  So, I told Zack to meet me at Bryce's house, just around the opposite corner while I hopped the fence, slowly closed the doors, started the van, and made my get away.

By this time, the girls had gone back inside and for some reason, didn't see, or pay attention to the van pulling out of the driveway.

I had gone about 30 feet when I saw Bryce in the road, and about 20 more when Brigham and Ben came running behind me.

We then went and picked up Zack, got some drinks at the local convenience store, and we were on our way.

Smack-talk was the name of the game from that point on.  We went back home and told the story to the other guys who were still engrossed in Quake Wars.

We ended up playing that as well as chatting off and on about life for the rest of the night.

Around 7:00am, I went upstairs and looked outside to breathe some fresh air and I noticed there were traces of toilet paper around my house.  They had got us back.  Well...  It was so weak that I cleaned 100% of it all up in about 10 minutes.  I debated on whether to tell the guys or not.  I decided not to.

We were supposed to be at the church at 8:00am Saturday morning, so when 7:30 came around, and 4 of us still had not gone to bed, I took a quick shower and tried to wake everyone else up who had crashed no less than an hour earlier.

We groggily packed everything up (and that's when I took the video posted above) and we were on our way.

At the church, we pulled into the parking lot, got out of our cars and were headed toward the doors to the church when the doors bursted open and about 15 girls ran at us armed with waterbaloons.  Needless to say, there was a war going on.

None of the guys got wet, however, because ... well...  we're just too awesome.  That didn't last too long, but it was fun dodging the waterbaloons as well as the girls throwing them.

Then breakfast came, and the guys started crashing.  They were sleeping on the stage and anywhere else they could lay themselves out.  We had eggs, bacon, sausage, and some wonderful blueberry cake stuff.

Then we heard some more good talks on living righteously, and then we had a testimony meeting.

The testimony meeting was awesome.  Bryce got up first and delivered a powerful testimony on the truthfulness of the church, and there was no mistaking the solidity of his words.  He knew it.  There were other testimonies born, and I bore mine as well.  The spirit was thick, and I was loving every minute of it.  I would have loved it more had most of my boys not been asleep in their chairs, but I guess that was to be expected after no sleep at all that night.

I got home around noon after dropping the boys off, and I slept from noon until 6:00pm.

This whole experience made me feel young again.  It was simply awesome.  I connected with all of the boys on at least some level, and got to know them quite well.  I'm looking very much forward to the blessings and experiences this calling will most assuredly bring.

I just hope I'm up to the task.  With God on my side, I just might be able to pull it off.

August 09, 2008 11:30 PM :: Utah, USA  

Zeth

Recurring monthly events in Python

I was working on something in one of my little Django sites and wondered how you make a recurring monthly event in Python? What I mean by recurring event is "every fourth Saturday" or "every first and second Wednesday" and so on.

I did not want to make a dependency on some huge calender server module like Calcore or Twisted's caldav. All I wanted was a function that accepts "every fourth Saturday" and returns me an actual date that I can use for scheduling things.

A quick google didn't come up with anything, so I decided to do it myself. Here are my first and second attempts. The first attempt just works it out mathematically, the second attempt uses a module from the Python standard library.

"""Helper for recurring date."""

DAYS = [
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday',
'Sunday',
]

from datetime import date

def eventdate(year, month, target_day, target_ordinal):
    """Convert a human event date to a real date.
    For example, 'the third Thursday of the month'
    the target_ordinal is 3 and the target_day is 'Thursday'.
    """

    day = DAYS.index(target_day.title())

    match = 0
    for i in range(1, 32):
        try:
            if date(year, month, i).weekday() == day:
                match += 1
                if match == target_ordinal:
                    return date(year, month, i)

        except ValueError:
            return None

def main():
    """Example when called directly."""
    today = date.today()
    if today.month == 12:
        year = today.year + 1
        month = 1
    else:
        year = today.year
        month = today.month + 1
    print "Next Month's Linux group is", eventdate(year, month, 'Thursday', 3)
    print "Next Month's Python group is", eventdate(year, month, 'Saturday', 4)

# start the ball rolling
if __name__ == "__main__":
    main()

That worked quite fine, but like all good Python programmers, I want to be as efficient (/lazy) as possible, surely the standard library can do this for me? Well I found that the calendar module will return a matrix of dates organised by week and day. This works as follows:

"""Event helpers."""

def eventdate(year, month, target_day, target_ordinal):
    """Convert a human event date to a real date.
    For example, 'the third Thursday of the month'
    the target_ordinal is 3 and the target_day is 'Thursday'.
    """

    import calendar
    day = getattr(calendar, target_day.upper())
    cal = calendar.Calendar()
    return cal.monthdatescalendar(year, month)[target_ordinal - 1][day]

def main():
    """Example when called directly."""
    from datetime import date
    today = date.today()
    if today.month == 12:
        year = today.year + 1
        month = 1
    else:
        year = today.year
        month = today.month + 1
    print "Next Month's Linux group is", eventdate(year, month, 'Thursday', 3)
    print "Next Month's Python group is", eventdate(year, month, 'Saturday', 4)

# start the ball rolling

if __name__ == "__main__":
    main()

This seems to work identically as the above but in less lines of code. I still get the feeling I am trying too hard and I am missing something obvious, but maybe I am just being too much of perfectionist (as always).

If anyone knows or can work out a more efficient method, please do let me know.

Discuss this post - Leave a comment

August 09, 2008 05:13 PM :: West Midlands, England  

Ian Monroe

QtScript Bindings and some blog

QtScript Bindings


If you've been following Peter Zhou's blogs, you know that he has been implementing QtScript support for Amarok. Probably the neatest thing we did is give access to almost the entire Qt API via the QtScript Binding Generator from Trolltech Labs. It uses technology from QtJambi; if you have Qt 4.4.1 and were wondering why Amarok gives a bunch of MetaJavaBuilder errors, this is why. (The bindings are disabled for Qt 4.4.0; we'll bump the Amarok dependency once 4.4.1 is more widespread).

I do think that the QtScript API is probably the most difficult Qt API to get the details right on. Your mind swirls with QScriptValue, QObjects and QVariants. But it is also quite powerful.

Since I had been sending the generators creator Kent Hanson emails regularly, I thought a mailing list would be a good idea to make it more public and useful. Join qtscript-bindings for discussion on the QtScript bindings in general. Kent also created a bug tracker and a Git repo. I created a mirror of it on repo.or.cz and posted the changes we've made to our SVN copy.

The beginnings of documentation for Amarok scripting are available and Richard Moore started a general Techbase article.

Console and Unnamed HTTP Server


The first script I created was an "irb" for Amarok's QtScript environment. This is available with Amarok SVN now, the "Amarok Script Console." It's quite handy to test out QtScript or to even test out the Qt API.

I've been working on a web control application for Amarok 2 using the new API. Using QTcpServer and QHttp, I have created a web server that should work well enough for what I'm doing. Now all that's left is the "little detail" of the HTML interface; I've been tinkering with qooxdoo, a very fancy JavaScript API.

One of my first sizable Amarok-related developments was to create the first kde-apps Amarok script in 2004 using Korundrum. So now its full circle.

Some Blog


The google news catcher sent me an indirect link to this Time-Warner blog: 3 Linux Apps That Make Me Hate Windows. He cites Synaptic, Compiz and Amarok. As much as you hear people gripe about package management on Linux, I really do think its one of its best features. Certainly from a security standpoint: going to a random web site and installing software just isn't something You Do on Linux, and I think thats for the best. And of course, it goes without saying that I agree Amarok is the best media player. ;-)

Everyone have fun at aKademy! I know I would be. :/

August 09, 2008 04:16 AM :: Missouri, USA  

QtScript Bindings and some blog

QtScript Bindings


If you've been following Peter Zhou's blogs, you know that he has been implementing QtScript support for Amarok. Probably the neatest thing we did is give access to almost the entire Qt API via the QtScript Binding Generator from Trolltech Labs. It uses technology from QtJambi; if you have Qt 4.4.1 and were wondering why Amarok gives a bunch of MetaJavaBuilder errors, this is why. (The bindings are disabled for Qt 4.4.0; we'll bump the Amarok dependency once 4.4.1 is more widespread).

I do think that the QtScript API is probably the most difficult Qt API to get the details right on. Your mind swirls with QScriptValue, QObjects and QVariants. But it is also quite powerful.

Since I had been sending the generators creator Kent Hanson emails regularly, I thought a mailing list would be a good idea to make it more public and useful. Join qtscript-bindings for discussion on the QtScript bindings in general. Kent also created a bug tracker and a Git repo. I created a mirror of it on repo.or.cz and posted the changes we've made to our SVN copy.

The beginnings of documentation for Amarok scripting are available and Richard Moore started a general Techbase article.

Console and Unnamed HTTP Server


The first script I created was an "irb" for Amarok's QtScript environment. This is available with Amarok SVN now, the "Amarok Script Console." It's quite handy to test out QtScript or to even test out the Qt API.

I've been working on a web control application for Amarok 2 using the new API. Using QTcpServer and QHttp, I have created a web server that should work well enough for what I'm doing. Now all that's left is the "little detail" of the HTML interface; I've been tinkering with qooxdoo, a very fancy JavaScript API.

One of my first sizable Amarok-related developments was to create the first kde-apps Amarok script in 2004 using Korundrum. So now its full circle.

Some Blog


The google news catcher sent me an indirect link to this Time-Warner blog: 3 Linux Apps That Make Me Hate Windows. He cites Synaptic, Compiz and Amarok. As much as you hear people gripe about package management on Linux, I really do think its one of its best features. Certainly from a security standpoint: going to a random web site and installing software just isn't something You Do on Linux, and I think thats for the best. And of course, it goes without saying that I agree Amarok is the best media player. ;-)

Everyone have fun at aKademy!

August 09, 2008 04:16 AM :: Missouri, USA  

August 08, 2008

Martin Matusiak

whapple: evil you can’t buy

Hah, Google. What idiots! First they announce their creed is “don’t be evil” and now they have to live up to it, because every little report to the contrary has the tubes flowing with indignation. How dumb was that?

One marketing company knows better. They would never fall into a trap like that. Appluz propaganda-fu is so strong that they copied Microsoft’s business tactics and yet people still like them. Now that’s evil you can’t buy!

Business people love the Apple example. Love it to death. How much you wish you had come up with it! Sell overpriced junk to drones with an identity crisis who desperately want to be “special” and get rich doing it. Lex Luthor couldn’t have done it better.

Apple have achieved the exact opposite of what Microsoft always wanted to. Beloved Redmond with their upgrade cycle from hell have done well for themselves. But iSpecial people run to the store to buy the latest junk voluntarily, in fact they run like it’s the 100m sprint in the Olympics. As special as we all are, there is no doubt the muppets with the latest white plastic are the most special of all.

As with any empire, there are cracks in the concrete here and there. The people on fuckingnda.com have something to say about the experience of writing code for a device without even being able to talk to each other. This same week Apple is facing a class action suit for failing to pay overtime and imposing evil working hours on their employees (sounds like a page from EA Games’s book of evil). And least surprising of all, a talk on Apple security at Black Hat got canceled by the marketing department (if there ever was any doubt that the marketing department runs the company).

Yes, the Jobs empire of iDRM is showing healthy levels of evil indeed.

August 08, 2008 10:54 AM :: Utrecht, Netherlands  

Christoph Bauer

Cracking passwords - a test

You know, I’m working as an IT administrator and I care about security. That’s why I’m worrying about passwords too. So why not running some tests to see some interesting numbers? Let’s get to work.

Our tool of crime: A linux box running a 400 MHz Xeon CPU, some RAM, a solid Raid and John The Ripper. Regarding the benchmark, we should be able to generate about 970 password hashes per second for cracking. I also got a huge wordlist of common passwords here.

I am creating 20 user accounts here having random passwords that look like a cat ran over my keyboard. Numbers and Letters, 8 Characters. This is the hard part.

Another test will use a password dump donated by a company I know who wanted to know the strength of their passwords used. I’m choosing 20 random users for being able to compare the tests.

Back to the workstation I’ve talked about, I fire up John for cracking the password dump of the company first. The is disillusioning: After the first attempt which is a dictionary attack, about half of the passwords are cracked. The other half was cracked by mutating those common passwords. After two hours the show was over and I got all the 20 passwords in plaintext. Damn.

Slightly shocked I started cracking the pwgen passwords, but the result is a different one - it’s still running:

Loaded 20 password hashes with 20 different salts (FreeBSD MD5 [32/32])
guesses: 0  time: 16:23:00:42  c/s: 970  trying: at6fcc

As you can see, John the ripper is crunching numbers for more than two weeks now without cracking a single password. That’s the bruteforce way. I’ll try to redo the test with rainbow tables later some time, but that’s another topic…


Copyright © 2007
Please note that this feed is for private use only. All other usage, including the distribution or reproduction of multiple copies, performance or otherwise use in a public way of the images or text require the authorization of the author.
(digitalfingerprint: 0f46ca51d0fa4e6588e24f0bf2b80fed)

August 08, 2008 07:21 AM :: Vorarlberg, Austria  

Steven Oliver

Mono


Is Mono an attempt by Microsoft to undermine Linux and free software in general??

Discuss.

Enjoy the Penguins!

August 08, 2008 02:56 AM :: West Virginia, USA  

Zeth

Is GUADEC just GDEC?

I am sitting now in the beautiful city of Tampere, the heart of the Finnish lake district. This city offered to host GUADEC but were refused, nuts, but if you read my recent post Exploring Technical Conference Demand and Supply, you will understand why.

In 2007, I went to GUADEC, the GNOME User and Developer European Conference hosted in Birmingham, it was an absolutely fabulous conference. It had the leading GNOME developers, great talks, great venue, great entertainment. The organisation was so good in fact that we completely copied much of the organisation for two other conferences that I have been involved in.

There was however one massive flaw, although the whole thing went over seven days, the main conference talks were in the week. There were a few hundred developers who had flown in from Europe, the USA, Latin America and so on. Apart from me there were three other people from Birmingham in attendance (if I don't include the nearby city of Wolverhampton then it was 1). They might have well held GUADEC on the moon.

Simply speaking, there were no users. This was a massive lost opportunity. They could have had the main talks over a weekend, dozens or hundreds of local people could have attended and learned more about GNOME, and the seeds of future developers could have been sown. How many potential new GNOME hackers live in Birmingham, Britain's second biggest city? A lot more than 4.

For GUADEC 2009, they had the choice of whether to have GUADEC in Tampere, Finland or Gran Canaria. So the developers, no doubt on expense accounts, chose Gran Canaria. I would vote for a week in the sun too. However, how many potential new GNOME hackers live in Tampere, Finland's second biggest city, home to two universities and a host of IT companies? How many potential new GNOME developers live in the tourist destination of Las Palmas?

To fly from England to Tampere, costs £40 on Ryanair from Stansted Airport. The cheapest I can find to fly from England to Gran Canaria in July 2009, the height of the tourist season, costs £230 if I book today, which I cannot because the GUADEC organisers have not announced the date. It will cost £300-400 if I book after new year.

If the GNOME conference is a corporate expenses fueled jolly for full-time developers, then please be honest about it. Don't call it a user conference or a community conference, it is not. GUADEC should be called GDEC or GNOME Developer Summit or similar. Someone else can then set up a community conference aimed at everyone.

So even though I, as just a GNOME user, will not join them, I wish the GNOME developers will have a good time on the beach in 2009, and especially since the KDE developers will be there in the same venue. Hopefully they will co-orporate more and remove some of the more redundant competition with each other. The free desktop needs to compete with OS X and Windows not with itself.

Discuss this post - Leave a comment

August 08, 2008 12:15 AM :: West Midlands, England  

August 07, 2008

Christoph Bauer

The OQO odyssey - Part 2

This article is part of the OQO odyssey series - You might want to read Part 1 first.

As the windows installation was finished, I am adding my default software set containing Firefox, Thunderbird, OpenOffice, Antivir and some Sysinternals-Tools.

But if you remember the first article about the installation, I have left 15 GB for a Linux installation on that UMPC. The gentoo LiveCD will be just fine for this job. For better readability, I recommend using the gentoo-nofb kernel. A positive side effect might be, that the unknown hardware will surely handle the common terminal.

The OQO booted up and arrived on the common bash prompt waiting for my commands. This must be my lucky day. Let’s start with some hardware inspection by looking at /proc/cpuinfo for some decent information about the brick here:

livecd ~ # cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineTMx86
cpu family      : 6
model           : 4
model name      : Transmeta(tm) Crusoe(tm) Processor TM5800
stepping        : 3
cpu MHz         : 999.211
cache size      : 512 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr cx8 sep cmov
mmx longrun lrti up
bogomips        : 2014.40

Our victim is a Crusoe CPU made by Transmeta - a CPU consisting of three-fourths Software and one-fourth of Hardware. Bummer - that’s strange. Well: The Crusoe emulates x86 architecture with a limited instruction set. For a little speed gain, the internal code morphing system works with 128 bit. But what does limited instruction set mean for us? Code alignment functions are unsupported.

As I want to run Gentoo on that UMPC, there’s no way around the GCC Documentation for determining the correct CFLAGS. Code alignment can be turned off by using -Os. So I’d suggest using the following settings:

-march=i686 -Os -mmmx -pipe -fomit-frame-pointer

Our little journey into cpu architectures might be fun, but I guess heading to the rest of the hardware might be fun too. The PCI bus offers the following devices:

livecd ~ # lspci
00:00.0 Host bridge: Transmeta Corporation LongRun
 Northbridge (rev 04)
00:00.1 RAM memory: Transmeta Corporation SDRAM controller
00:00.2 RAM memory: Transmeta Corporation BIOS scratchpad
00:00.3 RAM memory: Transmeta Corporation Unknown device 0399
00:03.0 Multimedia audio controller: ALi Corporation
 M5451 PCI AC-Link Controller Audio Device (rev 02)
00:05.0 FireWire (IEEE 1394): Texas Instruments TSB43AB22/A
 IEEE-1394a-2000 Controller (PHY/Link)
00:06.0 VGA compatible controller: Silicon Motion, Inc.
 SM720 Lynx3DM (rev c1)
00:07.0 ISA bridge: ALi Corporation M1533/M1535 PCI to
 ISA Bridge [Aladdin IV/V/V+]
00:0c.0 USB Controller: NEC Corporation USB (rev 43)
00:0c.1 USB Controller: NEC Corporation USB (rev 43)
00:0c.2 USB Controller: NEC Corporation USB 2.0 (rev 04)
00:0f.0 IDE interface: ALi Corporation M5229 IDE (rev c4)
00:11.0 Bridge: ALi Corporation M7101 Power Management
 Controller [PMU]

As I’m clueless about if this would ever work, I start doing the partition scheme as I’m about to run out of power soon. You know, the power supply is semi-broken…

livecd ~ # fdisk -l /dev/hda

Disk /dev/hda: 30.0 GB, 30005821440 bytes
255 heads, 63 sectors/track, 3648 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1        1824    14651248+   7  HPFS/NTFS
/dev/hda2            1825        3648    14651280    5  Extended
/dev/hda5   *        1825        1831       56196   83  Linux
/dev/hda6            1832        1894      506016   82  Linux swap / Solaris
/dev/hda7            1895        2381     3911796   83  Linux
/dev/hda8            2382        3648    10177146   83  Linux

The boot partition will have 50 MB for being able to test some kernels on Ext2. 512 MB Swap and 5 GB Portage should leave enough free space for the root filesystem.

As there is still some power left I start with downloading the stage file and a manual sync of the gentoo portage. Just in time the battery is out now and I’m shutting the device down for now. See you later folks!


Copyright © 2007
Please note that this feed is for private use only. All other usage, including the distribution or reproduction of multiple copies, performance or otherwise use in a public way of the images or text require the authorization of the author.
(digitalfingerprint: 0f46ca51d0fa4e6588e24f0bf2b80fed)

August 07, 2008 01:13 PM :: Vorarlberg, Austria  

August 06, 2008

Martin Matusiak

publishing slides from your talk

I’m extremely pleased that there are so many talks published online these days. They compose a rich buffet of interesting topics for anyone who can reach google video/youtube. I see it as a big step forward in our global communication that you can not only read what people have to say, but also hear it directly from them. It also raises the value of all these conferences that organize the talks dramatically. Not only their ability of attracting speakers the following year, but also their function in our society as “broadcasters” of knowledge.

Unfortunately, some conferences, even big ones, don’t publish the talks. Instead, they sometimes publish the slides. That’s too bad, but they have their reasons I suppose. I guess people consider this a second best, you can’t see the talk but well you have the slides, so you have the “content”. Well, that depends on the slides. I’ve always been of the opinion that the slides should be able to speak for themselves in case someone didn’t see the talk. But speakers have different styles.

OSCON 2008 only published slides, let’s see some examples. (Heads up, that page is “sponsored by Microsoft”, whatever that means. Perhaps they wrote the html.)

Some use them as a “visual aid” for their talk, and consider the whole thing as more of a performance art. Now, I’m not down on talks like this, because the talks are sometimes quite good. It’s just that the slides are fairly worthless on their own. The Mac/Rails crowd seems to be all over this minimalistic slides idea: ruby web frameworks, capistrano. There’s very little content in these slides, some of them are just single words on a page. A particularly egregious example is a talk on revision control. What is the point of publishing slides like this?

One guy who both gives good talks and writes good slides is Alex Martelli. Compare his slides on code reviews. Granted, if you don’t understand what they mean, there isn’t much to do about it, but I think this is pretty much what you can hope to achieve with slides alone. They offer real value even without commentary.

Now, there is a real dilemma about how to write slides effectively. I have agonized over this for a while and I don’t have an answer yet. And I’m guilty of writing bad slides. I gave a talk a while back which was quite well received, but the slides are not good: dynamic python. The content is there, but there is no context to it.

August 06, 2008 07:14 PM :: Utrecht, Netherlands  

August 04, 2008

Johannes Gilger

zsh git-branch prompt and cygwin

This is a post about a few things at once, since I have all these little tips/hints I’d like to make public which don’t deserve their own post ;)
Ok, first about the git-branch status on your zsh. What is that good for? Well, I often find myself working in git-repositories with different local branches (obviously), and sometimes you lose track which branch you have checked out in which repository at the moment. Instead of issuing “git branch” all the time (also note that the git-<command> syntax is no longer valid, the commands are used without the dash now!) you can use that unused space on the right side of your prompt to display the active branch of the current directory (given it is a git repository of course). This is what it will look like (the yellow text is the current branch):
zsh-git-cygwin.gifTo achieve that (and the colors too) you have to put the following into your .zshrc:

setopt prompt_subst
autoload -U colors
colors
function __prompt_git()
{
        local git_dir ref br top;
        git_dir=$(git rev-parse --git-dir 2> /dev/null) || return
        ref=$(git symbolic-ref HEAD 2> /dev/null) || return
        br=${ref#refs/heads/}
        top=$(cat $git_dir/patches/$br/current 2>/dev/null) \
                  && top="/$top"
                  echo "[$br$top]"
}
export PS1='[%?]%{$fg[green]%}%n%{$reset_color%}@%m:%~\$ '
export RPS1='%{$fg[yellow]%}$(__prompt_git) %{$reset_color%}%*'
if [[ "$USER" == "root" ]] ; then
        export PS1='[%?]%{$fg[red]%}%n%{$reset_color%}@%m:%~# '
fi

(RPS1 is the right side of the prompt)
This colors your username green and red if you’re root (really helpful). I’ve picked up the habit of giving remote hosts different colors for the username so that when I have many terminals open I can identify the corresponding host not only by name but also by color. The number in front of the username is the return-code of the command just executed.

cygwin-logo.jpgThe title of this post (and the screenshot) already mentioned the second topic. Cygwin. I heard about it before but always dismissed it as a poor attempt to bring something into an operating system in a strange and crippled way just because some people are too scared to switch to a unix system. Well, being at home right now (and using Windows XP here because I am too lazy to switch this old machine and also play the occasional game in my free time ;) made me try cygwin, and I have to say I am impressed. I don’t use it extensively, to be honest I only use it to be able to ssh/scp without using gui-software like PuTTY/WinSCP, to use git without a gui and to have a decent zsh with screen in it. Oh yeah, and vim. Basically all the little life-savers you have with linux (tar, grep, less, sed, man). Just being able to download a tarball (like git or stow) and compiling/installing it like on any unix is quite convenient too. And that works fine with cygwin. You can also access you normal windows-drives and it has a tool (cygstart) to open files with the associated programes (like “open” in Mac OS). Last but not least you can even run an ssh-server, which seems weird at first, but comes in handy when all you want to do is shutdown you windows-box remotely ;). So if you don’t like the rxvt you can always use putty to ssh to localhost (yeah, I don’t do that neither).

August 04, 2008 10:00 PM :: Germany  

Christoph Bauer

The OQO odyssey - Part 1

Everything started with a package from japan. I bought an OQO Model 01+ on ebay, a small UMPC - The disc was wiped, but the recovery cd was available. Hey, that’s the perfect geek toy! As I opened the box, I discovered, that the power cord was missing.

If this is the worst thing happening, I’m happy - so I went out for buying a power cord, plugged it into the charger and so on. The battery of the OQO started blinking. We’re charging.

Euphoria is a bitch, guys - because I couldn’t wait to get the device booted. As the UMPC here is a low power pc, the USB ports don’t have enough power to feed a simple USB mouse. I guess I don’t need to explain that there’s no way to use external drives without external power.

As I’m a geek, I know to solve that problem: I dig out an old power unit serving 5V which I used for powering my external USB Harddisk. Et voilà - we’re running on external power and as a bonus, the OQO now recognizes the disc. As the hdd isn’t empty, I moved the data to a temporary storage and copied the recovery-cd. For backup reasons, I also saved an ISO. You never know if you need it.

I connected the harddisk to the oqo and tried to boot - but this was a failure. No joy. My next idea was using the GRUB bootloader for being able to check if it would boot. It worked for grub.

I had to use my Plan B: There are small programs being able to boot from ISO files if they were run by a bootloader. So I just copied the ISO file to the external harddisk and checked if my laptop would boot it. Success.

What about the UMPC device? That brick refused to boot - as usual. So I got me a compatible dvd-rw drive on eBay, impatiently waiting until it arrives. But for some reason the OQO device killed its charging unit’s 230V part as I tried to connect boot from the dvd-rw drive. That’s evil. A new charging unit would cost me 200 USD, which I just don’t want to spend. But luckily the charger got another input section for car/flight usage which was not broken at all: 12V

So I got me a 12V power unit for powering the charger unit for the OQO. This might look strange to you, but due to the complicated charger serving 12V and 5V at a time I didn’t want to break my device.

The installation process now started normally and went quite well. But knowing murphy’s law, I got the feeling that I might have overlooked something. But nevertheless I partitioned the disc and went on with the setup procedure until I checked the battery status: not charging anymore. I guess I have shouted out something equivalent to the word ‘fuck’. But I could finish the basic installation and shut the device down in time, just before the battery had no more power.

I went on with charging the battery again while downloading the required patches for the UMPC to be able to use the battery time best. But now the big bummer: Bios updates and Windows XP Service Pack 3 do require external power for the device. Damn.

But if you think that I’m giving up now, you’re definitively wrong. I went out to my car for testing the charger there and it worked. The car was able to deliver enough power for the charger for the updates to install. But as I didn’t want to kill my car, I had to drive around. I started the bios update and went to the highway. But just before arriving the highway, I stopped at some lot for peeking at the screen. The bios update went ok and a reboot was required. So I did and continued by starting the setup of Service Pack 3 which took about 25km to complete.

Back home I checked the whole OQO device and powered it off. 50% of the installation are completed. The next adventure will be gentoo linux…


Copyright © 2007
Please note that this feed is for private use only. All other usage, including the distribution or reproduction of multiple copies, performance or otherwise use in a public way of the images or text require the authorization of the author.
(digitalfingerprint: 0f46ca51d0fa4e6588e24f0bf2b80fed)

August 04, 2008 06:28 AM :: Vorarlberg, Austria  

Steven Oliver

Updating when everything is built from source


I have been using Gentoo for a long time now. In a world where it feels like people switch versions of Linux as often as their clothes having been using Gentoo as my primary operating system for more than 2 years (its been longer I know but I’m to lazy to really count) now really feels like a long time. In that time though I’ve noticed a very strange idiosyncrasy when it comes to updating everything by building it from source.

Now, before we get started, as anyone who has ever read my blog before knows I use Paludis exclusively, but this seems to be true with Portage too.

When I’m updating my computer I like to start with a
paludis -i system
and then a
paludis -i world
and finally, if I remember (and I often don’t)
paludis -i everything
Now, how good or bad a system that is, I don’t know. Never really discussed with anyone I felt would know. Regardless though a lot of times, especially if it’s been a while since I’ve updated I find that a lot of packages start to fail during the -i system. If I can get through that they will then begin to fail during the world. Now here is the interesting part. If packages start to fail during system, I find that if skip straight to everything, for some reason the failures go away. It just happened to me tonight.

Can anyone explain why???

Enjoy the Penguins!

August 04, 2008 02:28 AM :: West Virginia, USA  

August 01, 2008

Martin Matusiak

konqueror ui regression

Well well, what have we here? The omelet is well underway in the pan, but we’ve dropped some eggs on the floor, that’s too bad. KDE likes to try things, and that’s really cool. I’m pleased as long as they do not stop trying until they produce a better, or at least an equally good, outcome. (Which is my experience with KDE so far.)

There is another slight regression here. The click area for the plus (+) sign beside each directory (the one that expands/collapses it) appears smaller now, after the icon has been changed. It’s smaller now, and it was already quite small before.

Ubuntu Bug: #254039

KDE Bug: 168379

I’m not submitting it specifically to kde bugzilla given how Shuttlesworth raves about Launchpad’s synchronization capabilities to various bugzillas every chance he gets. Hopefully that means they have a link set up with KDE as well. The regression was spotted in Ubuntu anyway.

August 01, 2008 06:34 PM :: Utrecht, Netherlands  

Jürgen Geuter

Outsourcing the gathering of information: Is RSS slowly going away?

RSS is everywhere nowadays, you can hardly find a web service that doesn't publish some kind of feed, showing your activity within the service.

For quite some time now, many people rely on feed readers to aggregate their feeds into one place, effectively creating one stream of information relevant to the user. Those feed readers moved from being desktop applications to the web and often offer a feed themselves (the feed aggregating all the feeds you want to read), this is the situation we've been having for a while now.

Today I stumbled on an article talking about how RSS feed readers were slowly phasing out:
"When Paul said that, I suddenly realized that I too am using RSS readers much less than I was say six months ago. In one sense, the conversations in which I am most interested and which get my attention are occurring in the Twitterverse."


What the author's talking about is that, instead of slowly gathering all the interesting hotspots of the internet in one place (your feed reader), some people are starting to "outsource" that information gathering: They find the interesting people on some social network thingy (twitter, friendfeed, &ct) and rely on them to post the relevant stuff, to be the content filter, weeding out the worthless articles. This approach can bring a very high signal to noise ratio: You probably miss a few articles but the ones you go through have had some sort of "review".

History moves in circles and here we have another one of those: Relying on people to filter the huge stream of information for you and direct your attention to the interesting stuff, maybe with a few comments on the stuff, didn't we have a name for that? Yeah, right, it's called a newspaper.

After the explosion the web brought with it, where everybody (and his blog ;-)) was its own newsgatherer, people start realizing that managing your own feed of information and filtering it is quite the task which does not just take a lot of time but also needs you to actually find the interesting content. So some people decide to use others to do the work for them.

This personal approach also brings int he whole gatekeeper problematic again: Instead of enabling everybody to participate some people decide to rely on a small set of people who become the gatekeepers to information. Information they don't want to see being published gets dug and ignored, on the other hand they get a lot of influence and power: Them reporting about the launch of a new service can be the make or break of said service. Again it becomes a trust issue and a transparency issue: Does the person disclose who pays them for what?

There are some differences to classical newspapers right now: Usually most people don't make accessing other people's data hard, because it's the whole idea of social networks. To make sharing of data as easy as possible. The newspaper is "free as in beer" so to speak. Also every person has to aggregate his own journalists: There's not the "NY times" set (yet!).

I think we'll see a big move to creating that kind of "outsourced information filtering" (just because the huge flow of information gets harder and harder to filter all by yourself). The whole filtering process will also be multi-tiered: You follow personA cause he has the information you find interesting, personA follows personB, personC and personD and just funnels what they put out.

It's not like that's completely new, some people have been doing exactly that for a while now to earn their keep: The "professional" blogs do exactly that, gather information all over the net and filter it. And some of the webtooodotohhh personalities are obviously very involved into pushing one service and letting another service perish (and if there's no money flowing right now, it will soon).

While it's understandable that not everybody can be his own journalist due to many limitations we should also keep an open eye to limit power concentration. The net with its decentralized peer-to-peer structure allows us to work around power magnets very well, allows us to make sure that we don't build single points of failure. It allows journalists (or anybody actually) to make sure that important information can be shared. "Can't stop the signal". But if everybody just follows three people the signal might be sent but won't be heard.

August 01, 2008 06:05 PM :: Germany  

John Alberts

Very Thorough Gentoo Ebook

I just noticed on planet gentoo that a developer, Sven Vermeulen aka swift, has posted a draft of his new ebook on Gentoo Linux. I couldn’t figure out a way to register to post a comment, so I thought I would post something in my blog about it. I haven’t had a chance to do much more than glance at the book, but wow! There sure is a lot of information there. The book is distributed with the Creative Commons license.

Thanks Sven for taking the time to write a book about our favorite distro. :)

August 01, 2008 03:32 AM :: Indiana, USA  

July 31, 2008

TopperH

Xorg-server with hal support and keybord layout

Recent version of xorg-server (1.4.2) can be compiled with the "hal" use flag, since I have this flag globally enabled, I got my package compiled this way.

Flameeyes told me on irc that the hal support is useless in most desktop systems and may cause some problems, by the way I encountered only one major issue: the keyboard layout setting in /etc/X11/xorg.conf is ignored.

This happens because now it is up to hal to take care of it, so I had to create a file called /etc/hal/fdi/policy/10-x11-input.fdi

http://rafb.net/p/pkcBG846.html

(I had to uplad the content of the file to nopaste since blogger's wysiwyg editor seems to have some problems handling xml tags)

After reloading hal and restarting X, I had my Italian keyboard layout back.

July 31, 2008 03:57 PM :: Italy  

Jason Jones

From Nvidia to ATI

Well...  I just spent about 2 hours writing a how-to on going from an Nvidia-based graphics system in gentoo Linux to an ATI one, but I accidentally erased the whole thing, so I'm going to try my best to be patient and do it again.

When I originally got the box for my new ATI Radeon HD4850 video card this morning, I was impressed even in the way they packaged the thing.  Even the cardboard they used seemed to be a bit higher quality than normal...









The first thing I did after plugging in the card was, I uninstalled the nvidia-settings and nvidia-drivers packages through portage (emerge -C).

I then tried to do a little research on which of the two currently existing ATI drivers I should use.  As far as I could tell, the only ones which support the 3D acceleration features of the card at this moment is the proprietary fglrx one.  The other one is built by the OSS community, but the 3D isn't quite there yet.

So, I went ahead and tried to emerge ati-drivers.  It puked all over the place.

2 Problems in installing the ati-drivers package for the proprietary fglrx drivers:

  1. Make sure you have the old PCI API (find_pci_*) kernel option turned on in your kernel.

  2. For some reason, all the old libGL.so and libglx.so links were still linked to my non-existent nvidia files. even though I ran emerge -C nvidia-settings nvidia-drivers.  This caused a pretty big headache, but soon found that if I deleted the old links (*links*, NOT files), the new ati driver compiled just fine.  Symptoms of this problem are things such as mesa-progs / mesa / glxinfo / fgl_glxgears not finishing compiling.

  3. Oh yeah..  One last thing... Make sure you set the system GL renderer to the xorg one by using the eselect opengl set xorg command.


After deciding to use fglrx (ati-drivers), instead of the OSS driver (xf86-video-ati) and installing the ati-driver package, I ran eselect opengl set ati after seeing that the first option in the list given by eselect opengl list was the ATI driver.  It set just like it should.

I then tried to configure the X server by running /usr/bin/X -configure, but upon starting X, all I got was a blank screen.  Not acceptable.

I had to reboot in order to get my screen back (even trying alt-F1-F6 didn't bring it back)

Come to find out that setting the DefaultDepth 24 in your xorg.conf is pretty important as it was trying to use the default setting of 8, and the fglrx driver just wouldn't allow it.

3D PERFORMANCE SETTINGS

This is all experimental, as I really have no experience at all with ATI video cards, but I can say that after about 4 hours of tweaking, I got it to run Enemy Territory : Quake Wars (my poison of choice) to run at a consistent 61 FPS.

*IMPORTANT* - With Nvidia, using DRI was not important at all - in fact, I seem to remember that using it hampered its performance.  This is NOT the case with ATI.  As soon as I enabled the DRI use flag, and recompiled xorg-server, as well as enabling it in the xorg.conf file (remember to set the DRI flag to 0666), everything seemed to run just spanky.

So, there ya have it!  I now have a new ATI Radeon HD 4850 video card running my gaming machine, and so far, I can't tell any difference from my old Nvidia 8800GT.

I guess only time will tell.

July 31, 2008 11:52 AM :: Utah, USA  

Tonko Mulder

Gentoo on a VPS

I have an VPS with a Gentoo template and I always wondered how the hardend profile and SELinux worked. So I decided to change the profile. To see all the profiles issue the next command ve123 ~ # eselect profile list Available profile symlink targets: [1] default-linux/amd64/2006.1 [2] default-linux/amd64/2006.1/desktop [3] [...]

July 31, 2008 08:34 AM :: Drenthe, Netherlands  

Daniel de Oliveira

Howto install FreeBSD under ZFS (including root) (Part 2)


I think you know what you doing. If you mess your system up, it’s your own problem. You’ve been warned.

Requirements

Minimum processor: 1.2Ghz (Pentium4/Athlon-XP works fine)
Minimum memory: 768Mb of RAM (1Gb or more is recommended).

Instalation

Let’s suppose that you have a 40Gb HD to use:

  1. Boot FreeBSD 7.0 CD
  2. Partition the whole disk
  3. Make 3 slices
    / -> 1Gb
    swap -> you decide with your own practices (or FreeBSD best practices)
    The rest of the disk.
  4. Now install the Minimal, then reboot.

Creating the pool

After the installation is complete, jump to single user mode and mount your / rw:

# mount -w /

Now we create the disk pool, let’s suppose that the 3rd partition that you create is ad0s1d:

# zpool create rootvg /dev/ad0s1d

But after start creating the filesystems, stop the automount:

# zfs set mountpoint=none rootvg

Now we’ll create the mount points:

# zfs create rootvg/root
# zfs create
rootvg/usr
# zfs create
rootvg/var
# zfs create
rootvg/tmp

Now, we can set the first set of mountpoints (to install data):

# zfs set mountpoint=/rootvg rootvg/root
# zfs set mountpoint=/rootvg/usr rootvg/usr
# zfs set mountpoint=/rootvg/var rootvg/var
# zfs set mountpoint=/rootvg/tmp rootvg/tmp

Use a df and you’ll understand.

Now, copy the whole filesystem from / to /rootvg (there’s a lot of methods to do that)

*DON’T BOOT YOUR OS, YET*

Booting FreeBSD

I don’t remeber where I get this trick: You know, FreeBSD bootloader doesn’t know what ZFS is (yet), so, we need to do some tricks:

Remove the boot from the /rootvg:

# rm -fr /rootvg/boot

Create a new dir inside the /rootvg and link the outside-boot with the inside-boot:

# mkdir /rootvg/bootdist
# cd /rootvg
# ln -s bootdist/boot boot

Now, tell the loader to get the ZFS support and mount the ZFS root partition
Don’t forget to set vm stuff (since ZFS in FreeBSD is experimental, it’s easily to run out of memory and crash the kernel).

# echo ‘zfs_load=”YES”‘ >>  /boot/loader.conf
# echo ‘vfs.root.mountfrom=”zfs:rootvg/root”‘  >>  /boot/loader.conf
# echo ‘vm.kmem_size_max=”512M”‘ >> /boot/loader.conf
# echo ‘vm.kmem_size=”512M”‘ >> /boot/loader.conf
# echo ‘vfs.zfs.zil_disable=1′ >> /boot/loader.conf

Don’t forget to put the boot into the first line of fstab:

/dev/ad0s1a  /bootdist        ufs     rw      1       1

Now, let’s do the magic:

# cd /
# zfs set mountpoint=/tmp rootvg/tmp
# zfs set mountpoint=/usr rootvg/usr
# zfs set mountpoint=/var rootvg/var

Set root  to legacy because the loader will to the job:

# zfs set mountpoint=legacy rootvg/root

All done. Now you can reboot your FreeBSD and start to install things.

July 31, 2008 02:02 AM :: São Paulo, Brazil  

Howto install FreeBSD under ZFS (including root) (Part 1)


This is my first post talking about BSD systems, so, I will talk about my first (bleeding edge) experience making tests on freebsd (FreeBSD 8.0-CURRENT).

Why FreeBSD?

Disregard  the bad points of FreeBSD (yes, a lot of bad points, but strangely FreeBSD looks untouchable by criticism, sorry but I’m kinda realist), it’s a good unix environment, stable (not my case, I’m bleeding edge @ home, stable-paranoic-guy @ work), and looks a lot similar to Gentoo in a lot of points (yeah yeah I know I know).

WTF is ZFS?

ZFS is a file system designed by Sun Microsystems for the Solaris Operating System.

Why ZFS?

ZFS is known to be one of the fastest filesystems on the earth, so I decide to give it a try. But not just using a single filesystem, I just want the whole OS inside ZFS, so I can measure more precisely.

What is the advantages?

  • Support for high storage capacities
  • Integration of the concepts of filesystem and volume management, snapshots and copy-on-write clones
  • On-line integrity checking and repair, and RAID-Z.
  • Increased reliability through checksums, multiple copies of data and self-healing RAID.
  • Very similar to LVM (snapshots, rollbacks, etc), the partitions can be resized at any time, and in fact can be allocated up to the full size of the storage media.
  • Built-in Compression and encryption, also NFS file sharing.
  • Easy toolset for creation and manipulation.
  • Many more

How it works?

Unlike traditional file systems, which reside on single devices and thus require a volume manager to use more than one device, ZFS filesystems are built on top of virtual storage pools called zpools. A zpool is constructed of virtual devices (vdevs), which are themselves constructed of block devices: files, hard drive partitions, or entire drives, with the last being the recommended usage. Block devices within a vdev may be configured in different ways, depending on needs and space available: non-redundantly (similar to RAID 0), as a mirror (RAID 1) of two or more devices, as a RAID-Z group of three or more devices, or as a RAID-Z2 group of four or more devices. The storage capacity of all vdevs is available to all of the file system instances in the zpool.

A quota can be set to limit the amount of space a file system instance can occupy, and a reservation can be set to guarantee that space will be available to a file system instance.

How about the capacity?

ZFS is a 128-bit file system, so it can store 18 billion billion (1.84 × 1019) times more data than current 64-bit systems. The limitations of ZFS are designed to be so large that they will not be encountered in practice for some time. Some theoretical limits in ZFS are:

  • 264 — Number of snapshots of any file system[8]
  • 248 — Number of entries in any individual directory[9]
  • 16 EiB (264 bytes) — Maximum size of a file system
  • 16 EiB — Maximum size of a single file
  • 16 EiB — Maximum size of any attribute
  • 256 ZiB (278 bytes) — Maximum size of any zpool
  • 256 — Number of attributes of a file (actually constrained to 248 for the number of files in a ZFS file system)
  • 256 — Number of files in a directory (actually constrained to 248 for the number of files in a ZFS file system)
  • 264 — Number of devices in any zpool
  • 264 — Number of zpools in a system
  • 264 — Number of file systems in a zpool

The Model

ZFS uses a copy-on-write transactional object model.
All block pointers within the filesystem contain a 256-bit checksum of the target block which is verified when the block is read. Blocks containing active data are never overwritten in place; instead, a new block is allocated, modified data is written to it, and then any metadata blocks referencing it are similarly read, reallocated, and written. To reduce the overhead of this process, multiple updates are grouped into transaction groups, and an intent log is used when synchronous write semantics are required.

Continue…

July 31, 2008 01:31 AM :: São Paulo, Brazil  

July 30, 2008

Steven Oliver

Booting


For some strange reason I’ve been seeing a lot of articles lately about how Linux boots. One I just read is about how to make it boot faster. While I find this tend interest novice users more than anyone else (experienced linux users tend to either not turn it off or just don’t care) they still provide an amusing read that sometimes lets you get a sneak peak inside of Linux and its Kernel. This article did not.

Lets go down the list:

  1. Worthless - Totally aimed at servers not desktops. Who shuts down servers anyway? And when they do get rebooted odds are you’ll be using sendmail and httpd anyway, at least on a Linux box as a home server.
  2. Worthless - I have money that says you won’t even be able to tell the difference with a stop watch much less your perception.
  3. Worthless - If your normal, odds are if you are using Gnome or KDE you like Gnome or KDE and aren’t going to switch.
  4. Worthless - Same reason as above.
  5. Worthless - Same reason as above.
  6. Maybe - …but I doubt it. That sounds like a scary proposition to me. Last I checked the compatible hardware list was short too.
  7. Maybe - …but I doubt it. Odds are you probably don’t have much choice on this one. Especially if you don’t have a router and I’m guessing a lot of people still don’t.
  8. Worthless - Again with the servers. If you’ve ever used a thumb drive you’ll need it.
  9. Worthless - You’re not and you know it.
  10. Worthless - Because no one runs Debian and no one like a hack, especially on a server.

Enjoy the Penguins!

July 30, 2008 10:20 PM :: West Virginia, USA  

Jürgen Geuter

On strong passwords

Working with clients I do work with very different types of users. This is not just a statement about which business people are in (though that differs a lot, too) but also about their abilities and technical skills.

Especially in one project the question of passwords has emerged: We have a number of users, each of them getting their own login, so what kind of password policy do we have?

Of course you wanna save passwords encrypted, as in hashed, for security reasons (you don't want someone to get a dump of your database with all passwords intact, right?), but what are the properties enforce in our passwords?

There's a set of common examples that you probably all have seen at some point:
  • enforce a minimum length
  • enforce that it mustn't contain a word from a given dictionary
  • enforce a mix of numbers and letters
  • enforce a mix of special characters, letters and numbers


Each of those steps makes passwords somewhat better (as in harder to crack) and sometimes you see rules enforced like "you have to change your password every 3 weeks". All those technical means aim at making passwords secure by trying to make breaking a login (in time) as hard as possible.

In my work with different groups of people I have come to the conclusion that most of the rules and regulations actually make the situation worse. The fiercer your rules are, the harder it gets for people to remember their password, and if they can't remember it (or are not sure they'll remember it) they will do stupid things.

Did you ever wonder why your ATM card uses 4 digits? 4 digits gives you 10000 possible combinations, that's really low. So why chose a number that short? Because the wife of the inventor of the ATM couldn't remember longer numbers. If the numbers would have been longer, many people would have started either keeping a little piece of paper with them with the number on it or would have just written it on the card with permanent marker hoping to never lose the card.

The techy people are usually able to remember a bunch of passwords. Many people that I know have a set of passwords, each one representing a level of "security": They have one easy one for logins that they don't care about (like when some page forces you to create a login to post a comment) and then they have a bunch of passwords, each one getter "harder" for more secure sites.

But the non-techy people are often not as comfortable with passwords as we are. Computers are scary as they are and more passwords make it even scarier. How often have you, after setting up some new thingy with a decent security strategy probably generating strong passwords for every user, gotten mails asking you to "set my password to 'dog' please, I always use that one."?

Forcing people to use strong passwords and change then every few weeks is pretty much a guarantee to find the password on a post-it on the display or under the keyboard. Your strong security policy brings people to punch holes in it.

There's not just one way to ensure security. A good way is to enforce multi-level authentification (for example by having a password and some hardware dongle) but it's also somewhat harder to implement and does not work in every use case (it won't be an option for your website).

Another way is to throw away most of the rules that we talked about before: Don't force people to use numbers and special characters. It makes the passwords harder for them to remember and they'll write them down. Enforce really long passwords and don't call them passwords, call them passphrases. Make sure that people do chose a long phrase, like a long sentence, but leave it to them whether they want to mix in numbers; this obviously means that real words should be allowed.

Allow them to have really long passwords (and don't tell them that they can't be longer than 16 characters or something) and allow them to stick with their long sentences so they feel confident with them and know them without having to place reminders everywhere.

Security is often not a technological problem and when you start seeing it as just technological you start making bad decisions.

What password policies do you enforce on your sites and computers? Very strict? Very leisure? What's your policy?

July 30, 2008 07:46 PM :: Germany  

Michael Klier

From Scuttle To del.icio.us - The Quick And Dirty Way

Today I decided to finally get rid of my scuttle installation (an Open Source del.icio.us clone) that I've used until today to manage my bookmarks. The reason is simple: I am lazy, and I don't want to worry about updates anymore. Looking for alternatives, and based on the recommendations of a few people, I decided to switch to del.icio.us. It features a superb Firefox integration, which I can confirm. The FF addon is really great! Of course I somehow had to move my scuttle bookmarks to my new del.icio.us account, so I wrote a little Python script to do the job (I am again impressed how little it takes to get stuff done in Python!). It's very quick and dirty and has no exception handling or stuff that could make your life easier ;-), but I thought I share it here. Maybe it's useful to someone else out there.

The only things you have to change are the two URLs at the top of the script, make it executable and last not least run it ;-).

scuttle2delicious.py

#!/usr/bin/env python
# -*- coding: utf-8 -*-
 
scuttle_url = 'http://username:password@domain.org/scuttle/api/posts_all.php';
delicious_url = 'https://username:password@api.del.icio.us/v1/posts/add';
 
import sys 
import time
import urllib
from xml.dom import minidom
 
def main():
    scuttle_raw = urllib.urlopen(scuttle_url).read()
    scuttle_xml = minidom.parseString(scuttle_raw);
    bookmarks = scuttle_xml.getElementsByTagName('post')
    count = bookmarks.length
 
    for bookmark in bookmarks:
        post = {}
        post['url'] = bookmark.getAttribute('href').encode('utf-8')
        post['description'] = bookmark.getAttribute('description').encode('utf-8')
        post['tags'] = bookmark.getAttribute('tag').encode('utf-8')
        post['ds'] = bookmark.getAttribute('time').encode('utf-8')
        result = urllib.urlopen(delicious_url, urllib.urlencode(post)).read()
        print count
        count = count - 1 
        time.sleep(1.5)
 
    return 0
 
if __name__ == '__main__':
    sys.exit(main())
Read or add comments to this article

July 30, 2008 06:29 PM :: Germany  

Jürgen Geuter

Firefox search engines

These are my search engines from firefox (you know the little search box to the right of the address bar). Which search engines do you use? Any search plugin that I really really should have?

July 30, 2008 12:25 PM :: Germany  

Andreas Aronsson

Goodbye horde, hello Zimbra

I finally gave up trying to keep my hordeinstallation alive. It's been alot of work installing and upgrading the package and every time I've failed to retain my data. I was recommended Zimbra by a friend. It turns out it's a complete suite with mta, imap, spam- and virusscanner. This meant that I'd have to give up my carefully configured mail services. After bracing myself for a number of days, I got to it.

Pretty quickly I found an installation method that would enable me to keep my base system and apache installation on their wiki:  building Zimbra on Gentoo. It's a bit outdated, but with some modifications it's working fine. In case I see a request of interest for it here I could update it. Let me know.

After adding postfix and changing port number for ssh and a couple of other tweaks it's just the way I want it. Lovely.

July 30, 2008 05:14 AM :: Sweden

Jason Jones

Diving Into ATI

Okay...    Ever since Nvidia came out with their Geforce series, I've been hooked.  I've built upwards of 100 systems in my life (family / friends / work) and out of those, about 90% of them use Nvidia video cards.  I also highly prefer AMD.  In fact, the very first computer I built was an AMD K6-2 250MHZ machine with a 3dfx 3d accelerator.  Man, I was stoked.

Anyway...  I digress.  I really enjoy building computer systems, and I've used AMD / Nvidia for the overwhelming majority for processors and video cards.

Well..  When AMD bought ATI and proclaimed from the rooftops that it would release the all the specs and source code for their video cards, I caught my eyebrow raising, just a little.

Quite a bit of time has passed since that day, and I now find myself in a quandry:

  1. I really really really want AMD to stay in business, and actually really like their products.  My Phenom 9850 suits me just fine, as well as the numerous 64-bit X2's I've got around.

  2. I really have had a great experience with the Nvidia cards I've used.

  3. AMD now owns ATI, and I have no good reason not to switch from Nvidia to ATI.



So, there ya have it.  And so do I...  at least, I will tomorrow, that is.

Heh...  My boss needed a new video card, so I told him about the 8800GT I had, and said if he wanted it, I'd give it to him if he'd get me a comparable ATI card.  He agreed, and so we made the swap.  He really likes his new 8800GT, and my new ATI HD 4850 video card should be shipped from newegg to my work by tomorrow afternoon.

Although I have no experience whatsoever in dealing with ATI and Linux, I've read a few reviews which state it runs in Linux just fine.  There's even a few gentoo how-to's out there to make it even easier.

We'll see how it goes, and more than likely, you'll see a blog entry about the whole thing.

Wish me luck, and a future bright with all sorts of ATI / AMD goodness.

July 30, 2008 01:08 AM :: Utah, USA  

July 29, 2008

Christoph Bauer

Nostalgia

I’ve never thought of having to install MS-DOS 6.22 again in my life. But today I had to - I even needed Windows 3.11 for Workgroups for getting some ancient box to work.

The install started with three floppy disks, another one for the CDROM and nine for Windows. I was sitting there, DJing until the files were copied to the harddisk for a faster install. That’s nostalgia, folks. Remember the old smartdrive and himem stuff?


Copyright © 2007
Please note that this feed is for private use only. All other usage, including the distribution or reproduction of multiple copies, performance or otherwise use in a public way of the images or text require the authorization of the author.
(digitalfingerprint: 0f46ca51d0fa4e6588e24f0bf2b80fed)

July 29, 2008 05:54 AM :: Vorarlberg, Austria  

July 28, 2008

Jürgen Geuter

iGnorance is iBliss: The iPhone

So, as you all know, Apple released a new version of their iPhone, a piece of information that has dominated the tech sites for the last weeks. You'll find all kinds of reviews and comments about it and people just can't stop talking about it so I'll just say all there is to day about it to allow the rest to shut up.

The Apple cult has managed to keep the tech news in their firm grip for a while now, and where Scientology has Anonymous there's only a little group fighting the good fight of keeping the tech news somewhat relevant and interesting. Consider this piece some sort of flushing the news toilet, to get rid of all the nasty crap that has been circulating in the toilet for too long.

The iPhone has a few nifty technological specs: Big screen that doesn't look too shabby, touchscreen that works with multitouch. The design is typically Apple, they did pay a good amount of attention to the graphical details.

Apart from that, like with the MacBook Pros, you get a bigger penis by having an iPhone, all women will offer to have sex with you (or men of you prefer so, I don't know about sheep) and you've basically reached full enlightenment. Or something similar. You get my drift: It's hyped from here to the moon and back, all the "cool people" on the net got one, so you should get one, too!

Let's just summarize why buying the iPhone as a device you actually wanna use for its intended purpose is pretty much a sign of brain damage (the iPhone is definitely a nice, though expensive, toy, so if you buy it just for its entertainment value there's still a little hope for you).

  • Battery: If you actually use some of the nifty features (using it as an iPod to play music, surfing the web, using the apps you can get) the thing has a battery life that's shorter than having sex with the 15year old singer of a ska band: It starts, you play around a little and then it's suddenly over leaving you unfulfilled.
    If your cellphone has to be charged every day (and best also in between while working on your computer and while driving around in your car) you are doing it wrong. The whole point of a cellphone is that you can take it with you without having to worry about charging that thing all the time.
    The battery lifetime alone makes that thing a no-buy if you want any of the features that thing has. Apple knew about the battery issue early on but decided not to fix it cause the acolytes of the cult of Apple would buy it anyways. And Apple was right.
  • Closed Ecosystem: I'm not even gonna talk all high and mighty about Freedom Zero or anything, I'm talking about the average developer trying to check the platform out and write software for it.
    If you wanna get into the shop, Apple is the gatekeeper, they decide what gets in: You decide to fix an issue against Apple's will, you stay out. While developers were able to pick up the pieces for OSX and make it somewhat usable they won't be able to do that for the iPhone.
    Yeah you can jailbreak your iPhone to get access to the software you want and to make it talk to machines Apple doesn't care about (like a linux box) but you're breaking Apple's rules which Apple sees as consent to brick your device if they wanna.
    Apple's actions with the iPhone are copied from how Nintendo or Microsoft keep their game consoles locked: You want to publish downloadable stuff? You have to go through Nintendo/Microsoft. In the case of Nintendo you even have to order your DVDs from them (to make sure that they always get their cut even if you lose a lot of money).
  • Syncing: Apple claims that you can sync your Outlook or whatever with the iPhone but actually you can't: It syncs People and Calendars but not notes or ToDos. Great: Claiming to support something and then only doing half of it is worse than admitting that you can't do something. People will waste a lot of time trying it out thinking it's their fault until they finally find out it's not, it's just their new toy that can't sync (well if you have more than 10 ToDo items the sync will fail anyways cause the battery will drain too fast ;-) ).
  • Camera: They want to put everything into one device. No longer do you have to carry an MP3player, a phone, an organizer and a camera with you, you have all in one slim, elegant device. So far the theory. In reality the camera's pictures are really bad for a phone in the price range of the iPhone (in Germany you'll pay with the fee for the provider around 1000 Euro). Apple could have put in something decent but hell, why fix something that your followers buy anyways?

So what do we have? A technically interesting device that is probably really fun to play with but that does not do any of the things it's supposed to do really well.

The iPhone is the Anti-Unix: Instead of having a few devices, one specially designed to do one task really well, you get one device that does none of the tasks good enough (the battery alone takes care of this, apart from the other problems). It does not empower you, the user, it locks you in, it keeps you stupid (but hey, you can get a lightsaber thingy so your phone makes lightsaber noises while shaking it! Well the 5 minutes the battery survives).

I used to play StarWarsGalaxies which is run by Sony. The way they treated their customers reminds me a lot of how Apple treats its user base. In StarWarsGalaxies we had a saying that summed it up perfectly:
We're being treated like mushrooms: Kept in the dark and fed shit.


Apart from the syncing I didn't go into the problems with the software, just cause I give Apple the benefit of the doubt: They could fix those things next week with a firmware update. The problems I outlined here (apart from the syncing) are all problems that can't be fixed, that are there and won't go away.

They will probably add Copy'n'Paste at some point, they'll fix the keyboard to be usable in every application. But they'll keep you locked in, your battery will have the endurance of your 98 year old, chain-smoking grandfather, and they will keep the whole thing locked tightly.

That's all there is to say, all the review, you, as a normal reader interested in whether to buy that new phone or another one, needs to know. If you need a phone, buy one that works, if you have 1000 Euro for a toy you can buy the iPhone (or donate money to me). No more blog entries with "tips to lengthen your iPhone battery lifetime" (summary of all: Turn off all the things it does then you might get something. I have actually seen someone suggesting to turn the thing off when you're not playing with it. It's a fucking cellphone! It needs to be one to be reachable which is the whole fucking point!), no more "should I buy one?" posts. The world moves on, I'm tired of newssites allowing Apple to monopolize them.

The iPhone is not "the big thing",whether it's "next" or "last" or "current", it's just one thing: A really pathetic telephone.

July 28, 2008 06:47 PM :: Germany  

Matija Šuklje

Writing ebuilds is easy!

Recently I have written (and submitted to the Gentoo bugzilla) a few ebuilds that I think were lacking in the portage tree and decided to write a small post to encourage others to do so as well. Namely the net-im/kopete-antispam (Antispam plugin for Kopete 3.x), app-pda/libopensync-plugin-moto (Motorola plugin for OpenSync) and games-action/wordwarvi (awesome retro-style scrolling shoot'em up).

If you were (like me) afraid of all the headers and variables needed to even start — fear not! There is a nice little trick to make you start easier.

I will demonstrate just how easy it is to write a basic ebuild based on my experience with net-im/kopete-antispam.

read more

July 28, 2008 06:43 PM :: Slovenia  

Jürgen Geuter

Enhance your GNOME II - we go to 11!

To follow up on my "Enhance your GNOME" post here's a second edition talking about another application that's really handy, it's called nautilus-sendto.
It's actually a pretty simple application: When building it you select which "targets" you want (it supports Evolution, Sylpheed and Thunderbird for mail/address books, Pidgin as an Instant messenger and Bluetooth (to send stuff to your phone for example)). To use it, just rightclick on a file in your nautilus window, you'll see the option "send to".

Now you get a dropdown list of targets, (in the screenshot I'd be sending the file to myself via jabber for example), you select which "protocol" to use and then the actual target. Now you just decide whether to automatically wrap it in a .zip file and off it goes. Simple, fast, efficient, integrated. That's how we roll ;-)

Most distributions should package it, look in your package manager of choice of nautilus-sendto. it rocks.

July 28, 2008 02:35 PM :: Germany  

Joset Anthony Zamora

Something for Solaris SPARC

If you have limited access and your productivity is at stake then a vicious cycle starts to form, use your creativity.

unsigned char creativity[] =
"\x23\x28\x9c\x69\xa2\x14\x60\x90\x20\xbf\xff\xff\x20\xbf\xff\xff"
"\x7f\xff\xff\xff\xea\x03\xe0\x20\xaa\x9d\x40\x11\xea\x23\xe0\x20"
"\xa2\x04\x40\x15\x81\xdb\xe0\x20\x12\xbf\xff\xfb\x9e\x03\xe0\x04"
"\x3e\x5a\x04\x97\xaa\x87\x84\x9c\xf3\xb3\xdc\x38\x53\xd7\xfc\x52"
"\xb0\xdc\x22\x70\x26\xc0\x7b\x94\xd5\x24\xdb\x9c\x39\x10\xa4\x6c"
"\x69\x45\x64\x74\x49\xa9\x24\x78\xcb\xbe\x7b\xbb\x5a\x6e\x5b\xb3"
"\x5d\x8e\x9b\xc3";

Annihilate with passion.

July 28, 2008 01:08 PM :: Zamboanga, Philippines  

Iain Buchanan

TwinView with a Dell E248WFP

So I received my Dell 24 inch LCD finally, after being told they were out of stock for a while... The colour is certainly more vibrant than my new Precision M6300 laptop screen, but I don't know if it's a good vibrant...

My setup is two X screens side by side. The laptop is on the right, and the LCD in the centre. You can use the real nVidia twinview, which should require xinerama support where available, but I didn't like the second display not having it's own gnome panels.

Both displays are 1920x1200. I used nvidia-xconfig and some manual tweaking to get it right. Note I backed up my xorg.conf file first to xorg.conf-20080728 so that I could run nvidia-xconfig multiple times from the same starting point:

sudo nvidia-xconfig -c /etc/X11/xorg.conf-20080728 -o /etc/X11/xorg.conf --separate-x-screens --no-constant-dpi --use-edid --use-edid-dpi --damage-events --render-accel

Now, this default setup creates an xorg.conf file that places the login screen on the primary display - the laptop. Annoying if you have the LCD in the centre. Simply swapping "Screen 0" and Screen 1" in the ServerLayout doesn't work, as the first screen will still be assigned to the laptop. You must force which screen is the primary screen by using UseDisplayDevice. In each "Screen" section, add:
    Option         "UseDisplayDevice" "DFP-0"

for the laptop LCD (or DFP), and
     Option         "UseDisplayDevice" "DFP-2"

for the external LCD. You may find yours is DFP-1. I use the DVI so perhaps DFP-1 is for the VGA.

Take note of the Identifiers for the two screens, and change the serverlayout to show:
    Screen      0  "DefaultScreen (2nd)"
Screen 1 "DefaultScreen" RightOf "DefaultScreen (2nd)"


Then restart X. The 0th screen is the "primary" screen, which will have your log-in window and all your usual panels and applets. The 1st screen has a default blank Gnome installation (if you use Gnome), but with the same background.

You could rename the Identifiers to make them a bit more readable.

The resultant xorg.conf file is on pastebin.

poRblems:
So far, the EDID DPI detection doesn't work, so applications that support the DPI and resize themselves aren't doing so for me, depending on the screen. Emacs does look a bit wierd on a 24 inch monitor, when the DPI is set for a 17 inch LCD!

July 28, 2008 05:16 AM :: Australia  

July 27, 2008

Jürgen Geuter

Python functions you might not know

Python has buttloads of functions built in and many people don't really know many of them. It's actually understandable since some of those functions were added in a particular Python version that the user did not learn Python on so when he learned the basics they were not yet there.

Python 2.5 introduced two new functions that are actually quite useful and make the code a lot more readable: all and any.

Both behave like you'd expect it:
all(LIST) returns True if all items in LIST evaluate as True and returns False else. any(LIST) returns True if any one item in LIST evaluates as True and False else.

Those two functions are not the most ground-breaking things ever, but they make your code shorter and more readable:

Instead of writing things like
CODE:
array = function_that_returns_a_list() state = False for item in array:     if item:         state=True print state

You can do:
CODE:
array = function_that_returns_a_list() print any(array)


Hope this lets you delete some of your code as well :-)

July 27, 2008 10:22 PM :: Germany  

Zeth

PyCon UK 2008 this September

Long time readers may remember that I am one of the organisers behind the conference of the United Kingdom Python community, PyCon UK, this year held over the weekend of September 12-14th. I am also giving a talk.

The abstracts of currently accepted talks, tutorials and BOFs and the timetable for the tutorials day have been published today. Not on that list are the keynotes, expected to be from Mark Shuttleworth and Ted Leung.

It is nice to see Django well represented again, with two out of the three main Django developers giving talks, (as well as a Pylons talk, proving that Django is not the only Python toolkit in town).

Also good to see some talks on PyPy, I have wanted to get into that for a while, so September might be my chance to spend some time looking at it properly.

The 'official' conference hotel is the Etap, primarily because it is one of the cheapest hotels in Birmingham (which is a cheap city for England) and because they charge per room not per person. Each room has a single and a double bed, so three students can pack in to a room, paying very little each. People often arrange room shares on the mailing list.

If you are richer, then you can have a whole room in the Etap, or you can go to the Copthorne (next to the conference venue), the Holiday Inn (where the Saturday conference dinner is planned), or the Novotel (a pretty walk of 5-10 mins away). (A longer list is on the conference site). The early bird rate is still open (but not for too much longer).

If you go, do say hello, I'm wearing a crew shirt and a badge with 'Zeth' on it!

Discuss this post - Leave a comment

July 27, 2008 09:57 PM :: West Midlands, England  

Jason Jones

My Wedding Day...

I got married like a bit more than 5 years ago, and I'm lovin' it.

But, during those five years, I've had some footage gracefully shot and donated to me by my friend
Ty Swartzlander

on my wedding day.  On that day, Ty told me he was going to put something together and give it to me later, but instead, I told him I'd really, really, really like to just get the raw footage instead.

Thankfully, I got the footage digitized about two years later, and almost 4 years later, I finally got around to actually putting something together with it.

Man...  During the making of the video, I couldn't think about much else.  I stayed up until 3:00am this morning, and then a couple more hours after church getting it all together.  I hope you like it.  It's really kissy-kissy-smoochie-smoochie-mushy-mushy, but hey...  I love it.

*note*  All editing was done in gentoo Linux using nothing more than KDEnLive.  The program really is progressing...   It still crashes every 10 minutes or so, but if you're saving every 10 seconds, then that really isn't a problem.

It took me a total of about 5 hours to get it together.

July 27, 2008 06:18 PM :: Utah, USA  

July 26, 2008

Ben Leggett

I Finally Figured Out What New, Powerful CPUs Are Good For..


Well, a few months ago the venerable, Best Buy point-of-sale Toshiba piece of crap laptop I’d been using for 3 years finally gave up the ghost. Good riddance. That thing gave me more trouble with Linux than a whole host of chair-throwing Steve Ballmers. Not only was it really low-spec, but it seemed to have been created with the express purpose of making it difficult to run Linux. Suspend never worked, the video card alone took me 2.5 years to get working, and it was just a crappy integrated Radeon. Well, at least I was able to play Quake in something besides software rendering for a couple of months.

Anyway, it died, and I vowed to use the knowledge I’d gleaned from 3 years of exclusive Linux use to buy a real computer, one where everything worked out of the box, and one that had everything I wanted, within reason. Like with $1000 being the upper limit of reason.

Anyway after much tootling about, I came to the vaunted Thinkpads. They were having a sale, and I wanted a real geek’s computer, not some colored-plastic, World-of-Warcraft-playing, IPod syncing, Walmart special, HP toy laptop. I would have preferred the ones with Suse preinstalled, but those were all limited to integrated Intel cards, and while they are admirably supported uner Linux, I wanted something that wouldn’t take speed hits when running 1996-era OpenGL games. So, finally, thanks to the sale, and a coupon I found online that decreased the price even further, I got a Thinkpad R61 with these specs:

Intel Core 2 Duo T8100 @ 2.10Ghz

1GB RAM

160GB SATA HDD

128MB Nvidia Quadro NVS 140M

And the price? $768. Not bad, especially for a laptop with discrete graphics. RAM’s a bit low, but that’s easily and more cheaply upgradeable later. The best thing though, is that I had to do absolutely nothing to get everything working under Linux. Wireless? Taken care of by the excellent Madwifi drivers. Graphics? Nvidia’s binary driver worked out of the box. Bluetooth? Worked. SD/MMC slot? Worked. Heck, even suspend and hibernate worked out of the box. Definitely not like my old laptop. The graphics card is entry level, but it’s perfectly sufficient for my needs and wants. I really regret the fact that the drivers are closed-source, but the Intel cards just don’t quite offer the performance I wanted. And the Nvidia binary drivers work pretty well, although they don’t usually like running with the latest kernels, and I’ve already found a performance regression in the newest drivers that I submitted a bug report about, but whatever.

The dual core 64 bit CPU is nice, and certainly it compiles faster than a Celeron M. But you wonder, what beyond compiling and video encoding are super-powered CPU’s good for? I mean, usually RAM and other thigs can have a more tangible impact on performance, as there really aren’t too many heavily CPU-bound things that an average user does frequently.

Well, I found the answer. One area where a fast CPU makes a huge difference is running DOS games under dosbox. You know those troublesome, cycle intensive ones like Elder Scrolls Arena, or Daggerfall, or System Shock, or Wing Commander Privateer? A fast CPU really makes a huge difference with dosbox, and with my Core 2 Duo, there’s really no DOS game I can’t run. Bliss.

July 26, 2008 07:18 PM :: Georgia, USA  

Zeth

Threescore and five

65 is not normally considered a notable number, but we can celebrate it here in this post. At least here in Europe, 65 is the traditional age for retirement. Even more important is that 65 is the atomic number of terbium, a metal used in making solid-state Flash drives.

In 1965, the film Mary Poppins romped home at the Academy Awards winning five Oscars.

Normally reserved for kings, Winston Churchill's state funeral in 1965 was the largest that Britain has ever seen before or since; meanwhile in America, a different king, Martin Luther King, lead the pivotal Selma to Montgomery marches, and Mariner 4 took the first ever photos of Mars.

Most influential technology sites in the UK

These historical facts were a very tenuous build up to the rather more insignificant fact that Wikio, a blog search engine that has been bought by Yahoo, has ranked this site as the 65th in their list of top 100 most influential technology sites in the UK.

I clicked on the link How are these rankings compiled? Which gave the following information:

The position of a blog in the Wikio ranking depends on the number and weight of the incoming links from other blogs. These links are dynamic, which means that they are backlinks or links found within articles.

Blogrolls are not taken into account and Wikio only counts links from the last 120 days. We thus hope to provide a classification more representative of trends in the blogosphere.

So from this it probably means they are sucking in everyone's RSS feeds and then parsing them for links; well that is how I would create such a site. Scraping a whole site, i.e. like Technorati does, would make it very hard to distinguish what is a 'blogroll' and what is a post.

Who is the king of the Midlands?

Now technology is a broad topic, and the UK is a wide area. If we zoom into to sites about free/open source and sites based in the UK's Midlands; then it seems this site is the 2nd most influential open source site in the Midlands, behind an acquaintance of mine, and fellow Midlands resident, Jono Bacon, the Ubuntu community manager.

So the question is readers, can we climb the 21 places to become the most influential open-source site in the Midlands? Can Birmingham triumph against the Black Country?

Only time will tell, but if you are in a position to link here and help pimp this site up the table, please do. Also, if you have linked to me and I have not linked back, either in a post or in my recommended links section then it means I do not know about your site, so leave a comment telling us about it!

Discuss this post - Leave a comment

July 26, 2008 06:42 AM :: West Midlands, England  

Bandan Das

Think Blink

Ok, I rarely find any use of the Thinklight that's supposedly there to help you type in the dark (isn't the light from the LCD screen enough ?). Then, I came across this really cool pidgin plugin called pidgin-blinklight by Joachim Breitner that blinks the thinklight when you receive a new message. Honestly, that's the perfect usage, the light can possibly find, keeping in mind the fact that I hate my sound card to be disturbed when I am doing something serious, err.. watching a movie or playing a game i meant!

I did feel the need to make some changes to the original sources. Notably, I wanted the light to blink until I do not see the pending message. Also, there was a silly path error that prevented me from writing to /proc/acpi/ibm/light as a normal user. I am also now linking against pidgin libraries unlike the original sources that link only to libpurple and so I thought it makes sense to provide the whole sources rather than a patch. You can find it here. You can get the sources yourself by running git clone git://makefile.in/pidgin-blinklight.git

Note that the sources are quite beta but nevertheless they solve my purpose :)

read more

July 26, 2008 03:23 AM :: India  

Iain Buchanan

hibernate a Dell Precision M6300 with nvidia-drivers

This is not a howto, just a collection of information that helped me.
$ uptime
22:05:42 up 9 days, 46 min, 1 user, load average: 1.78, 1.41, 0.91
Unfortunately, that will go back to 0, as I have to reboot for a new kernel!

So it appears there is some difficulty getting Nvidia's proprietary drivers to hibernate nicely. Had I known I might have stuck with an ATI video card for my next laptop (enter the Nvidia vs ATI flamewar. Of course, the whole argument is pointless, because everyone makes ultimatums like "I will never buy <brandname> again", based on one or two experiences, often with known old or buggy hardware.)

I have tried in the past to hibernate this laptop, but not succeeded. Common problems include:
  • Suspend ok, but resume locks up
  • Suspend locks up
  • Corrupted video, etc
Recently I decided to have another go. To my surprise, it worked without much hassle! Firstly, the specs:
  • Dell Precision M6300 (laptop!)
  • 64-bit Intel core-2 duo
  • nVidia Quadro FX 1600M with 256Mb RAM
  • 17" WUXGA 1920 X 1200 LCD
lspci identifies the video card as: 01:00.0 VGA compatible controller: nVidia Corporation Device 040d (rev a1) with the id: 10de:040d.

Now for the software. I use gentoo, but you'll be able to glean the relevant version number from these names:
  • tuxonice-sources-2.6.25-r3 and tuxonice-sources-2.6.26*
  • v86d-0.1.5.2 (Note: so far hibernate is incompatible with fbcondecor)
  • hibernate-script-1.99
  • nvidia-drivers-173.14.09
  • gcc version 4.1.2 (Gentoo 4.1.2 p1.0.2)
Instructions for installing and configuring are all over the web. Google is your friend! Two useful links:
Note1: I think the results are quite version specific, so try a number of combinations before you give up (yes, it's time consuming)
Note2: I use the filewriter, because I don't use swap <boast Who needs it with 4Gb RAM?!/> Look at my kernel config for more details.
Note3: Make sure you can suspend successfully without the nvidia kernel module installed first, otherwise this info will be of little use to you!

Also, my config files:
[Note these will be paste-binned soon]
Problems:
  • on resume, GL actions all have a delay of a few seconds before operating. eg. a GL screensaver will show nothing for 3 seconds before starting. You can fix this by stopping X, reloading the nvidia module, and restarting X.
*2.6.26 works much better with resuming - no great pauses, however Intel Wireless WiFi 4965AGN (IWL4965) doesn't work...

I think that's all you'll need to replicate my setup. Let me know your success / failure with other versions / distros!

July 26, 2008 02:46 AM :: Australia  

July 25, 2008

Zeth

Top Ten mailing list posts in the history of free/open source software

A few months ago, we looked at Linus Torvalds in his own words, which was surprisingly popular (for a filler ;). So following the same approach (i.e. too busy to write something original today ;), what are the top-ten best mailing list posts in the history of free/open source software?

This is pretty difficult to say of course, so here are ten coolest posts that spring to mind. If you can think of a better one, please do paste a link in the comments.

  1. Martin Bligh and Andrew Morton almost manage to ban binary kernel blobs.
  1. Discussion on the Debian bugs mailing list about RMS VS VRMS.
  1. Ingo Molner produces an estimate of What is the Linux kernel worth?
  1. After being falsely accused by stealing his own code, Linus leads the fight back with explicitly documenting patch submission, the first paragraph is classic Linus.
  1. Jeremy Allison protests Microsoft-Novell Pact. (I think this started on a mailing list originally).
  1. In 1983, Richard Stallman goes public with his radical new ideas for a New UNIX implementation.
  1. The Linux kernel, the most successful ever Unix-like kernel, ported to more processor architectures than any operating system is history, started as just a hobby.
  1. Poul-Henning Kamp introduces the bike shed into the free software world.
  1. Tim Peters' classic Zen of Python (follow up)
  1. Jeff Waugh finally reveals the answer to the biggest mystery in free software.

Okay that is my pick, what have I missed? Please post your suggestions in the comments below.

Discuss this post - Leave a comment

July 25, 2008 08:29 PM :: West Midlands, England  

Steven Oliver

Posting


I recently switched jobs… hence my lack of posts. I no longer do any work for the NASA so if you have any questions about space flight I can no longer answer them. Instead I’ve taken a job with a utility company. Where it appears I will doing a lot of PL/SQL. I was under the impression it would be C# which excited me but it appears I was mistaken. Either way writing code of any kind was a step up from what I was doing. Either Paludis 0.28.1 is out. I think I’m still running 0.26.x so I definitly need to upgrade myself. It would appear on the Linux not to much is going on. A couple of linux boxes are getting sold through Dell, a couple oh phones run Linux, and for the most part 90% of the world still doesn’t care.

In more interesting news though, has anyone who reads this ever flashed thier router with an open source alternitive like DD-WRT or Tomato. I just bought a Lynksys router which is compatible with DD-WRT and I was curious how other people faired with it. There is absolutely nothing wrong with the Lynksys firmware but I like to run open source if I can. I mean why not?

Enjoy the Penguins!

July 25, 2008 06:55 PM :: West Virginia, USA  

Daniel de Oliveira

The leak of knowledge in IT Professionals


I see a problem in this week, maybe a lot people just see this.

There’s a person in my company that goes fired because be supposed to “look a lot of pages than doing his job”. Since Im not the Internal Support responsible, and I see that this guy just do your work in the right way.. I just try to help and see this situation.

Well.. this guy uses and RSS Reader, and as I can see a lot of times, he read his reader something like 1h/day.. What the problem? Since the RSS Reader get the feeds from a lot of times (even when you are idle) and from a lot of sites, the Internal Support says that this guy doesn’t do your job, but its wrong.. And to see this, you need only to see the squid logs. RSS! Just filter the word RSS…

In other hand, there’s a lot of other people in the same company that waste the almost entire time browsing www.terra.com.br and www.uol.com.br. Why this people aren’t fired? Because are browsing only one site.

Do you know what is this? This is a bad IT professional, that doesn’t know even a silly technology called RSS Feed. Try to imagine someone browsing more than 20 or 30 or 40 sites at the same time. Strange? Just use the common sense… Common sense?! This IT Professionals doesn’t have this.

Sad to see this type of professionals now-a-days.

This is the result of a lot of companies getting professionals just because have a Degree, instead of read the entire Resume to find someone really useful.

July 25, 2008 04:19 PM :: São Paulo, Brazil  

Jürgen Geuter

Function arguments, return values and unpacking in Python

Python is a dynamic and flexible language, but you probably know that. A few days ago I stumbled on some Python code that was clunky in the way it called methods so I thought I'd write a few things about functions and methods.

Functions and methods (I'll just write functions from here on) get arguments passed, do some magic and then return a result that (usually) depends on the input. Trivial.

Sometimes it's really useful to be able to return more than one result from a function, which, due to Python's dynamic structure is fairly simple, you just wrap your results in a list or a tuple:
CODE:
def onetwo():     return (1,2)


Of course now we have to manually unpack the things which is kinda annoying isn't there an easier way to return two values? Well actually the returning isn't the problem so much as the manual unpacking, you just don't need to do that. If you know you're expecting two results packed in an iterable you can automatically unpack them:
CODE:
a,b = onetwo() print a # 1 print b # 2


Easy, so don't unpack manually if the results have a fixed length. The next thing is about handling dynamic input of functions more elegantly. First, a bunch of example functions:
CODE:
# boring, inflexible, only two args def join_1(a,b):     "Return the two given values joined as a string"     # technically this would also add numbers but who's     # nitpicking     return a+b # more flexible, as many args as we want def join_2(*args):     "Return joined string of all given arguments"     return "".join(args) # flexible as a gymnast def join_3(*args,**kwargs):     """Join all given args together and replace every keyword     argument with the corresponding value"""     joined = "".join(args)     for search in kwargs:         joined = joined.replace(search,kwargs[search])     return joined


Three functions that deal with concatenating strings. The first one is really boring, two arguments, not dynamic, just joins the strings.
CODE:
print join_1("abc","def") # surprise! We get 'abcdef'


The second one is more interesting, it accepts as many arguments as we want which makes it a lot more flexible (and gets rid of hideous arg1,arg2,arg3,arg4... or the need to explicitly pack things into a list to add them up).
CODE:
print join_2("abc","def","ghi") # 'abcdefghi'


join_2("a","b","c","d") is just more readable than join_2(["a","b","c","d"]), I mean who wants to drown in unnecessary parenthesis or brackets? No one, that's who. If you waste brackets the terrorists win or something.

Well, the dynamic function thingy also works with keyword arguments like the third function shows:
CODE:
print join_3("abc","def","ghi",cd="I hate CDs.") # 'abI hate CDs.efghi'


So we have covered the whole dynamic arguments section and I hope I've shown somewhat why they are a great idea: Your functions are easier to read and more flexible without them being all workaroundy which is really neat. But what about calling those functions?

Lists and listy types are the workhorses of Python, you pretty much put everything in lists or at least instances that behave like lists. It just makes handling them easy and they work well together with all the built-in functions. But since you have all your data in lists, shouldn't your functions accept lists as parameter? It would save you from having to unpack your data when you need it. The problem is the following:
CODE:
things=["123","xyz","monkey","butt"] # this is clumsy and annoying # plus not readable join_2(things[0],things[1],things[2],things[3])


Well you could sacrifice the cases that we talked about before (the ones where you don't have the arguments in a list) and just make the input one list, but actually there is a prettier way:
CODE:
join_2(*things)

join_3(*things,**replace)
# 'No numbers pleasexyzkeep the language clean'
If you prefix a list with a * when calling a function the lists content is unpacked while calling the function in effect doing what was done manually before but without making things more annoying to handle (plus you save boatloads of brackets which you can later use for ... something).

Of course there is a similar functionality for dictionaries and keyword arguments:
CODE:
replace={'monkeybutt': "keep the language clean",          '123':'No numbers please'} join_3(*things,**replace) # this gives us # 'No numbers pleasexyzkeep the language clean'


Prefixing dictionaries with "**" unpacks them and makes their key:value pairs keyword arguments.

You can read more about defining functions in the Python Tutorial, section 4.7, check it out if you still have questions or want more examples about what's possible with functions and their definition.

So the next time you wanna start unpacking things manually think about whether that is really necessary: Automatic unpacking is clean and very readable (mostly due to the fact that it's not implicit but explicit). It allows you to write flexible code without putting workarounds in place, code that's clearer and semantically intentional.

Manual unpacking and packing is often pure boilerplate which nobody needs.

July 25, 2008 01:14 PM :: Germany