Larry the Universe

July 3, 2009

Paulo Roberto

HOWTO – Servidor DAAP no FreeBSD

O Firefly (antigo mt-daapd) é uma implementação DAAP (Digital Audio Access Protocol) que é o protocolo utilizado pelo iTunes para compartilhar as bibliotecas de audio na rede. É compativel com iTunes no Windows e no Mac OS X assim como players compativeis com DAAP como o Amarok. Portanto é uma boa idéia manter um repositório de mídia centralizado em um servidor na rede.

A homepage do projeto é http://www.fireflymediaserver.org/. Além de servidor DAAP o Firefly provê mais alguns goodies. Vale a pena checar.

Instalação:

A instalação no FreeBSD é bastante simples. Considerando que voce tenha o ports (e saiba usa-lo) apenas instale-o a partir de /usr/ports/audio/firefly. Não há qualquer problema em manter os padrões sugeridos para as dependencias.

Configuração:

Adicione “firefly_enable=”YES” e edite o arquivo de configuração /usr/local/etc/mt-daapd.conf. Lembre-se de criar as pastas usadas para a database e certificar-se de que pertencem ao usuário daapd. Inicie o serviço via /usr/local/etc/rc.d/mt-daapd start. As configurações e atualizações manuais da biblioteca de midia podem ser manipulados pela interface web http://<server>:3689.

O firefly se anuncia na rede utilizando o Bonjour da Apple e pode conflitar com o Avahi.

Se voce completou os passos descritos acima com sucesso, poderá visualizar sua biblioteca de audio nos computadores de sua rede local através do iTunes ou Amarok.

July 3, 2009 :: Brazil  

Dion Moult

Blender 2.5 Features Video

blender2.5-dev1Hello everybody, I’m back from my 5 day jungle trek and I’m just catching up on what I’ve missed throughout the week. I was initially going to award you all with a post about the trek itself, but it turns out Jonathan Williamson from Montage Studio (the very same who does the Blender screencasts and gave some good tips for ThoughtScore) has got himself a Blender build for Windows 7 and has recorded a short screencast demo-ing the development.

I am truly amazed with what has been going on and I will definitely throw myself back into Blender this holiday and its stuff like this that really shows what open-source is capable of. Blender is one serious threat to the huge commercial monopoly in the 3D industry. Here is a short list of the features he describes:

  • New design/look
  • Panel splitting/deleting/management
  • Not limited to one window only
  • Massive reorganisation of features that make it more intuitive
  • Real-time playback animation while editing
  • Real-time playback animation while rendering
  • Every single value in Blender can now be animated
  • Support for macro options
  • New transform panel
  • Search option for features

Without further ado:

Clicky here to watch the video.

Related posts:

  1. The Blender Model Repository and BlenderNation: open-source merger?
  2. Blender 3D: Architecture, Buildings and Scenery – Review
  3. Blender Suzanne Awards announced.

July 3, 2009 :: Malaysia  

Iain Buchanan

The Twouble with Tcl

From time to time I do a bit of tcl. Mostly as maintenance for existing tcl programs. I haven't made up my mind entirely about it yet - I've seen some very powerful programs in tcl, and yet occasionally I'm still "surprised" by a feature.

I spent a couple of hours today trying to figure out why a tcl program of mine wasn't running, and so I've made some notes:

Real languages don't have reserved words


In tcl, you can redifine parts of the language in tcl itself. For example if you wanted to redefine if, just write a new function:
proc if {cond expres} {
puts "cond is $cond"
puts "expr is $expres"
}

set a 1
if {$a == 1} {
puts hello
}
Sounds neat. In fact proc itself is just a command that takes 3 arguements (name, arguements, and body). However, don't start using simple names in your tcl languages like this:
proc open {} {
set ::alarm_socket [open_socket $::options(-alarm_host)]

foreach host $::options(-hosts) {
verbose "open $host"
set ::sockets($host) [open_socket $host]
# set up an event handler for when data is readable on this socket:
fileevent $::sockets($host) readable [list process $host]
# initialise socket timeout with open time
set ::socket_t($host) [clock seconds]
}
}
Because open is what you might call a reserved word. (I should have known with open, but should I really have to remember all the reserved words?)

The error looked something like this:
$ ./test.tcl
invalid command name "::tcl::tm::UnknownHandler"
while executing
"::tcl::tm::UnknownHandler ::tclPkgUnknown msgcat 1.4"
("package unknown" script)
invoked from within
"package require msgcat 1.4"
("uplevel" body line 2)
invoked from within
"uplevel \#0 {
package require msgcat 1.4
if { $::tcl_platform(platform) eq {windows} } {
if { [catch { package require registry 1.1 }] } {
..."
(file "/usr/lib/tcl8.5/clock.tcl" line 23)
invoked from within
"source -encoding utf-8 [file join $TclLibDir clock.tcl]"
(procedure "::tcl::clock::format" line 3)
invoked from within
"clock format [clock seconds]"
(procedure "alarm_timeouts" line 3)
invoked from within
... and so on. Yeuch! And it was encountered with this one line:
   puts "$::argv0: [clock format [clock seconds]]"
The problem? I redefined open, which was used internally by clock.

Real languages don't have types:


You can do lots of nice things in tcl without types, in a similar (but different) way to perl.
set a world
puts "Hello $a" ;# prints 'Hello world'
set a 1
incr $a
puts "$a + 2" ;# prints '2 + 2'
This looks normal to someone used to perl and tcl. Noticed how I don't need format specifiers or concat functions. You can also do this:

set a pu
set b ts
$a$b "Hello World"

Which prints:
Hello World

Real languages don't have comments


They have a comment command of course! And the comment command is a command that takes arguments (the comment itself) that aren't evaluated. Except that because of this, you can't have an unmatched brace in a comment:
# if ($sometest) {
$somecode
#}

The tcl solution?
if (0)
blocks or the like...

Conclusion


So if you haven't yet learnt tcl, I encourage you to find a tcl hackers tcl program, and delve into it to see just how it works.

If you try to learn tcl only by writing it and not by reading others' code, then you'll learn tcl with the habits you're used to, and you will possibly miss some of the powerful features.

After all, C programmers can program C in just about any language!

July 3, 2009 :: Australia  

Jason Jones

Yeah, So it's been awhile...

Okay...  I think it's time I wrote something.  The last everyone knew, I was jobless, on welfare, losing hope in humanity, depressed, bordering on despair, and a little bit sad, too.

Well...  Although it's not perfect, I do have a job now.  My wonderful long-time friend Scott Morris happened to mention to his boss that he was slowly sinking in the amount of work he had, and he recommended they hire a new programmer.  When his boss agreed, he conveniently mentioned that he knew another programmer who might be able to help out.  I got the call about 10 minutes after that.  This was about 2 weeks ago.  So, yeah, I've been working for NoMoreMortgage now for about 2 weeks, and am getting paid more than I was with unemployment, let's just leave it at that for now.  They're having me work as a contractor until they can figure out what type of offer to give me.  That most likely will happen sometime early next week.   So, until then, I'm not entirely sure what might happen, but I'm most grateful that I at least have this going on.

I've also had a number of interviews since then, as well.  I'm finding that the web development sector has been slowly shifting to OOP - even with PHP, so I've gotta get on the ball and learn that crud.  If I knew it well, I would probably have a job paying as much or more than Nature's Way was.  So, yeah...  I'm muscling through it almost every night now.  (If anyone knows of any good online tutorials, or books which can efficiently teach a procedurally-minded programmer the concepts of OOP and the web, please feel free to comment.)

Other than that, life is going on as usual.  We're doing our best to pinch pennies now, and being wonderfully successful at it.  The gospel is still true, and yes, I still believe that this was all meant to be.

I'm finding that this time around with unemployment (or semi-unemployment, now that I have a job), I'm looking at a lot more options than I have before.  Instead of feeling like I've been thrown into a barren land with no hope, I feel like I've been handed an empty canvas.  I'm still not entirely sure what I'm supposed to paint, but it still feels (rather intensely, actually) that I'm still holding the canvas, and my audience (whomever that may be) is just waiting to see what I'll begin painting.  The opportunities, though a bit more scarce due to the state of the economy, are still coming steadily, and I'm taking the chance at everyone coming my way.  And though usually, when I find myself in this spot, I have felt at least a sense of direction, right now, I feel like I'm just standing before a feast of opportunity, not knowing what I should start with.

Maybe all that was from the drugs I've been smoking lately.  Yeah...  It was a bad trip. (just kiddin', that crap's not for me)....  Aaaaannnyway....

hehe...  Wow.  It's a bit late, and apparently my brain has stopped functioning.

All is well at the Jones Homestead, and my wife is still beautiful, my kids are still rambunctious, the church is still true, my family is still supportive (although, I'll bet half of my family doesn't even know I was unemployed and am still job-hunting), and Christ is still my savior.

...and I know He has a plan for me - which does not include eternal failure.

Oh, oh, oh!  Also, if you're in the SLC area and wanna hear some great tunes, come watch my band, Mimic play at the SLC RioTinto Stadium around 6:00pm tonight!  (That's Friday night)

July 3, 2009 :: Utah, USA  

July 2, 2009

George Kargiotakis

Using Firefox Password Exporter

I am using the Password Exporter addon for Firefox to sync my passwords between my various Firefox installations (2 OS on the laptop, 2 OS on the desktop and one for portable firefox on a usb stick). I am using it with version 3.0.X and 3.5 just fine.

I have created a shell script that finds the differences between two exported password files and creates a new xml with the differences of the two so that one can edit it and pick the ones he wants imported.
File: ff-password-sync.sh
To use it follow these two steps on each firefox installation:
Firefox->Tools->Add-ons->Password Exporter->Preferences->Export Passwords
Then use the script (you need bash and mktemp):
$ ./ff-password-sync.sh laptop-password-export-2009-07-01 dektop-password-export-2009-07-02
If it runs successfully you should have 2 files in your home dir:
ff-password-sync.diff: Contains the differences of the two files in diff format
ff-password-sync.xml: Contains the unique username password combinations that are missing
Edit ff-password-sync.xml to possibly remove entries you don’t want imported and then go to:
Firefox->Tools->Add-ons->Password Exporter->Preferences->Import Passwords
and load ff-password-sync.xml

If you engage in this process it’s almost certain that you will hit this bug:
“Can’t add a login with both a httpRealm and formSubmitURL.’ when calling method: [nsILoginManager::addLogin]“

The fix is provided by a user on his blog: Fix for Firefox’s Password Exporter Add-on

July 2, 2009 :: Greece  

Sean Potter

Wishing for more KDE integration

An effective Linux desktop is made up of various sets of software, using various programming languages, paradigms, toolkits, and more. The two major desktop environments competing for top dog are obviously KDE and GNOME. I've been using KDE since the 2.x days, and it was X-Windows before that. I have to admit that KDE4 is bringing a lot of improvements in desktop usability, but there's a lot of non-KDE programs out there that I use on a daily basis that simply don't work as nicely as I'd like to see.

  • Firefox - My only real complaint about Firefox is the lack of support for the QT toolkit. Yes, there is a project going on to port it over to QT... sadly, the progress is slow and the usability isn't there yet.
  • Thunderbird - KMail isn't that bad, but it randomly crashed on me. For that reason, I use Thunderbird. Again, no QT support. My other complaint is that the "Message Checker" plasmoid doesn't support Thunderbird for checking mail.
  • Pidgin - Kopete doesn't stand a chance against Pidgin. It's a more solid codebase, and much more widely supported. I think Kopete would benefit more if they build a QT client for libpurple, Pidgin's backend.
  • OpenOffice.org - This has shown the most improvement in this area over all the other programs I've listed so far. QT4 support finally arrived a week or so ago, and now I'm just waiting for Gentoo to update Portage. KOffice is a very nice office suite, but OpenOffice.org is a much more robust application.

Reasons such as those above are what have sparked my interest in developing a QT4 client for XMMS2. I'm hoping that in the near future we'll see more KDE/QT4 compatibility with some of these programs I've listed.

July 2, 2009

Patrick Nagel

VirtualBox 3 – SMP for guests

VirtualBox – my current favourite desktop virtualisation software – has been released in version 3.0.0 two days ago, so I gave it a try. The most interesting new feature in this new version is the “Guest SMP” support. It finally removes the limitation, that a guest can only work on one host core (which means, when you have a 4-core host CPU, the guest could only run with 1/4 of the speed).

The documentation is not very clear about what “Guest SMP” really does – it could, for example, just show multiple CPUs to the guest, but still only use one host core. To make sure that my assumption of VirtualBox 3 actually making it possible to assign multiple host CPUs/cores to the guest, so that it can actually run faster, I did a quick test. I started by making one of my Linux VMs a dual CPU VM:

vbox3_multi_cpu2

In the VM, I then started to build the Linux kernel, once with make -j1 and once with make -j2. This is my CPU usage monitor on the (2-core) host, which shows both cores’ usage combined:

vbox3_multi_cpu

In section 1 of the graph, only one compiler process is running (make -j1). At the end of section 1 I aborted the building process and (in section 2) I typed in make -j2. Thus, section 3 shows the CPU usage when two compiler processes are running simultaneously in the VM. So my assumption was correct, it is now possible to make all of the host’s processing power available in a VM.

Thanks, VirtualBox team! (I won’t address the company behind VirtualBox, since this would probably cause my post to be outdated before I can press the “Publish” button). Lets just hope that this great project will see further development, it is currently the best desktop virtualisation project available, in my opinion. It would be even greater if all of the functionality was available in the Open Source version though. This would ensure that, no matter what the current company behind VirtualBox decides to do with it, development could go on.

July 2, 2009 :: Shanghai, China  

July 1, 2009

Steven Oliver

24″ HP Monitor vs Fonts


What on earth is it about monitors that makes them all render my fonts differently??

At work I have twin DELL 19″ 3:4 LCD displays. At home a 24″ HP 16:9 LCD and they seem to render things completely differently. It’s enough to drive me nuts. One thing of note though is I only really seem to have trouble with this using gVim. Is the font rendering code in vim so old that switching monitors ruins the font??

Enjoy the Penguins!

July 1, 2009 :: West Virginia, USA  

June 30, 2009

Dirk R. Gently

Restore Settings on a Broken Firefox


When people have a problem with Firefox I’ve seen many people will resort to deleting their old profile (or folder) and creating a new one. This works, but doing this though will get rid of any passwords, history, bookmarks… you may have. I recently deleted the Microsoft fonts on my installation and Firefox began to display alot of site with monospace – thought I was still in vim :) . Having used Firefox quite a bit, getting a new profile was a good idea anyhow as cruft and buggy configs can slow down the browsing experience.

Details

First you’ll need to get to your Firefox configs:

cd ~/.mozilla/firefox/

Backup your old profile and profile list:

mv xxxxxxxx.default{,.bck}
mv profiles.ini{,.bck}

Create a new profile:

firefox -CreateProfile <profilename>

This command will tell you the name of the new folder. Copy important information to the new profile:

cd *.default.bck
cp places.sqlite key3.db formhistory.sqlite signons3.txt persdict.dat content-prefs.sqlite ../*.<profilename>

This will transfer your bookmarks, browsing history, form entries, passwords, personal dictonary changes, and page zooms. There might be a couple other things you’d like to add (possibly your firefox preferences), take a look at Transferring data to a new profile.

June 30, 2009 :: WI, USA  

Daniel Robbins

10th Anniversary of Gentoo

NeddySeagoon and I have been trying to figure out the official 10th anniverary date of Gentoo, and here are the dates I've figured out so far:
  • July, 1997 - Started a new position at University of New Mexico, was using Debian 1.3
  • Nov, 1998 - Was using/developing for Stampede Linux at home, but had not (yet) started Enoch?
  • Apr, 1999 - Was working on Enoch - wrote xpak .tbz2 code that is still in Portage
  • May 18-27, 1999 - First version of Enoch released, according to LWN.net. My blurb for Enoch: "Enoch is an advanced GNU/Linux distribution for the x86 PC Architecture, designed to bring your Linux experience into a new dimension. Or something like that."
  • Aug, 1999 - My new dual Celeron mobo would not run Linux, went to FreeBSD, Achim Gottinger kept Enoch going
  • Late 1999 - Must have came back to Enoch and done the Gentoo name change right about now - the "Gentoo" name was Bob Mutch's idea - started incorporating some FreeBSD ideas into Enoch - Portage (as we know it today) was born.
  • July 26, 2000 - Gentoo 1.0 release "imminent", cvs online, rsync "coming soon"
  • Nov 3, 2000 - Gentoo 1.0 Release Candidate 2
  • Dec 11, 2000 - Gentoo 1.0 Release Candidate 3
  • Aug 14, 2001 - New Gentoo Logo/Web site debut - designed by me! Still in use today! :)
  • Feb 16-17, 2002 - Was in Brussels, Belgium to attend FOSDEM
  • Mar 31, 2002 - Gentoo Linux 1.0 Released !!!
  • May 10, 2002 - Gentoo Listed as one of the top 10 Linux distributions on DistroWatch
  • Apr 8, 2002 - Gentoo Linux 1.1a released :)
  • Jun 10, 2002 - Gentoo Linux 1.2 released :)
So, we're thinking of calling "late 2009" the official 10th anniversary of the birth of Gentoo - whaddya think? If it sounds good, we need to get the party planning committee together...

June 30, 2009

Roy Marples

ISP Changed!

I as blogged about earlier I've now changed ISP to  Goscomb Technologies. Quite a straight forward migration and although the downspeed isn't much better, it's a lot snappier which implies I was congested on the Demon line. However, my upload speed has doubled, which is good news for this server :D

There maybe some more downtime in the near future as I may change registrar as I'll be getting native IPv6 later today (yay, no more  tunnel!) and my current one ( 1&1)don't appear to support IPv6 in their domain / dns setup.

June 30, 2009

George Kargiotakis

nicotine+ 1.2.12 ebuild

I’ve uploaded an ebuild for the latest version of nicotine+ on gentoo’s bugzilla. Nicotine+ is a great p2p app written in PyGtK2 to connect to the Soulseek network.

I’ve also added psyco as a USE flag since it makes nicotine+ faster…but sadly, a bit more unstable as well. Test it and see if it makes any difference to you.

Ebuild: nicotine+-1.2.12.ebuild

June 30, 2009 :: Greece  

June 29, 2009

Jason Jones

Zend Studio on Gentoo AMD64

Since I've been job-hopping for the last bit, I've had the chance to install fresh gentoo builds on quite a few 64-bit computers in the last couple of months.

I've also been looking at different IDEs for PHP development.  After using jEdit now for close to 5 years, I've gotta say the one which impresses me the most is Zend Studio for Eclipse - (freely available (albeit crippled) at Zend.com).

The first computer I installed it on, didn't give me any grief at all.  It just worked.  The next few, however, because I was installing from scratch, gave me a few problems, so I thought I'd jot down what is needed in order for ZendStudio to properly install and execute.

If you have a 64-bit computer, the following libraries are needed, but never explicitly requested.  I'm pretty sure if you have a 32-bit computer, everything will work just fine out of the box.

  • emul-linux-x86-java (required for installation.  Installation will fail without it)

  • emul-linux-x86-gtklibs (required for execution.  If not there, ZendStudio will simply exit right after invocation, with no GUI loading at all.



After those two are installed, (along with some sort of X-Window system, of course) things should work just fine.

Hope this helps someone.

June 29, 2009 :: Utah, USA  

Daniel Robbins

Metro 1.4.1 Released

Metro 1.4.1 has been released! I have new documentation online, now hosted on funtoo.org:

June 29, 2009

Dirk R. Gently

Keyboard Template


I needed a keyboard template and I couldn’t find any so I made one (uh kinda). The outline was made by aphasia100stock:

Notes

  • Converted from .ai format to .svg
  • Removed inner borders
  • Added Letters, Numbers, Symbols
  • Added guidelines to be able to reference keys.

Download svg

Thanks aphasia100stock for the outline.

Enjoy!

June 29, 2009 :: WI, USA  

June 28, 2009

Dion Moult

ThoughtStall

The ThoughtScore project is another gypsy on my to-do list along with the BMR. It seems as though the world of 3D graphics and I are drifting slowly apart. It’ll be such a pity to let it go, so I want to make a serious effort and continue the amazing progress I once had on ThoughtScore.

You can see the pitiful post I made after scrolling through history on this page:

http://blenderartists.org/forum/showthread.php?t=88517&page=3

Revive ThoughtScore! I need a plan, a design, something huge! Grab me some pencil and paper, and let’s bring my vision into a reality! I have a holiday coming up, and I hope I can approach this through another angle which should allow me to continue production.

The next post will be in a week’s time because I am going to be stuck in a jungle throughout next week. You will then receive posts in this order: 1) The Trek, 2) New Perspective Magazine Released, and 3) What is becoming of Eadrax.

Related posts:

  1. ThoughtScore Updated!
  2. A little (re)introduction to POSE2 and ThoughtScore
  3. Final call for Eadrax testers.

June 28, 2009 :: Malaysia  

June 27, 2009

Daniel Robbins

Anti-Slowloris DOS patch in Funtoo

I've committed an anti-slowloris patch to Funtoo, in apache-2.2.11-r1. I recommend that Apache users upgrade to this new version. (see http://bit.ly/WGSvD)

All still-affected MPMs (everything except prefork) have been masked. The intent here is to force you to use an Apache configuration that is not vulnerable to slowloris. If you are in a situation where slowloris cannot affect you, you can manually enable the other MPMs to gain access to them.

I tested the anti-slowloris patch myself on a Drupal installation I had on my machine. Without the patch, slowloris was able to make Apache unresponsive immediately. With the patch, Apache was a bit laggy but continued to run with no problems.

June 27, 2009

Sean Potter

Weird Dream

I came home from Sarah's this morning after sleeping for a few hours. In those few hours, I had what seemed to be a weird dream... but not?

Unfortunately, all I can remember is that I was standing inside a classroom full of people standing up. I turned towards the door and saw my friend Chris Hernandez standing there. I gasped, then tried to move towards him, but he ran out the door. After I left the classroom, I woke up and couldn't manage to fall back asleep.

Chris committed suicide in 2007... and I haven't seen him since. It's so distinctly odd that I would see him in a dream like that. Especially when I woke up from it and couldn't get back to sleep... almost like a ghastly feeling was tingling the back of my head. Visitation from an old friend, or a sign of something to come?

June 27, 2009

June 26, 2009

Daniel Robbins

Apache Slowloris DoS is Nasty - Protection Guide in Works

The Apache SlowLoris DoS is a pretty nasty thing. If you are running Apache (who isn't) then I strongly recommend you look carefully at the link above, learn about how this exploit works, and ensure that your infrastructure is safe.

If you are running Apache or IBM Web servers that are directly exposed to the Web, you are vulnerable. If you have a load balancer in front of your Web site (most of us don't) you may still be vulnerable. Your load balancer needs to be configured to protect against this DoS, many (including Cisco) need to be told to do so and do not protect by default. So test to ensure your infrastructure is protected.

From what I've read, if you have a squid proxy in front of Apache, you should be safe, but we have not confirmed this yet.

I'm planning to get a SlowLoris Protection Guide available early next week which will help to provide detailed information on how to protect against this particularly nasty DoS.

I also think that the Apache team's historical response to this very preventable issue has been horrendous - we all run Web servers in the real world, not some theoretical happy world, and it's Apache's job to ensure that it manages its own resources properly. For future Web-related efforts, I think I'm going to be avoiding Apache and looking at the Cherokee Web Server.

June 26, 2009

Daniel de Oliveira

menelkir


The Dante’s Inferno Test has banished you to the Seventh Level of Hell!
Here is how you matched up against all the levels:

Level Score
Purgatory (Repenting Believers) Very Low
Level 1 – Limbo (Virtuous Non-Believers) Very Low
Level 2 (Lustful) Very High
Level 3 (Gluttonous) High
Level 4 (Prodigal and Avaricious) Extreme
Level 5 (Wrathful and Gloomy) Extreme
Level 6 – The City of Dis (Heretics) Extreme
Level 7 (Violent) Extreme
Level 8- the Malebolge (Fraudulent, Malicious, Panderers) Very High
Level 9 – Cocytus (Treacherous) Extreme

Take the Dante’s Inferno Hell Test

June 26, 2009 :: São Paulo, Brazil  

Brian Carper

Clojure, SLIME, ODBC, SQL Server

I had a lot of trouble connecting to an MS SQL Server at work via Clojure. Java 6 comes with a JDBC-ODBC bridge which worked fine from a Clojure REPL at a command prompt, or from inferior-lisp in Emacs, but in SLIME it would hang every time I tried to connect and I'd have to kill Java. Couldn't for the life of me figure out why.

I got it to work eventually by using Microsoft's own JDBC driver, which you can download here.

Once you put the downloaded .jar file on your CLASSPATH (in my case, sqljdbc4.jar) you can connect like this:

user> (def db {:classname "com.microsoft.sqlserver.jdbc.SQLServerDriver"
               :subprotocol "sqlserver"
               :subname "//server_hostname;database=SomeDatabase;user=SomeUser;password=SomePassword"})
#'user/db
user> (use 'clojure.contrib.sql)
nil
user> (with-connection db 
        (with-query-results rs ["SELECT * FROM whatever"] (prn rs)))
... results ...

Posted for the sake of Googlebot and for my own future sanity.

June 26, 2009 :: Pennsylvania, USA  

Daniel Robbins

Initscripts - Keeping It Simple

I've been reviewing Roy Marples' 0.5.0 release of OpenRC for inclusion in Funtoo (we're currently at 0.4.2,) and the big change with 0.5.0 is that Roy has ripped out the existing networking functionality, and replaced it with something a lot simpler.

I think this is a step in the right direction, but I'm leaning towards "going all the way" and ripping out networking support entirely, in favor of having Funtoo-supplied /etc/init.d/net.* templates that actually call the route/ifconfig/ip/vconfig/brctl commands directly, and users can modify to suit their needs.

Why do this? Here are some reasons:
  1. WYSIWYG - no need to figure out some kind of distro-specific network configuration layer that is supposed to make things easier for you.
  2. It encourages (but does not force) users to become familiar with the ifconfig/ip/route commands, which is a good thing.
  3. It is the most flexible option, since it allows you do get as freaky with your network as you want.
  4. It allows users to leverage the dependency-based functionality in the initscripts for their own purposes - the dependency functionality was designed to be used by end-users.
  5. Theoretically faster.
  6. Self-documenting.
  7. Simpler.
  8. Reduces footprint of the initscript code (reduced maintenance.)
Now, here are some negatives, along with how I hope to address them:
  1. It's more complicated - Yes, slightly, initially, which means Funtoo network documentation needs to be written to help users. Several easy-to-use /etc/init.d/net.* samples need to be available for beginners. That will make things easy for networking newbies.
  2. Configuration gets stored in /etc/init.d rather than /etc/conf.d (where some might say it "should" be) - This, I do not really agree with, so I don't see it as a significant negative. I don't think that /etc/conf.d should be a mandatory design rule for storing configuration. For networking, putting configuration in /etc/init.d is simpler - users who like /etc/conf.d can still use it, and I can have our templates be usable with /etc/init.d or /etc/conf.d for configuration storage. And designing complex network configuration scripts just for the sake of getting all network configuration stuffed inside variables in /etc/conf.d is not a winning strategy.
  3. Not desktop-friendly - Some might say that Gentoo and OpenRC network configuration scripts isolate the user from the complexity underneath, and are thus better. In theory, this may be right - in reality, it creates another distro-specific configuration layer you need to learn, and developers need to maintain. And it's not significantly easier, really.
So, I think this is the right way to go. Let me know what you think.


June 26, 2009

Jason Salaz

Voice Post

June 26, 2009 :: Arizona, USA  

June 25, 2009

Matija Šuklje

TGJE report no. 3 — What I dislike on Jamendo

Due to my laptop being dead I am not behind my regular desktop and thus not seeing the statistics what I have listened to the most in the past weeks. So I will take this oportunity to reflect on what I dislike on Jamendo. There is not much, and its mostly just annoyances, but it is only fair to say it out loud and hope things improve.

For starters, I dislike the Flash player. There less volatile and more open technologies out there — e.g. The Yahoo! Media Player that is also being used by BlocSonic seems to be written in JavaScript/EcmaScript and feels nicer to me. I am even thinking of implementing it on my page.

The OGG/Vorbis torrents are sometimes seedless, which makes it sometimes a bit of a drag to wait days or even weeks for an album to finally download.

Already after my first TGJE report mareviq suggested to me Rob Costlow — a great pianist who offers his music under a CC license. Sadly though, his music can be heard on Jamendo, but not downloaded. After I contacted Jamendo with that problem, they responded that Rob Costlow is an exception. As someone who does have some idea of IP law, I find this really odd. Considering Rob Costlow has published his works under a CC BY-NC-SA license at least on Magnatune, it should not have been any problem with anyone who got the music legally to share it with others.

But even graver then the above case is HYPE — a french band whose music is not available on Jamendo anymore at all. From what I could gather from e-mailing Jamendo, is that HYPE got a record deal and the label gave the band an ultimatum to get all their free music offline. If anything, this looks like a school example of a copyright violation. Sure, an artist has a right to revoke his work under certain conditions, but a better commercial exploitation is hardly one of them. Again, since they (most probably) had their work on Jamendo under a CC license, it is a violation from their part to take back the rights that they already gave away to the public.

This brings me to free singles of non-free albums — lately I have found a lot of singles on Jamendo and when looking at the artists' sites I usually found out they have full albums released as CD's and nowhere any notice of any CC. Quite a lot of these I found were promoted by Open Music Wire. After looking at the Open Music Wire website it seems to me that in some cases both Open Music Wire's and in turn also Jamendo's services are being misused for promoting non-free labels and artists, by CC'ing just one track. This gives me very mixed feelings. On the one hand it does promote some lesser known artists. But on the other hand, it (ab)uses free services to tease people into buying non-free content. Moreover since CC is not mentioned anywhere on the artists' homepages, I wonder what would happen if, e.g. a user would get sued for copyright infringement of a track that is under a strict copyright on the CD, yet freely available under a CC license on Jamendo or Open Music Wire.

In other news: Since I started this experiment I have listened almost exclusively music from Jamendo. This will probably change a bit in the future, not because there is much wrong with Jamendo, but just because after proving that one can survive for a month of listening only to music served by Jamendo, I will go on with a normal life and expand TGJE over other free netlables non-discriminatory. This way I will try to make a user case of a normal, internet-savvy music lover.

hook out >> listening to Jamendo Radio on my dad's laptop and slowly going to bed
<!--break-->

June 25, 2009 :: Slovenia  

Sean Potter

New Beginnings

I deleted all my old posts. It was about that time. I have a record of them all for myself to look at, but there's no need for them to plague the internet any longer. I figured it was time for some change, as my life has been so plagued with trouble these past few months. Maybe this is exactly what I need.

Things are going well. I'm looking for a new job, and contemplating how I'd like to finish up my bachelor's degree. For the time being, I think I'm going to stick with the restaurant industry. Honestly, I love the people, and I love the hours. A 9-5 job seems so boring to me, and I've never been one to get up early more than two days in a row.

I have some exciting projects I'm slowly working on. Obviously, number one is BIOSLEVEL, my group's product review site with an open source-twist. It's down at the moment, but I promise it won't be down much longer. I just need to finish interfacing with phpBB3 and make a few other small adjustments before it will live again.

Also in my newfound spare time, I started working on a QT4 XMMS2 client. I don't have much accomplished outside of an interface, but it's promising. I'm not a fan of Amarok, and using a GTK-based audio player just isn't pretty. I'd like to incorporate many different ideas into it such as Last.FM browsing, multiple playlists, iPod support, and much more. Once I have a little more going, be certain that there will be a post here about it

June 25, 2009

Dirk R. Gently

Getting Help from Console


If you’re in console (aka virtual console) doing an install or repairs on a system, it’s good to know how to get help if problems occur.

“Ground Control…”

To get help in console you can use a chat client. Read this page on how to set up irssi – a terminal/console IRC program. The guide will walk you through setting up irssi and connecting to freenode where many Linux distribution chat channels are located.

“Waiting for details, Houston…”

When you tell the people in the chat-room what your problem is, sometimes they will need to know additional information. This could be the output of a command or the contents of a configuration file. To do a command without leaving irssi do Ctrl+Alt+F2 (F3, F4… can also be used) to enter another console, then enter the command.

Be better not to have to write everything down on a notepad and then type it into irssi, this is where it becomes useful to use a collaborative debugging tool like pastebin. Pastebin is a website that temporarily holds configurations, bug outputs… that you can refer other people to get help. There are several tools that can be used from the command line that can send files to a pastebin service, for example pastebinit. Add pastebinit from your distro, then upload a file. For example, your xorg.conf file:

pastebinit /etc/X11/xorg.conf

For uploading the output of a command, first you have to put it into a file:

fdisk -l &> partitions.txt

&> will redirect all output to a text file (both standard output and error output) and now it can be uploaded.

“I have visual…”

Occasionally you might need to actually show a picture of what your question is about (e.g. if you have a question about a console-based installer). For this you can use fbshot. fbshot is a framebuffer screenshot program. To take a screenshot of the first console (Ctrl+Alt+F1):

fbshot -c 1 console1.png

Then you can use links and a image-hosting website to upload the image.

June 25, 2009 :: WI, USA  

Dion Moult

Another Perspective Preview

…and here I am for yesterday’s blog post with a quick new preview on the Perspective magazine: the centerspread. Lots of things going on, progress on Eadrax being made, my cousin, his wife and baby were staying over for a while, and I’m going on a monday-friday camp/trek/survival next week, so this’ll likely be one of my last posts for a while. Here it is in all its picture-speaks-a-thousand-words glory:

snapshot3

Oh, by the way I don’t take any credit for the photography.

Related posts:

  1. Perspective Nov 2008 Distributed
  2. Perspective Magazine Feb 09 Released!
  3. Perspective in progress

June 25, 2009 :: Malaysia  

June 24, 2009

Daniel Robbins

I'm on Twitter

In addition to keeping my blog more up-to-date, I've also decided to post tweets to my Twitter account (funtoo) at least daily.

I have to admit that I haven't been consumed by Twitter hysteria - if you're someone who really loves Twitter, and think I should totally love it too, please feel free to try to enlighten me about how awesome it is. :)

Until then, I'll be tweeting regularly, so that I am at least giving it a chance :) Please send any tips for newbies my way.

June 24, 2009

Quiet but busy

I haven't blogged in a long time, but strangely there has been a ton of stuff for me to blog about. I've just been very busy and need to get back into the habit.

For one, I am now working full-time on Funtoo-related endeavors (no longer with E*TRADE) - I've been spending my extra time catching up on much-needed geeky things behind the scenes, which I hope to be able to share with you soon.

For Metro, even though I haven't made an official release in a while, there have been a ton -- a TON -- of changes in the git repo. Fortunately, it still mostly works the same and the quick start guide should still mostly be applicable. There is still much to do with Metro, and my focus over the next month or so will be on the parser and its next evolution. I am removing *all* existing conditional logic (i.e. "[when ...]" and ["collect foo when ..."]) from Metro itself, and replacing it with something that should work quite a bit better and be a lot more powerful. A Metro without conditionals! Crazy, huh? Turns out we don't need them.

I'll try to post more here soon.

-Daniel

June 24, 2009

Jürgen Geuter

Porting as iterative software development (who cares whether it's Mono?)

A few days ago I wrote about people complaining that somebody was "wasting time" by porting Tomboy from Mono to C++ in a project called Gnote. Other people like it cause it frees them of the danger that is Mono and whatnot.

So what should we call this port of a program from one language to another one? Waste of time? Rescue from the patent-trap? How about we are all revolutionary and call it just what it is? Software development.

Let's just leave the snake pit that the whole Mono discussion is for a bit and look at something a lot less overcharged with FUD and suspicion, let's look at Python development.

In Python you usually write Python code to implement the functionality you need (wow who saw that one coming? ;-) ), but since Python is not really the fastest running language (it's interpreted and lacks a JIT after all [at least CPython does]) it's quite usual to port your library to C for the heavy lifting: After you have the functionality working (and you've got unit tests of course) you start rewriting parts of the library in C to be able to gain native speed. Most cryptographic libraries in Python go that route because crypto-algorithms are bloody expensive.

Does anyone call it a waste of time? No. Why? Because even if the direct porting might not even be a lot faster it will probably be in the end. It's just the normal process of development.

When I need to create something new, I first start building some prototype of sorts. To build prototypes I use the tool that allows me to get the prototype up to where it needs to be as quickly and efficiently as possible: When I need to design a GUI, I use paper or a whiteboard, when I wanna design a library I hack together a quick implementation in a dynamic language that makes developing things in an agile way easier (for me that means usually Python though Prolog has been good to me at times, too). Prototyping is a really important step in development because only when you prototype you can really see whether the basic idea that your mind created actually works.

Now let's go back to the whole Gnote thing. We have a working app, why would someone take a different language/platform to implement it? Well cause nobody (probably someone will come and say they do but I think most people don't ;-) ) prototypes in C++ because C++ isn't great for that. All the little things you have to manage make it harder to get to the point where the prototype is good enough so you use something else. Maybe Mono. Now we have an app that works, which means the file format to store things works, basic conceptual problems have been ironed out. The prototype has done its job. Of course we can keep it, develop it further but maybe someone thinks it's time to take what we learned from the prototype and reimplement it in a language that allows things to run faster, less resource consuming and whatnot. That's not a bad thing and not even against the prototype implementation (Tomboy in this case), it's just a new way to look at what we've learned to see whether we gain something from doing it differently.

How often have we read about people wanting to have some application or framework rewritten in another language: "Oh I'd love to use RubyOnRails but Ruby is just so slow!", "Oh I wanna use Django, but Python isn't installed on my webhost, I wished it was implemented in PHP!", "I really like Eclipse but there's no good JRE for my platform and it doesn't run well, I wished it was implemented in C!"? Why do we treat it differently when Mono is involved?

Why does the whole Mono discussion always seem to go towards FUD and flames and people accusing each other of conspiracies? Just look around, it's a completely normal process, one that happens every day all around everyone who develops.

June 24, 2009 :: Germany  

June 23, 2009

George Kargiotakis

Filter out advertisments from greek sites using adblock plus

I’ve decided to start a filter for adblock plus to filter out advertisements from Greek sites.

You can find more information on subscribing to the filter on the page: Greek adblock plus filter.

I started the list a long time ago with some personal filter for sites I visit the most. In order to enrich the list I searched and found a list with the supposedly “top 50″ greek sites (regarding traffic), so I visited them and started adding filters to reduce the ads on them.

I warn you though, the filters are a bit strict…and I don’t like flash ads…I really don’t. I hope you like the list.

Please contact me, by email or by commenting on Greek adblock plus filter page to add your own custom filters to the list.

June 23, 2009 :: Greece  

Kevin Bowling

Mirroring Fedora

Introduction

This post details setting up your own private mirror of Fedora’s repos.  There are many ways to do this, but this method is by far the best for heavy usage.  By using MirrorManager, clients in your IP range need no custom configuration.  Roaming laptop users automagically hit your mirror while on the premises, yet use the public infrastructure elsewhere.  Setup isn’t exactly hard, but it isn’t well documented so I’ll write about my experience here.

Some background info.. we have at least 50 Linux desktops, laptops, servers and VMs running about half Fedora 10 and half Fedora 11 at work.  Due to the number of systems, breadth of packages used, and desire to quickly update when new releases are out, I decided on a full mirror setup.  If you only have a handful of systems, you may be better off simply using a general purpose caching proxy like Squid, perhaps telling MirrorManager to point to it.

This guide should be used in addition to http://fedoraproject.org/wiki/Infrastructure/Mirroring which has some background info.

Initial setup and mirror

First, get prepared by installing MirrorManager-client, which contains the report_mirror script you will need.  If your mirror isn’t running Fedora, you can clone the source of this app from their GIT repo.

yum install mirrormanager-client

You’ll be using rsync, a sysadmin’s best friend, for efficient mirroring.

Set up a shell script like mine below (d0mirror.sh) one level up from where your mirror will be accessible (http, ftp, rsync, nfs - covered later).  This one mirrors against kernel.org.  Choose a mirror close to you on the Internet.

rsync -vaH --exclude-from=fedora-excludes.txt --numeric-ids --delete --delete-delay \
 --delay-updates rsync://mirrors.kernel.org/fedora-enchilada fedora-mirror
report_mirror

And a text file (fedora-excludes.txt) excluding things you don’t want/need.  Take a look through a public mirror and decide if you want to eliminate anything else.  You may want to remove the *.iso line below if you want users to be able to pull disc images from this box.  Otherwise, this is probably a good list for most people.  You can exclude all of linux/updates/testing/ if you don’t enable the testing repo on any of your machines.

**/debug/**
**/alpha/**
**/source/**
**/SRPMS/**
**/*.iso
**/ppc/**
**/ppc64/**
linux/core/**
linux/development/**
linux/releases/7/**
linux/releases/8/**
linux/releases/9/**
linux/releases/test/**
linux/updates/8/**
linux/updates/9/**
linux/updates/testing/7/**
linux/updates/testing/8/**
linux/updates/testing/9/**

Run your shell script and sit back for up to a day or two depending on your connection speed.  My current mirror weighs in at about 80G.

Internal distribution

While you wait for sync, decide how you want to run the service internally.  HTTP is nice because it is easy for users to browse and decently quick with keep-alive.   Using NFS, rsync, or FTP may be a bit more efficient if you are worried about this.  You can list several URLs in MirrorManager for the best of all worlds.

Add the following to your Apache configuration if you decide to use HTTP:

Alias /fedora/ "/mnt/ar1/fedora-mirror/"

AddType application/octet-stream .rpm

<Directory "/mnt/ar1/fedora-mirror">
    Options Indexes FollowSymLinks
    Order allow,deny
    Allow from all
</Directory>

<LocationMatch "\.(xml|xml\.gz|xml\.asc|sqlite)">
    Header set Cache-Control "must-revalidate"
    ExpiresActive On
    ExpiresDefault "now"
</LocationMatch>

Set up any other services of you choice to push that directory out in addition.

Working with MirrorManager client and server

Next, open up /etc/mirrormanager-client/report_mirror.conf.  Take notice of the site name, password, and host name.  You will need to set these up in MirrorManager in a bit.  The paths here are all local and used by report_mirror to check what you have available.

# if enabled=0, no data is sent to the database
enabled=1
server=https://admin.fedoraproject.org/mirrormanager/xmlrpc

[site]
# if enabled=0, no data about this site is sent to the database
enabled=1
name=<yoursitename>
password=<yourhostpassword>

[host]
# if enabled=0, no data about this host is sent to the database
enabled=1
name=x345-a2.internal
# if user_active=0, no data about this category is given to the public
# This can be used to toggle between serving and not serving data,
# such enabled during the nighttime (when you have more idle bandwidth
# available) and disabled during the daytime.
# not passing it means leave it alone in the database.

[stats]
# Stats are only sent when run with the -s option
# and when this section is enabled.
enabled=0
apache=/var/log/httpd/access_log
vsftpd=/var/log/vsftpd.log
# remember to enable log file and transfer logging in rsyncd.conf
rsyncd=/var/log/rsyncd.log

[Fedora Linux]
enabled=1
path=/mnt/ar1/fedora-mirror/linux

[Fedora EPEL]
path=/var/www/html/pub/epel
enabled=0

# lesser used categories below

[Fedora Web]
enabled=0
path=/var/www/html/pub/fedora/web

[Fedora Secondary Arches]
enabled=0
path=/var/www/html/pub/fedora-secondary

[Fedora Other]
enabled=0
path=/var/www/html/pub/alt

# historical content

[Fedora Core]
# if enabled=0, no data about this host is sent to the database
enabled=0
path=/var/www/html/pub/fedora/linux/core

[Fedora Extras]
enabled=0
path=/var/www/html/pub/fedora/linux/extras

Log into https://admin.fedoraproject.org/mirrormanager, creating a new account if you need to.  Add a new site with the same name as the config file from above.  You’ll set the site password here, and make sure to check the ‘private’ box if this is only for internal users.  Now, add a host under this site.  The name here should probably be a FQDN of your actual mirror, even if it is internal only (i.e x345-a2.internal from my example above).  Once that is done, add a “site-local netblock”.  This is your public IP network/netmask or network in CIDR notation.  If you only have one public IP, it will be in the format nnn.nnn.nnn.nnn/32.

Almost done.  Now, click Add Category.  “Fedora Linux” is the only one you are concerned with if you followed all the values in this guide so far.  Add the others if needed.  Tell them your upstream source (rsync://mirrors.kernel.org/fedora-enchilada from above) and then your internal URL (http://x345-a2.internal/fedora/linux for my setup).

Conclusion

Once your rsync is complete and report_mirror is done, you should see clients start hitting your box.   Don’t forget to add your mirror script (domirror.sh from above — rsync and report_mirror) to cron!  You may wish to join the private ‘fedora-mirrors’ mail lists to be informed of new releases and changes.

The best thing is that it works across all package requests, including new machines, roaming users,  ‘preupgrade’, etc.   All in all, pretty nifty!  Your users will love you when their upgrades are almost instant!  The Fedora infrastructure is set up very well for mirroring, public and private, and this is how the project copes with the huge demand for new releases.  Comment away if you need clarification or help.

Share and Enjoy: Digg del.icio.us Slashdot Facebook Reddit StumbleUpon Google Bookmarks Print this article! E-mail this story to a friend! Turn this article into a PDF! TwitThis

Related posts:

  1. Fedora 9, KDE 4.0 done right Wow! I just downloaded the Fedora 9 KDE live spin. ...
  2. Syncing Directories with Multiple Computers I have a laptop, a workstation, and a server at...
  3. Kernel developers don’t get Xen The recent bruhaha surrounding Xen on LKML (http://lkml.org/lkml/2009/6/2/475) is really...

June 23, 2009

June 22, 2009

George Kargiotakis

Using halevt to automount media and make them appear on ROX desktop

With the recent addition of halevt in Gentoo’s portage it is now relatively easy to automatically mount media like USB sticks and CD/DVD discs on /media.

What I wanted to do was to emulate my previous set of configs and scripts that ivman used to create icons of automatically mounted media on ROX desktop (called pinboard). I am using ROX pinboard on top of my favorite window manager, fluxbox.

The idea is that halevt is started by the fluxbox startup config file and when a new device is attached to the computer, halevt config calls a script that creates an icon on the ROX pinboard using ROX rpc. When a device needs to be removed ROX pinboard is configured to call a special eject command that checks for a couple of things before unmounting the device and calling the script to remove the icon from ROX pinboard.
Apart from automatically mounting/unmounting of devices I have also added a nice option in the halevt config to unmount and eject the CD/DVD drive when the eject button on the device is used and of course when the CD/DVD is not in use. That emulates a bit the windows behavior that so many users have gotten used to.

Since the script used by halevt involves a lot of file reading/writing and parsing I thought it would be wise to convert my old rox.panelput bash script to perl. And I was correct, the speed difference, even for such simple tasks is more than noticeable.

The installation process. Please take notice of the user executing the commands, $ is for normal user, # is for root:
0) create /usr/local/bin/ path and put it in your shell’s PATH
# mkdir /usr/local/bin
$ echo "export PATH=$PATH:/usr/local/bin/" >> ~/.bashrc

1) install halevt
# echo "sys-apps/halevt ~x86" >> /etc/portage/package.keywords
# emerge halevt


2) create ~/.halevt/HalevtConfigActions.xml in your home directory:
File: HalevtConfigActions.xml (right click->Save-as)

3) Create /usr/bin/eject.hal. Take notice that the script uses bash and not dash!
#!/bin/bash
if [ -z $1 ]; then
echo "Usage: eject.hal "
exit
else
echo "$1" | egrep "^/dev"
if [ "$?" == "0" ]; then
#echo "Device First, find mount point"
TOSCAN=`echo "$1" | sed -e 's/ /\\\\\\\\040/g'`
TOUMOUNT=`grep "$TOSCAN" /proc/mounts | cut -d" " -f2`
UDI=`hal-find-by-property --key volume.mount_point --string "$TOUMOUNT"`
DISC=`hal-get-property --udi "$UDI" --key volume.is_disc`
/usr/local/bin/rox.panelput.pl Remove "$TOUMOUNT"
halevt-umount "$1"
halevt-umount -s
if [ "$DISC" == "true" ]; then
/usr/bin/eject -p "$1" &>/dev/null
fi
else
#echo "Mount Point First, find device"
UDI=`hal-find-by-property --key volume.mount_point --string "$1"`
DISC=`hal-get-property --udi "$UDI" --key volume.is_disc`
TOSCAN=`echo "$1" | sed -e 's/ /\\\\\\\\040/g'`
TOUMOUNT=`grep "$TOSCAN" /proc/mounts | cut -d" " -f1`
/usr/local/bin/rox.panelput.pl Remove "$1" nowait
halevt-umount "$1"
halevt-umount -s
if [ "$DISC" == "true" ]; then
/usr/bin/eject -p "$TOUMOUNT" &>/dev/null
fi
fi
fi

File: eject.hal

4) Create /usr/bin/rox.panelput.pl perl script. The script is written very simplistically to be easily understandable and changable.
File: rox.panelput.pl

5) Start halevt from fluxbox startup..make sure ~/.fluxbox/startup file contains at least the following, changing YOURUSERNAME to the one appropriate:
/usr/local/bin/rox.panelput.pl Restore
killall -9 halevt; halevt -f -u YOURUSERNAME -g plugdev &
/usr/bin/rox -p pinboard

6) go to ROX options and change ‘eject command’ to use eject.hal
rox-using-eject-hal-screenshot

That should be all. Upon fluxbox restart halevt should start and when you plug in your usb the set of scripts will create an icons on ROX pinboard for you.

Example:
usb-mounted-by-halevt-and-rox.panelput.pl

References: http://forums.gentoo.org/viewtopic-t-731555-highlight-halevt.html

June 22, 2009 :: Greece  

Jürgen Geuter

Linux Action Show Season 10, Episode 7 - Cleaning up the mess

Usually I do really enjoy the Linux Action Show: The production quality is good, they aggregate some stuff I might have not seen earlier and are most of the time just fun. I like that they have their own agendas and positions which often go out of the "linux mainstream", it gives people a good hook to start thinking about what's really right and good and what's just propaganda of any side of the discussion.

Today I listened to Episode 7 of Season 10 (the current one at the time of writing this) and I gotta say that that episode was just below any quality standard when it came to the "Mono Discussion".

A few remarks first: I have written about Mono before, coming to the conclusion that it is in fact not evil. I use a bunch of Mono applications (because they allow me to do things better than I could do them without these apps): I run Banshee, GNOME-Do, Tomboy and F-Spot without feeling "guilty" or "bad". Those apps rock and make my days better. I am not a "Mono hater" (though I'd probably avoid writing C# just as I would avoid writing Java just cause I don't like those languages, but that's a different topic).

The discussion was triggered by the Fedora Project deciding to drop Tomboy from the LiveCD and the default install and replacing it with GNote, which is pretty much a clone of Tomboy just written in C++. Bryan and Chris then went on and on, pushing each other into more and more extreme phrases. Now I know how it is sometimes and how getting into that kind of ranting can be fun, but that's why you can edit your podcast to make sure that you've got at least the facts straight. Let's do some cleaning up.

Complaint No.1: Duplication is waste of developer time



Both hosts complained that Hubert Figuiere, the creator of Gnote would just waste developer time replacing an app that works. They continued collecting all those little bugs they encountered in the different Linux distros they use, hinted at some MacOSX features the Linux kernel didn't have and that duplication was the reason for those "flaws in Linux".

This might look like it makes sense if you don't look to closely: You have X people, each putting in Y hours a month into Linux/FOSS. If one person spends Z hours to do something "useless" we lose those hours and have just X*Y-Z hours left for the "valid" stuff. Which would make sense if hours were that freely distributable which they ain't for a bunch of reasons: I don't know Hubert, but maybe he has no interest or skills to hack on the Kernel or patching it to duplicate some MacOSX feature? So his hours couldn't be spend in that area. But the more important aspect, one that always annoys me when it comes to Wikipedia deletionism, too: If somebody takes time out of his or her full day to do something, that is never futile or useless, if it was, that person wouldn't have done it. Whether Hubert just doesn't like Mono cause of legal reasons or cause he hates the platform for its less that stellar startup times or just cause he loves C++ oh so much more doesn't matter: He decided that it was worth his time to implement a Tomboy clone in C++.

FOSS is about choice and this is a great example: You can chose to use the Mono app that is probably more mature or you can use Gnote. Maybe you just don't wanna have Mono on your system for space reasons (or cause you don't wanna compile it [me being a Gentoo user knows the pain: It's the reason I don't run any KDE apps: compiling kdelibs and family just wastes precious time and resources]), maybe Mono doesn't run? Your choice. The best program will win the mindshare or both projects will agree on a standard that lets them interact. That is the way FOSS works. Just cause Tomboy was first and works we shouldn't grant its developers the monopoly on note-taking: what happens if Gnote goes in a different direction in a month and creates something even more awesome? Do we wanna risk losing that? New perspectives on problems, on software implementations are good, they allow us to see flaws more clearly and competition forces us to define open interfaces and standards that allow better integration in the long run. If Beagle had not gotten competition by Tracker we probably wouldn't have the Xesam standard that allows everybody to plug random desktop search engines into the desktop. Competition is our strength, because it makes our platform stronger, more refined.

Complaint No.2: Dropping Mono programs is just cause of FUD and legal threats that don't exist



The next big comlaint was that fedora was just dropping Tomboy cause of FUD: That the Mono haters had won to cheat them into dropping Mono. This has a few aspects:

a) If anybody in the fedora project sees a legal ambivalence with Mono it's their fucking Job as distribution to drop Mono: They have a responsibility for their users and bringing them into a situation that might compromise them is just dead wrong.
Now let's just say they have a few concerns, as little as they are, they are just not 100% sure that Tomboy is fine. A competing product comes a long that works and that is clearly not having any of the legal ambiguities that Mono has. It would be completely stupid not to drop Mono: You have a program to provide the functionality you want with less trouble? Go for it I say!
b) Even if they didn't see legal trouble there's the fact of slimmer dependencies. Mono is a big dependency if you have it there just for Tomboy. If dropping Tomboy for a functionally good enough replacement allows you to clean that much space for your user, why wouldn't you do that? Maybe that allows you to put that other nifty new program on the LiveCD? Maybe more documentation or a new language? All reasons that are worth it.
c) The fedora people make their decisions based on the facts they have in front of them. You can disagree, can get involved into the process but in the end it's up to the project to decide their way. They don't have to please anyone, they make decisions and in the case of Fedora those are usually made completely in the open. I think the Fedora devs are a bunch of really smart people and if they decide something for their own project, who am I or who are you to tell them what to do?

Complaint No.3: Dropping Mono from your distro is as bad as any DRM



This is the part that got Chris all excited and with every word more into the wrong spectrum of the discussion: Chris (and Bryan) seem to have just read over the Fedora/Gnote messages very quickly cause they seemed to have missed half of it: Fedora does not delete Mono and Mono apps from the repos, they are just not on the LiveCD and the default install. Every user can have all of those apps by selecting it in the package manager and hitting "install". Mono is not gone.

Based on this false assumption Chris said that Fedora dropping Mono was just as bad as DRM, that it was just another software vendor locking him out of software. This whole notion is ridiculous and very clearly not thought through.

What does DRM do? The supplier of something uses DRM to force you to use the Software or content just exactly as that supplier intends it, no installing the software where the supplier doesn't want it, no playing content on unregistered players. DRM locks you out of options.
If Fedora had dropped Mono and all Mono apps completely how would that relate? Well ... not at all in fact. It would just mean that Fedora wouldn't support Mono anymore with their limited resources (see Complaint No.1), nobody would bar you from setting up a repo with all the Mono stuff and somebody probably would do that very quickly. It's like some Windows Software Shop not supporting running their app under Wine: It's not like they forbid you from doing it, it's not even that they wouldn't help you if you come with good suggestions on how to make running it on Wine easier, it's just that they wouldn't write "We support running this under Linux through Wine" on their box.
The Fedora has any right to drop certain packages from their repos if they can't or don't want to support them anymore, it happens all the time: Old unmaintained software is dropped because maintaining it is a pain. Fedora knows whether they can and want to support Mono and if they see it as the best way to drop Mono packages cause their resources are limited it is the right thing to do. Because the users deserve to only get official packages that are maintained and supported. Every DRM comparison fails here in any thinkable way.

I think Chris and Bryan just got carried away by their quick perception that everything was about FUD and just reacted out of that wrong perception without thinking it through. But I hold them to higher standards than that: If you speak "for the community" (well they don't speak for all of it but they do have a bunch of listeners which gives their opinion and voice some weight) you gotta think before accusing projects of things. It's just really bad style if you don't.

I for one am looking forward to the next episode of the Linux Action Show, one of those Podcasts that I enjoy listening to. What's your opinion on the whole thing? Do you see Fedora's replacing of Tomboy with Gnote as negatively as Bryan and Chris do? I'm looking forward to your opinions!

June 22, 2009 :: Germany  

Zeth

Mobile Wireless Questions and Answers

Some interesting questions and answers from my local Linux Group, the responses were written by Linux wireless expert Quentin Wright.

The first questioner wants temporary Internet access for a local community group:

I run a group in a venue without Internet access, I've been thinking of getting a USB 3G dongle (possibly with one of those USB->Ethernet hubs people like Three offer).

You could just get a pay-as-you-go SIM and a dongle.

I quite like the Netgear MBM621 which is an HSPDA/Ethernet modem and does NAT. Unfortunately they cost about 230 UKP new, and second-hand ones sell for nearly as much on eBay.

The next two questions are from the same author, who has connection problems with a mobile broadband USB dongle.

I have the T-Mobile web-n-walk mobile broadband USB stick which identifies itself as a Huawei E220/E270 HSDPA modem.

I recently downloaded and installed the latest version of the vodafone-mobile-connect (VMC) package for Fedora 10.

This installed okay after I had installed a few other things it required and it now runs, detects the Huawei and is quite happy to read and send text messages, which I previously had to do using a hand-crafted script.

But it will not set the device into internet mode, and although it installed lots of files in /usr/share/vodafone-mobile-connect/ I can't find what I have to change to make it work with the t-mobile network.

Not especially constructive I'm afraid, but it works out of the box with Ubuntu 9.04 using Network Manager. There is a look-up table of providers and their configurations installed by default - something different from VMC.

It may well work similarly with Fedora 11 as they said they were going to put the code in - I'll try it in the next day or so other distractions at work permitting.

I got rid of Network Manager because it interfered with other things (including the latest version of Firefox) and I mostly prefer to use scripts to handle my network connections (including changing /etc/hosts, and other things). Various colleagues who previously used 'NM' have now switched to 'wicd' which they find works where NM breaks in recent versions of linux. I don't know what's going on there.

Things have been particularly complicated with respect to networking since the transition to the Devicescape architecture in the kernel last year, coupled with the incorporation of the driver code from the more common wireless devices into the kernel as well.

These changes have in turn obliged the driver developers, the wpa-supplicant people, and the teams involved in the configuration utilities like Network Manager and wicd to catch up with the changes in the kernel. Further the distribution builders have had quite difficult decisions to make about the particular kernel build and other components to put into their release.

It's not sufficient to make a statement like "NM breaks with such-and-such a version of Linux". In reality a problem will relate to the combination of the specific kernel version, the particular device being used, as well as the versions of NM and wpa-supplicant.

Additionally in some distributions, like Debian, Mandrive and PCLinux OS, with some devices multiple conflicting drivers are loaded when particular devices are detected. In other distributions like Arch Linux, SUSE and Debian the firmware has to be copied into /lib/firmware. The symptom is that Network Manager appears to work, including acceptance of the key and even the appearance of a brief connection which then dies.

In endeavouring to triage NM problems in Ubuntu, about 50% of the problems relate to a failure to understand how to use the configuration icon. In particular the mistakes that are made are:

  1. Right clicking and using manual configuration when it is unnecessary.
  2. Failing to appreciate that it is necessary to left-click on the icon to configure wireless. This is a particular problem with users coming from a Windows environment.
  3. Not knowing the network passphrase, or only having a hex passphrase when a string is required (some BT Homehub users).
  4. Setting it up, changing the hub configuration and failing to make a note of the default keyring password and being unable to change the configuration.

On the topic of kernel versions, it's not enough just to rely on the kernel version for the 3G modems, because the udev rules have to be right as well.

As a rule it's best to avoid upgrading. The best strategy seems to be to have multiple partitions, maybe with a shared /home partition and do a clean install into the least used partition. You might then decide to migrate to the latest (greatest?!) version, or alternatively just give it a miss this time around.

Discuss this post - Leave a comment

June 22, 2009 :: West Midlands, England  

June 21, 2009

Matija Šuklje

Lawrence Lessig = Linus van Pelt

I just noticed that Larry Lessig looks just like Linus van Pelt wearing glasses... Wow! O_o

hook out >> studying finance and drinking Kneipp coffee
<!--break-->

June 21, 2009 :: Slovenia  

Bryan Østergaard

Any Exherbo users in Saint Petersburg, Russia?

I'll be going to Saint Petersburg this tuesday and plan to stay there a month or so. I'll be busy working on a commercial project while over there but there should be plenty of time to meet some local residents as well and enjoy the city.

I'm not sure what my schedule is going to be like but if you're in the area please give me a shout and we'll see if we can meet up for a beer or whatever. The best way to contact me after monday is probably by email at bryan.ostergaard@gmail.com but I hope to be present on irc as well.

June 21, 2009

Dirk R. Gently

Customizable LiveUSB


If you ever have an emergency and need a rescue disk to recover your Linux install, or maybe you just want to brag to your friends there’s some good LiveCD/USB’s out there and many distro’s now make LiveUSB install images, but it is also possible to create your own customizable LiveUSB. Hey, if you’re willing to put the time in, you can have a portable Linux in your pocket.

There’s alot of articles about creating your own custom CD/LiveUSB but many of them seemed dramatic involving messing with things like syslinux… Plus many of these create a fixed image, meaning that once it’s on your USB it can’t be changed. But having a customizable Linux on a USB flashdrive isn’t that difficult – just install Linux to the USB drive.

Partition the USB Drive

The first thing you’ll need is at least a 2GB flash drive. Anything less and you better plan a real basic install. First thing you might like to do is partition the flash drive. This isn’t necessary but I was pretty sure I wouldn’t need the 4GB for what I needed so I partitioned the flash drive to have a 1GB FAT32 partition first (so that Vista can see any files I put on it) then I partitioned the remaining 3GB as ext4 with kparted (there’s also gparted for gnome users).

Install via VirtualBox

No need to burn an ISO and reboot, use VirtualBox and do it from your desktop. You can follow my Testdrive a LiveCD with VirtualBox post to getting VirtualBox setup. I personally used Arch Linux for this install because it’s easy to configure, Gentoo should work well too, and Ubuntu looks to be easy.

Note: At the time VirtualBox does not have 64bit capabilities. If you want to install a 64bit Linux on your flash drive best to boot a LiveCD and follow these instruction from there.

Make sure your user is part of the VirtualBox group to enable usb recognition:

gpasswd -a <username> vboxusers

Boot the LiveCD/USB iso/img in VirtualBox then in Devices > USB devices select your flash drive. Now the installer will recognize your flash drive. Proceed to install the distro on the flash drive. If you partitioned beforehand you can skip partitioning and go to setting Filesystem Mountpoints. When you reach GRUB setup be sure to install GRUB on the flash drive itself, for me it was /dev/sdb. Be sure NOT to install GRUB to a partition, it should be at the beginning of the drive.

Fix Grub

Because your BIOS is likely setup to recognize your hard drive before your USB drive you get drive denominations like /dev/sda for your hard disk and /dev/sdb for your flash drive on regular bootup. If booting from a flash drive, many BIOS’s have you enter a key (mine is F10) to get to a Boot Menu. So when you select your flash drive in your BIOS Boot Menu your flash drive now becomes /dev/sda, hard drive /dev/sdb. In grub terminology this is hd0 and hd1. Most BIOS’s are like this (though there a few exceptions). To know for sure you won’t be able to detect this until you try and boot your flash drive (more below).

Close VirtualBox and open your GRUB menu list and change to the first recognized drive:

mount /dev/sdb2 /mnt/usb
vim /mnt/usb/boot/grub/menu.lst

or however you edit your system files. Then change:

# (0) Arch Linux
title Arch Linux
root (hd1,1)
kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/34393cdf-9f39-431e-88c8-ea89a2518c83 ro
initrd /boot/kernel26.img

to:

# (0) Arch Linux
title Arch Linux
root (hd0,1)
kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/34393cdf-9f39-431e-88c8-ea89a2518c83 ro
initrd /boot/kernel26.img

The (hd0,1) value denotes the partition number, again starting with 0. So this denotation tells GRUB the root filesystem is on the first drive, second partition.

Arch-specific Details (Mostly)

If you already did the configuration for your hard disk, you should be able to copy most the configuation files over to the flash drive (rc.conf, mirrorlist, modprobe.conf, local.conf…) and then install xorg, xfce4… by chrooting in. This is my chroot script:

#!/bin/bash
# chrootmount – change root to current directory

cp /etc/resolv.conf etc/resolv.conf
mount -t proc none proc
mount -o bind /dev dev
mount -t sysfs none sys
chroot . /bin/bash
source /etc/profile
grep -v rootfs /proc/mounts > /etc/mtab
source ~/.bashrc

This will allow you to just cd to the mounted directory and enter command to chroot to the new environment. From there you can install a desktop environment (I choose XFCE because I wanted a lightweight environment and limited disk space):

pacman -Syu
pacman -S xorg xfce4 gdm <few-fonts> nvidia

And a couple other things following the Beginner’s Guide.

The kernel initramfs image will need to be rebuilt too to have usb driver support. In the chrooted environment edit /etc/mkinitcpio.conf and add usb to HOOKS:

HOOKS=”base udev autodetect pata scsi sata filesystems usb”

Then find the the kernel version name and version:

uname -r

and build a new initramfs image:

mkinitcpio -g /boot/kernel26.img -k <your-kernel-name-version>

The -k option needs to be specified to use the chrooted kernel and not runtime kernel that is being used by chroot.

When done, exit chroot:

exit && umount proc sys dev

Reboot and Test

Now reboot and get to the BIOS Boot Menu. As I said, all BIOS’s are different so keep an eye for a key to get to it. Once in the Boot Menu select your USB drive.

Try and boot the flash drive. If you get a GRUB 17 error or boot into hard drive OS, you’ll have to edit your menu.lst. You can find the devices Grub sees by starting the flash drive again and in the Grub menu press e to edit. On the root line press e again and delete to:

root (hd

now press tab and it will show you the availble drive and partitions. Enter the correct one, hit escape and then b to boot. That’s it, you should now have your own customizable Linux USB drive.

Troubleshooting

If you get errors loading the kernel, it may be because USB device detection may need a delay before loading root. Try to add this to the end of your kernel line in your menu.lst:

rootdelay=8

Conclusion

I was a bit surprised. I didn’t think a USB drive would be much different that a CD/DVD but actually it was alot faster. And I just discovered that I’m using a USB 1.1 flash drive. :) Not quite as quick as my hard drive but definitely not bad. This is also the first time I ran without an xorg.conf and my desktop runs great. Definitely worth a try if you ever need a rescue os to fix problems with.

June 21, 2009 :: WI, USA  

June 20, 2009

Nikos Roussos

foss devs conference 2009


workshops

another great libre software event just ended. this time was the foss developers conference organized by eellak.gr. two full days with presentations (6 sessions) and workshops (14).

my highlights from the conference: openerp greek community announced at the conference, moodle workshop, great olpc workshop by re-public e-zine, a complete foss guide for education by kaskamanidis, a vivid presentation about ltsp by kainourgiakis (the last two were a good brainstorm input for me concerning my educational linux distributuion). and of course it was nice to see again some good friends :)

i have to admit that it was a great experience since i helped organizing this conference. more to come :)

eellak

June 20, 2009 :: Athens, Greece

Dion Moult

Perspective in progress

I had skipped my last scheduled blog post because things have been busy. One of those busy things involves the Perspective magazine, which I last touched way back in February. The last time I mentioned it, I also shared my feelings about the workflow. Between that time and now, there has been one Perspective issue, which was not actually designed by me but instead by another who did a green overlay on everything and redid the issue. This was because I had refused to do it – I had less than a week, about 4 week days if I remember correctly. This is of course with other activities going on, and completely out of the blue.

This time it seems as though on the design side of things people have been listening. I have been alloted 2 whole weeks (including an extended weekend!) to work on the design. I’m a happy person, and happy people make happy things. I wish I could say the same for the article-writers, but that’s another story I will share later.

Meanwhile, as dedicated observers of my blog you are all treated to a preview of the work-in-progress magazine. The inside pages have a distinct new feel of polish, modern and clean. I will also be releasing under PDF format all of the magazines once this issue is published. There have been great leaps in design after each issue, and this is just another stepping stone.

Without blabbering too much, here are two screenshots of what I’ve been working on:

snapshot11

…and another!

snapshot12

…as usual, just click on them to see it large-scale.

Of course, majority of the work is all done with open-source tools, just a bit at the end to slot in the articles with Adobe InDesign. This will really show what is possible with free software.

Related posts:

  1. Perspective Nov 2008 Distributed
  2. Perspective Magazine Feb 09 Released!
  3. Another Perspective Preview

June 20, 2009 :: Malaysia  

Michael Klier

Tracks: "Impulse"

Being ill and all this weekend I got myself the, hold your horses, uncrippled, unexpiring evaluation version of Reaper, a multitrack audio production environment ala Pro Tools, Logic, Cubase and made a new track :-). Reaper is really great and offers all the basics you need to quickly sketch out a song and I'm thinking about purchasing a license (60$ only) until I can afford a Pro Tools system or Ableton Live (I'm still undecided about that).

The song itself is another dark sludge/doom metal/post rock kind of thing. I'm really digging that genre at the moment. It got a bit thin, frequency spectrum wise on the low end and could need a little bit more bass. I've also tried to master it using multiband compressors etc. but I'm unsure as to whether it lifted up more frequency dirt than doing any good. I have to say that after ten years of working as an Audio Engineer I still bow in awe before those guys who do the mastering for metal like music.

It seems also that I maybe have to get my hands on the guitar presets of my ZOOM G7.1UT again because I'm not really that satisfied anymore :-/. But well, here it is (yeah, it's long, slow and repetitive - that's how this music works ;-), also this is a first draft - the outro is kinda cheesy, but I like it).

Enjoy (or not)!

UPDATE:
Because I wasn't quite happy with the sound of the track I recorded and mixed it completely from scratch. I think it got at least better than the previous version. I've also replaced the outro.

Read or add comments to this article · Save to del.icio.us

June 20, 2009 :: Germany  

Matija Šuklje

x86 vs. amd64 in Portage

I just realised something: how come if there's almost no way of getting a 32-bit x86 CPU nowadays and almost all CPU are x86_64, that ARCH="x86" is still the default and most maintained in Gentoo/Portage?

Yes, I know there's still people who use 32-bit, but there's also still people who use PPC (or even more exotic arches) and that's in second place.

Wouldn't it make sense for ARCH="amd64" to be at least as well supported as ARCH="x86" (if not even made the default/primary) in the given circumstances?

hook out >> woke up (still) laptopless, getting some grub and studying finances :P

P.S. I'm probably not the only one who finds it a bit confusing that the GCC calls the architecture x86_64, but Portage calls it amd64, am I?
<!--break-->

June 20, 2009 :: Slovenia  

Brian S. Stephan

Twitter removed from the feed

As I’m using Twitter more these days, I decided that the multiple tweets per day were probably making the front page here overly noisy. With that, I’ve temporarily removed it from the feed, updates will appear there no longer. If it turns out that you really did like them being there (or are pleased that they’re now gone), please, tell me and I’ll act accordingly.

June 20, 2009 :: Wisconsin, USA  

George Kargiotakis

Firefox 3.0.11 to 3.5b99 migration glitch on certificate authority root files

I’ve recently migrated on my debian from iceweasel (firefox) 3.0.X to swiftfox (firefox) 3.5b99 and I noticed that I could not import any new certificate authority root files. When I used a new profile everything worked as expected, so it was something that had to do with the migration of my old version 3.0.X profile to the new, version 3.5. It looks like there has been a modification in the way firefox 3.0.X and firefox 3.5 handles cert8.db file inside the profile directory. As soon as I deleted the file and restarted firefox I could import new certificate authority root files just fine. Of course I lost the old ones I had imported in the past…

June 20, 2009 :: Greece  

June 19, 2009

George Kargiotakis

Όπου φτωχός και η μπύρα του…

Όπου φτωχός και η μπύρα του…

Όπου φτωχός και η μπύρα του...

Όπου φτωχός και η μπύρα του...

Από bar (Θυμωμένο Πορτραίτο) στα Ιωάννινα…

June 19, 2009 :: Greece  

Allen Brooker

Degree Result!

I now have a 2:2 in BSc Computer Science with a Year in Industry. Considering how badly I can do in exams, I am quite happy with this result. Won’t get full results for a short while yet, but getting that result is a weight off my mind.

Congrats to everyone else getting their results. Hope you get what you wanted.

Edit: CV updated. I’ve also fixed the broken download link on this site.

Rant: Why do Monster and other job sites not allow PDF uploads? I had to use a Windows machine to get test the RTF export to make sure it looked OK.

June 19, 2009 :: England

Jason Jones

Alma : 32

I wasn't in the best of moods while reading this, this morning, but I must say that it helped me gain a bit of focus for the job hunt this morning.

The principle that jumped out at me this time around was that of humility.  Going through the pain that is sometimes required to bring about humility just might be the thing that saves your soul.  Pain is tough, but sometimes it's a good thing.  Hopefully I fall in the camp of those who don't require pain to attain to a sufficient level of humility, but ya never know.

That's all for today.

June 19, 2009 :: Utah, USA  

June 18, 2009

Zeth

Visualising your favourite keywords in Twitter

Twitter is a social networking site that allows you to share short messages about what is going on in your life, or to share some cool link you have found.

Previously I have talked about Twitter scripting, Twitter GNOME integration and Tag Clouds.

Having a live and visual representation of what is happening on Twitter is quite fun. These are especially fun on a monitor or flat-screen, e.g. in a party, in an office, or at an event.

Twitter's own search is pretty good, it shows you the latest results for a keyword (or set of keywords) and automatically polls for updates, however you need to click to show you the updates, which reduces the usefulness on an unattended monitor.

http://commandline.org.uk/images/posts/twitter/twittersearch.png

A step up from this is Monitter, which allows you to put different keywords in columns and sort by geographic location.

http://commandline.org.uk/images/posts/twitter/monitter.png

Twitterfountain finds the latest messages for a keyword, and can also look on Flickr to find images to use for the background of the page.

http://commandline.org.uk/images/posts/twitter/twitterfountain.png

Flotzam is able to pull from several social networking sites, including Twitter, Facebook and YouTube. However, Flotzam requires Silverlight on Windows or Moonlight on Linux.

http://commandline.org.uk/images/posts/twitter/flotzam.png

Lastly, and my favourite so far, is Visible Tweets, this simply puts one message on screen and then animates to the next message.

http://commandline.org.uk/images/posts/twitter/visualtwitter.png

Please let us all know if you find another one, or if you think of a cool use for one of these sites. Please also share any other sites or tools you are using.

Discuss this post - Leave a comment

June 18, 2009 :: West Midlands, England  

Jason Jones

Alma : 31

Interesting Alma used the phrase "my heart began to sicken" when he heard about what the Zoramites were doing.  That is such a descriptive word, and I can almost feel what he described as I read...

I also find verse 5 interesting at this point in my life.  It seems that Alma confirms that sometimes, when moved upon by the spirit, plain declaration of truthful doctrine has the most power to sway a person to believe.

Breaking the prayer of the Zoramites down, it basically comes to three parts:

  1. God is a spirit now, in the past, and forever.

  2. The Zoramites are the only ones elected to be saved.  Everyone else is gonna burn.

  3. There shall be no christ.



Sounds more like a prayer to Satan to me.  Wow...  I guess with that in mind, it's understandable why Alma calls such things, "gross wickedness".  Let that prayer sink into your heart, and there really isn't any reason to serve God, or your neighbor, or love either.  Hmm....

"..and the Lord provided for them." - seems particularly applicable in my current unemployed state.  It's noteworthy that the Lord did so due to Alma's prayer of faith.  Maybe I should pray a bit more. :)

June 18, 2009 :: Utah, USA  

June 17, 2009

Roderick B. Greening

usb-creator-kde - in action and with icons...

Here's a new screenshot showing usb-creator-kde with media detected and some icon bling (icons subject to change).

Basically, I updated the ui elements from QPushButton to KPushButton and assigned icons as KIcons based on appropriate icon/button functions. So they should change with the icon theme - yay.

Anyway, here it is...


June 17, 2009 :: NL, Canada  

usb-creator-kde - adventures in gobject land

I'll first start out with a disclaimer: I am not fluent in Qt nor Gtk programming. What I know or have learned is through the internet, various books and reading others code. So, what I describe below may not be the best way to achieve the end result, but it appears to work and allow for minimal interference with an existing application backend.

Now that that's out of the way, I'll proceed with the discussion: porting gobject calls to Qt so that I can get a usable KDE/Qt frontend for usb-creator-kde.

For the gtk client (usb-creator), the backend currently implements timers, callbacks, and process watchers via gobject. Similar mechanisms exist for Qt. The current backend is unsuitable for general use by both a gtk and Qt frontend as gobject and Qt seem to tromp all over one another, and cause the frontend to crash. TO get around this, we need to move the gobect calls to the gtk frontend, and implement wrappers that the backend can call from the frontend. Once we have wrappers in place, we can then re-implement the wrappers in our desired frontend (e.g. PyKDE).

Here's an example of some code from the backend:

self.timeouts[udi] = gobject.timeout_add(UPDATE_FREE_INTERVAL, self.update_free, udi)
And from the PyGtk manual:

timeout_add
int timeout_add(int interval, callback callback [, mixed user_data1, ... ]);

Registers a function to be called periodically. The function will be called repeatedly after interval milliseconds until it returns false (or nothing) at which point the timeout is destroyed and will not be called again.

So to keep the timeout alive, your callback function needs to return true;
Unfortunately, there is no single call in Qt that provides this mechanism (none that I know of). So, to implement this, I needed to write a couple of functions, using unnamed arguments lists, lambda notation, etc.

First off, we need a generic timer callback function that will call our passed function, test the return value, and stop the timer if the return value is not True. I also want this function to be private to my frontend class. Here what it looks like:

def __timeout_callback(self, func, *args):
'''Private callback wrapper used by add_timeout'''

timer = self.sender()
active = func(*args)
if not active:
timer.stop()
So, func is the passed calback function to execute, followed by a list of optional arguments *args. The sender will be a timer object, which we get from self.sender, assuming that the parent is some QObject or derivation thereof (in my case, the frontend class KdeFrontend is derived from QObject).

Ok, that allows us to have an arbitrary function with any number of arguments, and have it stop a timer when appropriate. We now need to implement the public wrapper that will use this private callback. Here is the code for that:

def add_timeout(self, interval, func, *args):
'''Add a new timer for function 'func' with optional arguments. Mirrors a
similar gobject call timeout_add.'''

timer = QTimer()
QObject.connect(timer,
SIGNAL("timeout()"),
lambda: self.__timeout_callback(func, *args))
timer.start(interval)

return timer
The add_timeout function takes the same parameters as the gobject.timeout_add function. Inside, we setup a new timer, connect it to our private callback, start the timer and return a reference to it. The magic is in how we connect the passed function func. Notice that we use lambda to call our private callback, passing along the func and *args. Normally, you do not pass a function with variable parameters to Qt connect statements, but in our case, we absolutely are required to do so. This is where using lambda comes in handy.

So, there you have it. A way to implement gobject.timeout_add using Qt. While everyday use of this is not likely, it will certainly help in porting applications from PyGtk to PyQt. I hope someone out there finds this useful. I know I searched for an easy way to do this, and never found anything. After lots of trial and error and asking lots of questions to my fellow developers, I was able to come up with the above.

Cheers.

June 17, 2009 :: NL, Canada  

Dion Moult

When you vomit food for thought.

Today I felt like letting my mind run free and vomiting my thoughts onto the keyboard. Enjoy. Sorry if the post seems a little unstructured, but that’s how my mind works.

An interesting discussion cropped up the other day concerning Economics. One of the fundamental rules in economics that (most) goods have an inverse price-quantity relationship of demand. In other words, if the price is lower, you demand more because it is cheaper.

If you drew a graph of quantity on the x-axis and price on the y-axis, you would therefore get a downward sloping curve.

However, how can we justify why it slopes downward?

One of the theories used to explain it is marginal utility theory. Utility is a fancy economics term for “satisfaction gained from consumption”. Marginal utility theory is associated with how much satisfaction you gain from consuming one more of the good. In general, your utility will decrease. For example, if you eat a chocolate bar, it tastes great and you are very satisfied. However the more chocolate bars you eat, the less amount of satisfaction you gain from eating the next bar of chocolate.

One of the assumptions to allow marginal utility theory to justify why the price-quantity demanded relationship is negative is that we make rational decisions.

The challenge comes when you try to identify when we don’t make rational decisions. Go on, have a go. However there is a catch: making rational decisions does not imply we have perfect knowledge of the situation. In simpler words, it doesn’t matter if we do not have all the facts or the understand completely the mechanics behind a situation – rational decision making is based on what we perceive.

Here’s one attempt to identify an irrational situation: laziness. Suppose you can get a coffee here which costs $2, or a coffee that tastes better, and is cheaper that costs $1. However, the one that costs $1 is a 10 minute walk away. The rational person would pick the $1 coffee, however, some might argue that if we are lazy, we will just take the $2 coffee: hence an irrational decision. This is obviously flawed, as any economist would state that the cost of walking 10 minutes away outweighs the extra utility you would gain from paying half the price, hence the net utility gained would maximised in buying the $2 coffee. Therefore still a rational decision.

Another attempt was an interesting one: love. Let’s consider lust before considering love. Lust is easily disproved: we gain satisfaction from the attraction. Now let’s look at love. Love by my definition is “wanting the best for another despite any sacrifice“. The economic man would not give up 5 minutes of labour to please his wife – where is the rationality in self-sacrifice? Try to compare the actions of love to the satisfaction gained from self-sacrifice when performing charity. This is simply a different “form” of utility, but still utility nonetheless from making the decision we believe is right, best, bound to and is your duty. Therefore decisions made in love are still rational.

The final attempt was that of drugs. However the flaw is that drugs allow decisions to be made subconsciously, or without full consciousness. This means that decisions are therefore involuntary and not part of us. To an outsider, yes, this will be an irrational decision. However internally it remains rational.

The thing is to realise that there is a difference between externally-realised rationality and internally-realised rationality. It seems that internally-realised rationality is always rational. There is no irrationality internally. We always, without exception, make a decision because we believe it is the right and best decision to make at the point of time. Even if you pursuade yourself to make a “bad” decision, the persuasion in itself will act as a justification to your new “worse” decision actually being “better”. (Try read that again if it was confusing) It seems that this is the only unified aim between everybody.

Let’s consider this other form of utility that love (not to be confused with lust) introduces. What makes this “form” of utility interesting is that to an economic system, this utility would be considered irrational. As humans, there is no arguing that this utility plays a very significant role in our lives, if not the majority of roles. This poses an interesting question: why, then, have we created a system with such massive influence on many of our lives that chooses to disregard this form of utility? The quick-witted debator would immediately retort with the concept of legislations, ethical regulations, and other similar restrictions. However there is no doubt that we know little about these two forms of utility – and such systems were obviously made by following the “easy” rather than the “right”. This branches off nicely into the grey areas of morality – something I shall save for another day.

What makes the situation nicely contradicting is an interesting experiment done around the 1970s. A man was put into a room with his head connected up to brain wave measuring instruments. He was then told that he would press a button on a table in front of him whenever he wanted. The results of the experiment, quite predictably, were that about a split second (1/10th of a second approximately) before he moved his hand to hit the button, the brain neurons were fired up.

The experiment was then changed so that the man could report as to when exactly he was actually aware that he was about to make the decision to hit the button. The results were direct, conclusive, and of course: highly controversial. What happened was that the brain neurons had fired up before the man was conciously or even subconciously aware that he was going to make a decision. In fact, the actual timeline of events was: time 0: brain neurons fire up, time 0.1: man is subconsciously aware that he has made a decision, time 0.12: man makes decision and begins to move his hand.

The experiment was repeated with slight variations all with the same conclusion: a decision is made before we are even slightly aware of it. This, of course, was thrown quite rudely in the faces of believers of free will – all who predictably reacted with anger and disbelief.

The professor who carried out the experiment was too insulted by the results of the experiment and was afraid of the religious implications of his discovery. He has recently been building up a case against his results – suggesting that in the 0.02 seconds before the awareness and the action, you have the chance to rebuke the decision and thus go against it. Of course, there is the issue that the brain neurons have to fire up a good 0.1 seconds before that rebuking.

Getting back on subject, this suggests that all decisions are in fact irrational – as rationality suggests a conscious entity to make a decision. The effects of any situation are not determined by how much satisfaction we expect to gleam from a decision, but simply from the natural consequences of previous conditions.

Allow me to use an analogy to explain this. Gravity is a physical and naturally occuring phenomenon. It exists and functions unquestionably as a feature of life. It also provides a condition for any object – it creates a force that pulls a mass from infinity to a point. The object will always experience this force and can therefore act in a predictable manner.

However, gravity is not the only condition acting on the object, there are many others: air resistance, wind, friction, surface area – and even the mass itself of the object. All of these variables determine the outcome of how the object will react to gravity. Each – to use an economics term – ceteris paribus will have predictable outcomes, but the mechanics behind the situation are so complex that we are currently unable to account for all of them – and hence decide what company we should buy shares in next week.

Then, you argue, “then why is there variance in our decision making? What is the root cause that would start off all the deviations in conditions around the universe?”. Like gravity – questioning what began the existence of it is non-beneficial: it gets us nowhere – however understanding and appreciating its existence is what is useful.

Drifting slightly off economics, this brings up to the concept of the mind and free will. The question remains that if our decisions cannot be controlled – what is the purpose? The idea that decision are made before we realise it as a result of past conditions does not mean that decisions are not made. What it does do is provde the concept that the mind is simply yet another naturally occuring phenonenom that reacts in such a way to conditions. There are decisions, but no decision-making entity. There is a mind, but no “self”. We are not in control – so to speak.

Ignoring the dramatic last sentence, let me give another analogy. Imagine a puppy. Even if you house and feed the puppy, you do not “own” the puppy. You cannot control what the puppy is going to do. You can predict what the puppy will be likely to do, you can understand why the puppy reacts in certain ways, but not control. However, what you can do is train the puppy. You can train the puppy to react in a certain ways to certain conditions.

Let’s say you put a rock on a top of a hill filled with gravel – it rolls down a path. If you put it on that exact spot again, it will again roll down the path. The more you put that rock such that it rolls along the path, it will create a groove along the path, and thus make it more and more likely to follow that very same path.

Similarly, the mind, though a naturally occuring phenonemon, can be trained. It is this understanding that prevents us from a unfufilling struggle to try and control every single thought that occurs throughout our mind. Instead of controlling the thought – simply realise the thought as what it is, and nothing more.

Let’s leave the “everything is irrational” to interpretation.

Meanwhile, let’s return to the subject of utility. I might be going out on an arm and a leg here, but I am willing to suggest that these two forms of utility each have externalities. An externality may be defined as the spillover effects incurred by society due to the consumption of a good – or in this case, a form of utility. They come in two sunny and not so sunny packages: positive and negative externalities – both of which names are pretty self-explanatory.

I propose that utility gained from conditions such as “lust” have negative externalities, and that utility gained from conditions such as “love” have positive externalities. Before continuing, let’s consider the nature behind these two utilities.

The lust-based utility has an interesting characteristic that it stems from “attachment“. The utility is gained from the satisfaction of an attachment, a greed, a craving, whatever you want to call it. Another characteristic is that consumption will also create more “attachment” – an attachment that will ultimately lead to dissatisfaction, or dis-utility, when it can no longer be consumed.

The love-based utility also has an interesting characteristic: it is derived from, and results in contentedness. It is an understanding of interdependency, of duty, of a natural flow and responsibility. Even more interesting is that this corresponds with our definition of “maturity”’s characteristics. For example, when we are very young, we are completely dependent. Becoming adolescents, we have a phase where we strive to be completely independent. Through experience we soon develop an attitude that most recognise as a sure-sign of maturity – the understanding of interdependence. Perhaps that’s why most old people are like what they are – especially nearing death.

Now that the characteristics are identified, let’s consider the externalities. This, like most of the grey areas of ethics is not something that I can easily persuade through a couple sentences on a blog post. Instead, simple observance and experience is enough to convince anyone that that which is rooted in attachment is actually a cause of dissatisfaction (think long term, where impermanence applies to all situations), whereas that rooted in understanding would cause a lot of morally responsible activities to take place, as well as solving all of the negative reactions one would otherwise experience when a craving is not satisfied.

So what sort of economic system is that which feeds on its own negative externalities? Masochistic and deluded to be sure.

If the implications of the last sentence didn’t hit you hard – here is it rephrased. If we understand and simply see things as a situation and not a provocation, we have eliminated a great deal of suffering. Imagine seeing a rose, but instead of thinking “this is a rose. It smells nice. It looks beautiful. I like how it looks. Who might I give this rose to? Do I have a rose? Is my garden doing well?…etc” we can instead just think “this is a rose”.

This elimination of suffering includes … well, the basic economic problem. Welcome to my wonderful new economic system – one which through the training of people mind’s can eliminate the unlimited needs that people experience, and thus make resource allocation theoretically completely sustainable.

In fact, one huge multinational has been moving towards sustainability throughout the entire lifetime of its business activity. Their statistics don’t lie. With every breakthrough in sustainability – their profits have risen, their costs have fallen, employees are more motivated, and the company vision is increasingly clearly conceptualised in every employee’s minds. Their CEO recently gave a talk on TED explaining this and provides financial proof to persuade others to join in with their movement.

Imagine a world where contentedness is the norm. Where our industries are based to satisfy our needs and wants which are not fueled by craving. A completely sutainable way of living. Somebody once said, remove all the beetles in the world and life would perish within 50 years – remove all the humans in the world and life would flourish within 50 years.

Beautiful image, no?

Completely impractical? Yes.

Related posts:

  1. Food, Design, and Marketing.

June 17, 2009 :: Malaysia  

Allen Brooker

KDE and Version Numbers

I’m fed up! I’m sorry, but I just don’t buy it. MAYBE it worked with the .0 release, but anything above x.0 IS NOT a preview / beta / release candidate. KDE 4.2.4 is the real, proper, full up released version of KDE. Amarok 2.1 is the real, proper, full up released version of Amarok.

The KDE fanboi’s (and frankly, I think it is just the fanboi’s who are still trying to use this excuse - looking at the KDE blogrolls I don’t see the devs using it any more) need to stop falling back on this excuse. NO ONE else tries to use it, and I don’t understand why they insist on trying to use it. It’s really getting old now.

KDE had all the features and stability (from my point of view, as a user) and they went and decided to throw away almost the entire codebase in favor of SHINY! What’s worse is they concentrated on new features before getting the really basic stuff which KDE3 does really well right.

The same for Amarok 2 - the developers concentrated on their stupid shiny new UI which doesn’t even work properly before getting back even a tiny amount of the functionality that makes me use Amarok 1.4 over any of the other umpteen million other media players.

I don’t think I’ve seen anyone else do this to this degree with desktop software. The first thing developers do when they do a major rewrite (and thus a major version bump) is get the product roughly on par with its predecessor in terms of features. THEN they concentrate on shiny new features. Why is this so hard for the KDE devs to grasp?

Edit: I am not saying anything (major) is lacking in KDE 4.2 - this is basically a rant about the excuse used by many whenever someone does come up with something that’s missing.

For the record, the features I am noticably missing in KDE 4.2 are:
- Plasma still crashes occaisionally (I think this may be related to downloaded plasmoids, but plasma should still sanely handle issues so my entire desktop doesn’t stop responding with no messages telling me why)
- No ability to put spaces between icons placed on a panel
- No run panel widget
- No nice small, clear memory/cpu panel widget like the KDE3 system monitor applet (there doesn’t seem to be a memory usage widget at all. I wonder if that’s so the devs can keep perpetuating the (from my experience) myth that KDE4 uses less memory)
- Memory usage is noticably greater than KDE 3.5 (as measured at hibernate time on my laptop - My laptop may have been upgraded to 2G from 512M at xmas, but the memory usage affects the time it takes to hibernate/resume my laptop)

June 17, 2009 :: England

Jason Jones

Kaboom!

Man...  When, at the beginning of this year, I wrote that 2009 was gonna be a doozie, I didn't know the half of it.
After having been employed for only a month, two days ago, Monday, at 5:00pm, my superior came in to my office and told me, with a red face, that they had to let me go.  The red face was undoubtedly due to the fact that nobody enjoys doing that sort of thing.  "Things are too tight", he said, and then, as he was necessarily hovering over me, I formatted my computer, packed my things, and that was that.

For those of you who have been following my posts, this may come as a shock, as many posts I have recently written have spoken of the spiritual confirmation that both me and my wife have received concerning my employment there.

This one is usually a toughy, but I've come to realize through many life experiences, that God has His way of doing things.  God's way of doing things more often than not, comes as a shock to our way of doing things.  Does this mean the two are incompatible?  I believe that wholly depends on whether or not you believe God really is at the helm of our lives.

I look at this situation from the following perspective.

I have no doubt at all that it was God's will that I leave Nature's Way and take the offer given me by Conexm.  I felt strongly (as did my wife) after taking the offer and beginning my employment, that I was doing exactly what I needed to be doing.  Neither Sarah nor I felt easy about my employment there, as it was very stressful, and things never felt like they settled into a groove.  Nevertheless, and notwithstanding the bumpiness of life as I was employed there, I always felt that "this is where I am supposed to be".

So, some may ask, "Why the termination?  Why would God tell you to go somewhere where he knew almost immediate termination would result?"

My response is this.  Yes, it was extremely nerve-racking and difficult, to say the least, to hear the news of my termination.  Given the current economic situation of our family, being unemployed is definitely not something which will make our lives any easier.  Holy moly, no.  But, can I discredit the confirmation both Sarah and I received?  Is it void now?  I might answer yes, if during my employment there, I had given them any reason of my own doing to terminate me.  I gave my all, I did my best, I worked my hardest.

So, in essence, since I don't know what will happen 1 month, 1 week, or even 1 day from right now, I still firmly believe that God is still at the helm of my life, and I am going to do everything I can to find His will in all this.  In doing so, I believe that since God's work and glory is to bring to pass the immortality and eternal life of his children, and I also believe that man is here on earth to have joy.  If you put those two together, one can only come to the conclusion that if we follow God's will, he will direct us both to have joy, and to eternal life.  Right now, I'm not having a whole lot of joy, persay, but I still am at peace with my current situation, and will continue to do my part.

So... Yeah..  I guess this essay was a long-winded approach to saying, "I'm now unemployed, but I haven't lost hope."

Hooray!  I get to sleep in!

June 17, 2009 :: Utah, USA  

Jürgen Geuter

New gpg key

Ok, since my old GPG key was ... well old and not really secure anymore I created a new one:
pub   4096R/41E3EF4E 2009-06-17
uid                  Jürgen Geuter <tante@the-gay-bar.com>
uid                  Jürgen Geuter <Juergen.Geuter@offis.de>
uid                  Jürgen Geuter <tante@monkeycode.org>
uid                  Jürgen Geuter <geuter@wi-ol.de>
uid                  Jürgen Geuter <teetante@googlemail.com>
uid                  Jürgen Geuter <tante@emptiness.de>
sub   4096R/CB67C637 2009-06-17


I signed that new key with my old one and revoked the old one, the new one can be found on the keyservers and here.

For those unsure how those things work check out this tutorial.

June 17, 2009 :: Germany  

Brian Carper

Five Things that Mildly Annoy Me in Clojure

This infamous blog post suggests that someone familiar with a language should be able to name five things they hate about it. "Hate" is a strong word, but I decided to think of five things I find mildyly annoying about Clojure, my favorite language of the moment.

Hashing integers

Clojure automatically converts integers between Integer, Long and BigInteger as needed to prevent overflow. This is good. Integers of the various classes test as equal too. This is also good.

user> (= 123 (int 123) (long 123) (bigint 123))
true

So would you expect this?

user> (hash-map (int 123) :foo (long 123) :bar (bigint 123) :baz)
{123 :foo, 123 :bar, 123 :baz}

Yes, each of the integer classes, though equal via =, do not have the same hash value when put into a hash-map. This is because:

user> (.equals (int 123) (long 123))
false

This is a wart inherited from the JVM. See here for discussion and explanation.

What's more, if you print this map and then try to read it back in, the integers will be read as int, long or bigint arbitrarily depending how big they are. This means you may not get the same class of object back that you output originally.

user> (def x {(bigint 123) :foo})
#'user/x
user> (= x x)
true
user> (def y (read-string (pr-str x)))
#'user/y
user> (= x y)
false
user> (class (first (keys y)))
java.lang.Integer
user> (class (first (keys x)))
java.math.BigInteger

This means that if you ever use integers as hash keys, you must be very careful to cast them all to the same integer type manually.

Metadata doesn't work on everything

Clojure lets you stick arbitrary metadata on various objects. This is higly useful; you can decorate objects with information that doesn't affect the value of the object. However metadata doesn't work everywhere.

user> (with-meta "foo" {:bar :baz})
java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IObj (NO_SOURCE_FILE:0)

You can only stick metadata on certain Clojure objects like Symbols, Vars, Refs, Agents, all of the Clojure collections and so on. You can't stick metadata on, say, a String or an Integer, because those are closed Java classes and can't be touched. It would be nice if you could.

use vs. require vs. import vs. load vs. ...

There are a startling number of ways to import a library into your code in Clojure. You have to choose from load, import, require, use, refer, and so on. Some work on Java classes, some work on Clojure libs. Some of them import symbols into your namespace, some of them don't. Some of them take strings as arguments, some take symbols, some take quoted lists of symbols, some take quoted lists of symbols with sub-lists of arguments. And all of these can be and usually are weirdly inlined into a namespace declaration, with a completely different list-quoting style.

So in Ruby you can do this:

require 'util'
require 'config'
require 'whatever'

Whether it's a gem, or a Ruby source file sitting locally, it all works the same as long as the load path is set up right.

But in Clojure, you do this (actual code from an IMAP library I wrote):

(ns qt4-mailtray.mail
  (:import (java.util Properties)
           (javax.mail Session Store Folder Message Flags Flags$Flag FetchProfile FetchProfile$Item)
           (javax.mail.internet InternetAddress))
  (:use clojure.contrib.str-utils))

This can quickly become unwieldy, especially if you start using the :as or :only or :rename arguments. It's made worse by Java's insane API's full of a billion classes that you need to import to do simple things. (And those things with dollar signs are mangled Java inner class names.) Clojure also lacks the ability to import a whole package worth of classes at once using java.io.* syntax, so you must name all of the classes explicitly.

every? vs some.

This is such a trite pet-peeve that it's barely worth mentioning, but it seems to be brought up repeatedly and endlessly on the Clojure mailing list so at least I'm not the only one bugged by it.

Clojure has a function (every? pred coll) which tests whether every item in a collection tests true via some predicate. To test whether every item in a collection tests false, we have not-any?. And we have a not-every? which tests whether any item tests false.

user> (every? even? [2 4 6])
true
user> (not-every? even? [2 4 6])
false
user> (not-any? even? [2 4 6])
false

Now what would you expect a function to be called which tests whether any item in a collection tests true via some predicate? If you said any? you are wrong! It's some.

Note that some isn't a predicate (hence no question mark in the name); it doesn't return true or false, as above, but rather returns the result of running pred on an item in coll.

user> (some identity [nil 1 2 3])
1

any? is pretty easy to write so it doesn't matter that much. Probably many people have an identical function sitting in some utils.clj file on their systems.

(defn any? [pred coll]
  (when (seq coll)
    (if (pred (first coll))
      true
      (recur pred (next coll)))))

Stack trace madness

Give this function:

(defn foo []
  (throw (Exception. "BARFED")))

What does the stack trace look like in SLIME when you call foo? Like this:

java.lang.Exception: BARFED (NO_SOURCE_FILE:0)
  [Thrown class clojure.lang.Compiler$CompilerException]

Restarts:
 0: [ABORT] Return to SLIME's top level.
 1: [CAUSE] Throw cause of this exception

Backtrace:
  2: swank.commands.basic$eval_region__729.invoke(basic.clj:36)
  3: swank.commands.basic$listener_eval__738.invoke(basic.clj:50)
  4: clojure.lang.Var.invoke(Var.java:346)
  5: user$eval__1506.invoke(NO_SOURCE_FILE)
  6: clojure.lang.Compiler.eval(Compiler.java:4580)
  7: clojure.core$eval__4016.invoke(core.clj:1728)
  8: swank.core$eval_in_emacs_package__336.invoke(core.clj:55)
  9: swank.core$eval_for_emacs__413.invoke(core.clj:123)
 10: clojure.lang.Var.invoke(Var.java:354)
 11: clojure.lang.AFn.applyToHelper(AFn.java:179)
 12: clojure.lang.Var.applyTo(Var.java:463)
 13: clojure.core$apply__3269.doInvoke(core.clj:390)
 14: clojure.lang.RestFn.invoke(RestFn.java:428)
 15: swank.core$eval_from_control__339.invoke(core.clj:62)
 16: swank.core$eval_loop__342.invoke(core.clj:67)
 17: swank.core$spawn_repl_thread__474$fn__505$fn__507.invoke(core.clj:173)
 18: clojure.lang.AFn.applyToHelper(AFn.java:171)
 19: clojure.lang.AFn.applyTo(AFn.java:164)
 20: clojure.core$apply__3269.doInvoke(core.clj:390)
 21: clojure.lang.RestFn.invoke(RestFn.java:428)
 22: swank.core$spawn_repl_thread__474$fn__505.doInvoke(core.clj:170)
 23: clojure.lang.RestFn.invoke(RestFn.java:402)
 24: clojure.lang.AFn.run(AFn.java:37)
 25: java.lang.Thread.run(Thread.java:619)

Yeouch. Now imagine that the above error is coming not from a simple function, but from some random line among hundreds of lines of source code.

Stack traces in Clojure will often tell you little to nothing about what is causing the error, or more importantly, where it's coming from in your code. Clojure functions are translated into Java classes when they're run through the JVM. Often can't even see the name of the function that's throwing the error; names are mangled into things like user$eval__1473.invoke, which is really really confusing when you use anonymous functions.

Per Jason Wolfe and Randall Schulz sometimes you can get a better stack trace if you dig a bit deeper:

user> (.printStackTrace (.getCause *e))

java.lang.Exception: BARFED
    at user$foo__1503.invoke(NO_SOURCE_FILE:1)
    at user$eval__1509.invoke(NO_SOURCE_FILE:1)
    at clojure.lang.Compiler.eval(Compiler.java:4580)
    at clojure.core$eval__4016.invoke(core.clj:1728)
    at swank.commands.basic$eval_region__729.invoke(basic.clj:36)
    at swank.commands.basic$listener_eval__738.invoke(basic.clj:50)
    at clojure.lang.Var.invoke(Var.java:346)
    at user$eval__1506.invoke(NO_SOURCE_FILE)
    at clojure.lang.Compiler.eval(Compiler.java:4580)
    at clojure.core$eval__4016.invoke(core.clj:1728)
    at swank.core$eval_in_emacs_package__336.invoke(core.clj:55)
    at swank.core$eval_for_emacs__413.invoke(core.clj:123)
    at clojure.lang.Var.invoke(Var.java:354)
    at clojure.lang.AFn.applyToHelper(AFn.java:179)
    at clojure.lang.Var.applyTo(Var.java:463)
    at clojure.core$apply__3269.doInvoke(core.clj:390)
    at clojure.lang.RestFn.invoke(RestFn.java:428)
    at swank.core$eval_from_control__339.invoke(core.clj:62)
    at swank.core$eval_loop__342.invoke(core.clj:67)
    at swank.core$spawn_repl_thread__474$fn__505$fn__507.invoke(core.clj:173)
    at clojure.lang.AFn.applyToHelper(AFn.java:171)
    at clojure.lang.AFn.applyTo(AFn.java:164)
    at clojure.core$apply__3269.doInvoke(core.clj:390)
    at clojure.lang.RestFn.invoke(RestFn.java:428)
    at swank.core$spawn_repl_thread__474$fn__505.doInvoke(core.clj:170)
    at clojure.lang.RestFn.invoke(RestFn.java:402)
    at clojure.lang.AFn.run(AFn.java:37)
    at java.lang.Thread.run(Thread.java:619)

This one at least mentions foo by name but you're still going to have a headache after a few hours of those stack traces.

Conclusion

So that's five things. You will notice a common theme. Most of these issues are inherited from the JVM. This is to be expected, I suppose. There's no way you can wrap one language in another without a few compromises.

But these things aren't show-stoppers. They are minor annoyances compared to the benefits you get from using the JVM, i.e. the good performance, tons of libraries, cross-platformness, and so on. Clojure is fun enough to work with and wart-less enough that it took me well over two weeks to write this post.

(If you were expecting me to mention loop/recur and the lack of native TCO in the JVM, you were PAINFULLY WRONG. No one who uses Clojure loses sleep over native TCO. It's largely a non-issue that's endlessly repeated by people looking for an excuse to pass up Clojure in favor of $their_pet_language. To each his own, but I have never found myself caring the slightest about loop/recur.)

June 17, 2009 :: Pennsylvania, USA  

June 16, 2009

Dan Ballard

CL-PACK 0.1 released!

Well, as promised, I've finished the first version of the little Lisp project I've been working on and it's only mid June. So with no further adu, I present cl-pack.

cl-pack is a Common Lisp library supplying perl/php/ruby compatible pack() and unpack() functions so that Lisp can easily communicate with those languages via binary protocols or files. pack() and unpack() take Lisp data and pack them into binary strings that can be stored or exchanged safely with other programs. The (un)pack functions are handy utilities that most other common languages support and now so does Lisp.

Cavets: This is the first release, therefor full coverage of all pack() syntax isn't yet available. Most data type (all common ones) are supported, as are repeaters in the form of numbers and '*'. Grouping with brackets and other extended syntax is not yet supported, but should be forthcoming in the next release. Documentation is in cl-pack.lisp and if you want to see what it can do, also look at tests.lisp. cl-pack is ASDF compatible so it should integrate with your system well. It relies on ieee-floats but ships with a copy should your system be lacking one.

You can get it at ftp.mindstab.net/cl-pack

So yeah, this is what I've been working on for the past month or so. Glad to get it out. I plan to throw up some small web page for it in a few days and then start working on the remaining syntax support.

Edit: I set up a page for cl-pack at CLiki http://www.cliki.net/cl-pack

June 16, 2009 :: British Columbia, Canada  

Allen Brooker

Amarok 2.1 Quick(-ish) Review

So I’ve just installed Amarok 2.1. Configured my collection location easy enough, downloaded the alarm script from the scripts library (haven’t tried it yet) and now I set about making it look how I want. I know exactly how I want Amarok 2 to look: Exactly like Amarok 1.4.

I like my spreadsheet layout. It works perfectly for music management. I skipped 2.0 because it had no spreadsheet layout and we were promised it in 2.1. Except it isn’t there. You’re still forced into the 3 pane layout that tries to shove everything the world knows about the currently playing track down your throat.

I almost got rid of the 3 pane layout. When the left pane (collection / playlists / etc) is hidden, you can drag the splitter bar all the way to the left and the “now playing” pane disappears. Then I opened the collection pane again. *poof* The “now playing” pane rears its ugly head again.

I hope this is a bug, and that it’ll be fixed in the next update, but at this point I wouldn’t bet my life on it.

I then went to the playlists to set up the same dynamic playlists I have in Amarok 1.4 (”Everything” and several label-based lists that I switch between depending on my mood). While looking around, I did something which made Amarok very angry (whoring the CPU) and froze the UI. This is 2009 people: USE ANOTHER THREAD AND INFORM ME WHAT YOU’RE DOING!

After several long minutes, Amarok finally came back to life and I continue my investigations. There’s no “entire collection” playlist. There’s no label based dynamic playlists. What we have instead is some weird bias stuff I don’t understand (and have no inclination to learn).

On a hunch, I get a track into the playlist and get into the “Edit track details” window. There is no labels tab. I check the other tabs. There are no labels. Well done devs. Another useful feature dropped.

So I won’t be moving my main desktop to Amarok 2 yet, because yet again the KDE developers have delivered something that’s half finished and missing useful features which were there in previous incarnations. To me it seems they’ve gone all gooey-eyed over how shiny it looks without a care in the world that people actually want some functionality out of it.

I really wish I had the time to fork some of these projects (or rebuild them from scratch) and do it right. Amarok joins the KDE desktop on the list of projects I’d fork if I had time, both for the same reasons: OOOOHHHHHHH SHINY! What? You want to actually use our application? You don’t need to use it! Just sit back and enjoy the SHINY!

Edit: All posts which recommend any media player which doesn’t have label-based dynamic playlist support will be deleted. This is the one key feature that I love about Amarok 1.4 and I won’t be moving to any media player that doesn’t have it.

June 16, 2009 :: England

Dirk R. Gently

Vim Basics


Note: This is not mine! I don’t want to be harrassed, sued, or have kittens thrown at me. This great piece I luckily stumbled upon when I was first trying to learn vim. The original piece was part of the original Gentoo Wiki. Because the archive does not have information on the author, I am writing this without his permission. If you are the author please email and tell me what you think. This piece has been slightly editing for clarification.

Introduction

Vim is an advanced text editor that seeks to provide the power of the de-facto Unix editor ‘Vi’, with a more complete feature set. Vim is not a simple text editor like nano or pico. It does require some time to learn, and a great amount of time to master.

About Vim

Vim is probably the most popular incarnation of its predecessor vi, but all vi packages are similar.

Vim is designed to make your fingers work as little as possible, and you should never have to use the mouse. This may seem odd, but once you master Vim, you’ll wonder why other apps don’t behave like it.

Features

  • Vim has syntax highlighting.
  • No-nonsense editor
  • Command mode allows for simple, robust keybindings
  • Vim is very powerful for advanced editing tasks
  • vimtutor is a vim-based tutorial to learn… indeed… vim
  • Uh…vim is good?

Starting Vim

If you start vim with vim somefile.txt you’ll see a blank document (providing that somefile.txt does not exist. If it does, you’ll see what’s in there). You will not be able to edit right away – you are in Command Mode. In this mode you are able to issue commands to vim with the keyboard.

Note: Vim is an example of classic UNIX-style ware. This means that its not flashy, and it won’t hold your hand. It doesn’t come with built-in paperclips and games. It will allow you to get the job done however, and quickly too. Also, all commands are case sensitive. Sometimes the uppercase versions are “blunter” versions (s will replace a character, S will replace a line), other times they are completely different commands (j will move down, J will join two lines).

Let’s work on something. It can be any text file, really. Open that file with vim:

vim foo.txt

Basic Editing

You begin in command mode. If you’re not sure what mode you’re in, press ESC to get to command mode.

You insert text (stick it before the cursor) with the i command. I inserts text at the end of the line. You append text (place text after the cursor, what most people expect) with a. Typing A will place the cursor at the end of the line.

Return to command mode at any time by pressing ESC.

Moving Around

Single Characters

In Vim, you can move the cursor with the arrow keys, but that’s no very efficient is it? You’d have to move your right hand all the way from the standard typing position all the way to the arrow keys, and then back. Not fun.

In vi you can move down by pressing j. You can remember this because the “j” hangs down. You move the cursor back up by pressing k. Left is h (its left of the “j”), and right is l (its right of the “k”).

^ will put the cursor at the beginning of the line, and $ will place it at the end.

^ and $ are commmonly used in regular expressions to match begin and end of the line. Regular expressions are very powerfull and are commonly used in *nix environment, so maybe it is a little bit tricky now, but later you will notice “the idea” behind most of the key mappings. Other commands also use ^ and $ to move/do something from cursor to begin or end of the line.

Multiple Characters

To advance a word, press the w key. W will include more characters in what it thinks is a word. To go back a word, b is used. Once again, B will include more characters in what vim considers a word. To advance to the end of a word, use e. If you haven’t guessed it, E includes more characters to be a word.

To advance to the beginning of a sentence, ( will get the job done. ) will do the opposite, moving to the end of a sentence. For an even bigger jump, { will move the the begining a whole paragraph. } will advance to the end of a whole paragraph.

To advance to the header (top) of the screen, H will get the job done. M will advance to the middle of the screen, and L will advance to the last (bottom).

The repetition department of the repetition department of the…

Here’s an awesome thing: if you press a number before a command, then that command will be executed that number of times over (there are exceptions, but they still make sense, like the s command). For example, pressing 3i then “Help! ” will print “Help! Help! Help!“. Pressing 2} will advance you two paragraphs. This comes in handy with the next few commands…

Deleting

The x command will delete the character under the cursor. X will delete the character before the cursor. This is where those number functions get fun. 6x will delete 6 characters. Pressing . (dot) will repeat the previous command. So, lets say you have the word foobar in a few places, but after thinking about it, you’d like there just to be “foo”. Move the cursor under the b, hit 3x, move to to the next foo bar and hit . (dot). BAM!

The d will tell Vim that you want to delete something. After pressing d, you need to tell Vim what to delete. Here you can use the movement commands. dW will delete up to the next word. d^ will delete up unto the beginning of the line. Prefacing the delete command with a number works well too: 3dW will delete the next three words. D (uppercase) is a shortcut to delete until the end of the line (basically d$). Pressing dd will delete the whole line.

Undo and Redo

vim has a built-in cutboard. Actions and be undone and again redone. Use u to undo and ctrl+r to redo.

Advanced Editing

Pressing s will erase the current letter under the cursor, and place you in edit mode. S will erase the whole line, and place you in edit mode. Pressing 5s will erase 5 letters and place you in edit mode.

Pressing v will put you in visual mode . Here you can move around to select text, when you’re done, you press y to yank the text into the buffer (copy), or you may use c to cut. p pastes after the cursor, P pastes before. V, Visual Line mode, is the same for entire lines. c^v is for blocks of text.

Note: Whenever you delete something, that something is placed inside your buffer and is available for pasting.

Search and Replace

To search for a word or character in the file, simply use / and then the characters your are searching for and press enter (e.g. /myword). To view the next match in the search press n.

To search and replace use the substitute :s/ command. The syntax is: [range]s//]/[arguments]. Some examples:

Command Outcome
:s/xxx/yyy/ Replace xxx with yyy at the first occurence
:s/xxx/yyy/g Replace xxx with yyy global (whole sentence)
:s/xxx/yyy/gc Replace xxx with yyy global with confirm
:%s/xxx/yyy/g Replace xxx with yyy global in the whole file

You can use the global :g/ command to search for patterns and execute a command for each hit. The syntax is: :[range]:g//[cmd]. Some examples:

Command Outcome
:g/^#/d Delete all lines that begins with #
:g/^$/d Delete all lines that are empty

To replace the current word. Place the cursor on the word and execute the command cw. This will delete the word and change the mode to “input”. To replace a letter use r.

Other things

Vim will auto indent. This can be annoying when you have to paste something that contains a space or tab at the beginning of the line. In command mode typing :set paste will disable this. Typing :set nopaste will reenable it.

Saving and Quitting

Write a file with :w or if the file doesn’t have a name :w <filename.txt>. Quitting done with :q. If you choose not to save your changes, use :q!. To save and quit :x.

Using Tabs

If you want to edit multiple documents at once you can use tabs to make it easier:

vim -p <document 1> <document 2>…

Configuration File

vim is ultimably customizable and can be used for many different program languages, personal perferences… and is done so in the configuration file. There’s alot you can do in a .vimrc file, for new users here’s a basic one:

.vimrc

Place in your home directory.

Conclusion

You now know how to use Vim to do slightly more than you could do in a simple editor. As your knowledge of Vim grows, you will be able to use it highly efficiently and do amazing things with text files. And most importantly, you’ll feel right at home playing nethack.

June 16, 2009 :: WI, USA  

Roderick B. Greening

usb-creator-kde - update and screenie

The creator is steadily moving along. Right now the main stumbling blocks are gobject calls in the backend and the use of a DBusGMainLoop in the backend.

Together, these constitute a non-working backend for PyKDE/PyQt. KCrash has become a nightmare.

In order to get around this, we need to pull out the gobject and DBusGMainLoop and move them somewhere related to the frontend. At that point I can re-implement the bits I require as PyKDE/PyQt code, while maintaining a common backend code base.

I've taken the first step, and moved DBusGMainLoop to the gtk frontend via a wrapper. I have re-implemented similar functionality via the same wrapper in the kde frontend using DBusQtMainLoop.

Next on the list is to rip out the gobject calls... I suspect a couple of days before I get that all figured out... (unless I get a real dose of inspiration).

Anyway, here's the screenshot as promised, so you know it's not all pie-in-the-sky :)

June 16, 2009 :: NL, Canada