Posts for Wednesday, August 11, 2010

The Falcon programming lang is now on Git

The falcon programming language has finally moved its source code from its old (original) SVN servers to a new git server. This is awesome news for everyone. Unless you were a developer. I got stripped of all my access (aside from the “read only”). Don’t let me fool you, though, none of my commits were spectacular.

If you want the source code you can clone the following:

http://git.falconpl.org/falcon.git

Enjoy the Penguins!


avatar

Hello 4.5, hello ThoughtScore.

KDE 4.5 is out! (Yes, I am a little late) I was really happy to have contributed just that little bit to this release and hopefully that trend continues. Just wanted to say how much I appreciated this DE and to congratulate and thank everybody for their hard work.

Something else that could be interesting for some is an updated ThoughtScore video I found lying around the other day. You can find the low quality version on WIPUP (I do have a large version but will not host it online). It contains some small changes since the last video and I quite enjoy watching it.

In other news, I got my A Level results today (for those not under the British education system, that’s basically the grades that determine my entrance into university) and I’m exceptionally happy with my results. Any suggestions of stuff to buy to celebrate (recommended food is welcome – and big + useless items that catch my fancy win extra points) are welcome.

Sorry for the lack of blog posts. I am actually doing some stuff which can be seen on WIPUP, and some stuff just aren’t blogworthy enough.

Related posts:

  1. Exams over!
  2. WIPUP now supports video updates!
  3. WIPUP 14.01.10 released!

Paludis 0.52.3 Released

Paludis 0.52.3 has been released:

  • A bug causing screwiness with soft-blocking EAPI 3 packages where both packages installed the same file with an mtime in the distant past has been fixed.
  • GCC 4.5 appears to be unhappy with dlclose being called in a static variable’s destructor. We no longer do this.
  • ACCEPT_LICENSE is now automatically set based upon accepted licences that have been accepted by the user.
  • ‘cave print-id-*’ now have ‘–all’ and will accept wildcards.
  • CONFIG_PROTECT and CONFIG_PROTECT_MASK for installed packages are now accessible as metadata keys.
  • Certain ‘cave’ commands will now suggest possibilities if there is nothing matching the target supplied. Fuzzy name matching will now also suggest packages whose names contain the target as a substring, as well as packages whose names are similar to the target.

Filed under: paludis releases Tagged: paludis

Posts for Tuesday, August 10, 2010

Concepts transcending domain barriers

Today while cooking I was thinking about what kind of talk I might submit to the 27C3 this year. Not that my suggestions ever get accepted or there would be any feedback on why they aren’t but you can’t have everything and looking at how hard it was to get a ticket last year I think that getting a talk accepted is basically the only sane way for a non-Berlin resident to attend the whole shebang. So I thought about concepts, words and their domains. And analogies, can’t forget those!

The human mind can come up with basically unlimited concepts like love, property and speed for example. All those concepts do have a domain where they “work” (a mathematician might say: Where they are defined): The concept of a “server” is defined in the real world as somebody who does work for you. Now we started to build programs that kinda behaved similarly and we called those programs (or the machines they ran on) “server” as well. While both words are identical they mean different things from different domains. The similarity/identity of both words hints at a similarity of both concepts, it symbolizes the analogy between those two concepts.

But as we also know, many concepts don’t really travel well: The concept of property (which we have kinda figured out in the real world of real items) has huge problems when it switches domains and goes online: Where in the real world an item can be at one and only one place, in the virtual world an item can be cloned cheaply and so good that both copies are indistinguishable. Property in the real world and property on a virtual world are not “identical”, they are “analogous” at best.

We use those analogies all the time (not only when it comes to online vs. offline), our languages are full of examples: There are trees in the real world and in every computer science and math book worth its salt. But what is the quality of those analogies? As we have seen they often don’t work as exact as we might want them to be and they even create misunderstandings and completely stupid ideas (like intellectual property for example). Should we drop those analogies that make one concept transcend domain barriers?

While all the problems outlined above are true and severe, there is one great thing about analogies: They show us how we think. Things that we as human beings consider to be similar are not similar (they might be but they don’t have to), they appear similar to us. Whenever we find a similarity or when we see a structure in a new domain that we relate to some already well-known structure, we are not talking about the world, we are expressing how our wonderful brains work. How they find relationships and similarities between the weirdest things: We relate something we hear (music for example) to certain patterns we see in the real world, we find similarities between our ideas and smells, we transcend barriers all the time. And whenever we do, we can learn a lot about what makes us tick.

P.S.: No, I don’t want to talk about property at the 27C3, I don’t wanna beat a dead horse ;)

Let's draw some pixels

I've been getting into pixel art a lot lately. It appeals to me on a lot of levels.

The coder in me likes it because it's so precise. Every pixel is placed just so. The color palette is limited to a dozen colors. Building a drawing out of such limited means reminds me of building programs out of primitives. There are design patterns in pixel art: dithering, manual anti-aliasing. There are abstractions that work and abstractions that don't. There's a lot of goofing around with RGB values and transparency settings; it's perhaps the most deeply computer-based art form you could come up with, and as a deeply computer-based human, I really like it.

The gamer in me is still partly stuck in the early 90's, so it's a huge injection of nostalgia to look at pixel art. NES- and SNES-era games had a charm that is unmatched by anything since. And I don't think that's entirely nostalgia talking; I still play old games and they're still so much fun. And the art in a lot of those games was just darned good. If you stop and look at it really carefully, and start to get an understanding of how it was made, you can't help but be impressed.

The "artist" in me (if there is such a thing in my brain somewhere) is blown away by some of the things good pixel artists can produce. Go look at foolstown.com and try not to slobber. Some of this stuff just looks amazing. Not "good for a pixel drawing", but good on a level anyone could appreciate.

Pixel doodles are also good practice for the RPG my wife and I are still ever-so-slowly creating. Creating art and music for a game are turning out to be much harder work than programming it.

In any case, I drew a cow standing beside a tree. And I made a new pixel art page to house my admittedly still-amateurish drawings.

Cow Tree

avatar

Twitter intergration

In order to further comply to the Web 2.0 I now linked my twitter account to my blog (or vise versa). There now is a twitter widget (on the right) which shows my latest tweets. Don’t really know the use of this but it didn’t look to bad and follows the css rules pretty well. The other thing is that every time I blog (once every two months) this a tweet is send automatically.

Well I hope you are as excited as I am about this :P

P.s. The site also had a wordpress upgrade (finally on 3.x) and as a bonus I also upgraded the theme to a new version :)

Pixel Art

Made using Pro Motion 6.

Tree 1 Tree 2 Cow

Paludis 0.52.2 Released

Paludis 0.52.2 has been released:

  • ‘cave perform’ now calls ‘_fail’ hooks.
  • ‘cave print-id-contents’ now has ‘–type’
  • ‘cave print-packages’ now has ‘–repository’ and ‘–category’
  • Output buffering of commands has changed to better handle progress bars of the kind displayed by ‘wget’ and ‘git’. To avoid excessive hopping, ‘cave execute-resolution’ will now only switch between buffered outputs every few seconds, rather than 0.1s if new output is available.
  • ‘cave display-resolution’ now shows flag changes in a more obvious manner.
  • ‘cave purge’ and purge checking for ‘cave resolve’ are now significantly faster.
  • ‘cave resolve –less-restrictive-remove-blockers’ is now much more likely to be able to fix breakages by reinstalls. A horrible error that was most easily triggered by use of this option is now fixed.

Filed under: paludis releases Tagged: paludis

Posts for Monday, August 9, 2010

Short Rekonq 0.5.0 user review

Lately I've been trying Rekonq to see what all the fuzz's about. In short it's an alternative web browser for KDE, which uses WebKit[1] and aims to be lightweight.

I don't intend to judge it by how it renders web pages, since many web pages still don't follow the W3C standards, so I usually have several browsers installed, so I have KHTML, WebKit, Gecko and for emergencies text-only. Also Konqueror in the newest release already supports both KHTML and WebKit, so that's not a relevant question.

Here's in short what I found out when using Rekonq 0.5.0 for a few days/weeks as the default browser (compared to Konqueror 4.4.4):

pro:

  • no menu bar
  • no status bar, but the URL show in the bottom of the window the webpage when hovered — I love that! In fact, I'd like to see that everywhere in KDE — Konqueror, Akregator, KMail, etc. etc.
  • adblock subscription
  • rearranging tabs with mouse works
  • page previews are nice
  • location bar filling up when loading is a nice touch
  • the hack with the forced bright background makes badly written web sites work also under dark themes
  • searching only parts of the URL from the location bar works (although it's not as good as Firefox' yet)

con:

  • scrolling not smooth, sometimes autoscroll doesn't work
  • middle-click in window does not (always?) open the pasted URL
  • missing keyboard shortcut to move tabs
  • i don't like the close buttons integrated into tabs — I prefer Konqi's close button on the far right of the opened tabs and the new tab button on the far left
  • missing bookmarks: KIO slave (and others, but those are not so much browser-related)
  • favicons don't work always
  • a lot of missing features. Amongst others a quick way to add AdBlock rules from browser (like via right-clicking an ad)
  • sessions would be nice ...maybe TabCandy is not the best way to tackle it, but it's not a bad idea
  • I actually like that Ctrl pops up shortcuts in Konqueror
  • the hack with the forced bright background does look quite ugly and still is just an ugly hack (works though)

Bottom line: for now I switched back to Konqi, but will continue to follow Rekonq's develpment closely. I feel comparing the two is quite similar to comparing the whole Mozilla Suite and Phoenix (= how Firefox was named initially) in the early 2000's — it's a clean, no bloat underdog, but as of now, feels underpowered and a bit clumsy compared to the beast it's trying to replace. I won't be as bold to predict their future to be the same as Mozilla Suite vs. Firefox, but I'll say I wouldn't be surprised if that happens.

Side note: both share the annoyance with how KDE handles cookies — the rules get wiped out every few days.

Also, it'd be a nice idea in general to have Stop and Reload in one single button. If the page (or anything else for that matter) is loading, reloading doesn't make sense; while if the page (etc.) is loaded, stopping it doesn't make sense. Therefore in turn one of these two buttons is always obsolete.

hook out >> sipping my bloody well deserved tea and deciding to apply for the Gentoo License team...


[1] WebKit started as Apple's fork of KDE's KHTML (both are HTML layout engines) and is now used by Safari, Chrome and several other web browsers.
<!--break-->

A Glimpse Into cave: Resolving Purges and Dependents

What happens when you upgrade a package, and the new version no longer uses a library that the old version did, and now nothing else uses that library either? In primitive distributions, you’re stuck with that library forever; in Gentoo and Exherbo the package manager will be able to tell you that the library is no longer used by any package in world. Until now, this has been a “do this once in a while, and try to remember what the heck all those things are” kind of affair. However, cave is cleverer:

pyxml no longer used

And you can easily decide to take it as part of the upgrade process (safely, since cave supports mixing installs and uninstalls with dependencies etc):

pyxml purged

This can also work with slots — however, doing so safely requires accurate slot information from packages, which sadly can’t take place in Gentoo until EAPI 4 is implemented in Portage.

Similarly, cave will tell you if you’re about to do something dangerous:

xulrunner breaks firefox

And if you decide to remove the packages that would be broken, rather than allow breakage to occur, you get to see more nice examples of purges:

xulrunner plus dependents has purges

This all works for downgrades too, as well as upgrades (although upgrades rarely break things, and when they do it’s time to yell at someone):

old asciidoc breaks awesome

And finally, if you’re about to do something immensely stupid, you’ll be told:

iputils is in system

All of this happens automatically, so there’s no need to remember to turn it on.


Filed under: cave for users Tagged: cave, paludis

Posts for Sunday, August 8, 2010

A Glimpse Into cave: Mask and Use Flag Overriding for Resolves

For a long time, Paludis has been able to work out suggestions for what unmaskings you might want to do when installing a particular package that is either masked or has masked dependencies. This functionality is also present in the shiny new cave client, which uses the much more powerful new resolver. Now this functionality is also available for unmet use dependencies.

For example, rather than getting pages and pages of errors when attempting to install gnome:

resolve gnome errors with no overrides

You’ll now get:

resolve gnome errors

Note how you are told all the suggested changes up-front. You aren’t just given a single error, which you can fix and then re-run the command to get another error and so on. Nor are you just given all the errors in the initial resolution; the resolver carries on with its suggested changes and accumulates any additional errors that will occur if you take those suggestions. In the first example, parted isn’t mentioned at all in the initial set of errors, because it is only brought in to the resolution by udisks, which is only brought in via gnome-disk-utility, which is only brought in via gvfs if the gdu use flag is enabled, which we don’t have enabled by our config but that is required by gnome. The resolver is smart enough to work all of this out upfront, sparing you from an eternity of running things over and over.

We’re still experimenting with the UI for errors — it’s probably possible to make it even easier for the user to see what changes need to be made. There have also been requests to make cave able to add the necessary lines to your configuration files automatically (after confirmation, of course). However, I’m not convinced that this is a good idea in practice — for example, cave would suggest turning a particular use flag on for a half dozen packages, but would not realise that turning it on globally may be a better option.

As always, if you find that all these shiny new features save you from horrible torment, books or pens (pens being a vital part of the high tech design process) are much appreciated.


Filed under: cave for users

Paludis 0.52.1 Released

Paludis 0.52.1 has been released:

  • glibc 2.12 changes the OS ABI used by its libraries. ‘cave fix-linkage’ and ‘reconcilio’ have been updated to ignore OS ABI mismatches to avoid marking every package that uses libc as being broken.

Filed under: paludis releases Tagged: paludis

Posts for Saturday, August 7, 2010

The Airtunes 2 Protocol

Over the last year, a brave team has intermittently been hard at work openly describing the protocol used by Apple’s Airport Express, RAOP. It turns out there are two protocols — Airtunes 1 and Airtunes 2. Airtunes 1 was described by Jon Lech Johansen, of DeCSS fame, but the Airtunes 1 protocol lacks crucial timing information needed for reliable and video-synced audio. This in particular has posed a problem for PulseAudio. Airtunes 2, to this date, has only been known by Apple and the proprietary third party software Airfoil. For the purpose of interoperability and education,

Today we open up the beginning of our Airtunes 2 specification to the community.

A member of the team is hard at work on the PulseAudio module, but if you’d like to help, don’t hesitate to contact us. And of course, implementing this in other places too would be more than welcome. Finally, we still need to finish the specification, so if you can offer any assistance, please do let us know. We’re on #airtunes2 on freenode.

Review: What Do You Care What Other People Think?

I recently reviewed Surely You're Joking, Mr. Feynman!. It was good enough that I had to get the sequel.

What Do You Care What Other People Think? is another collection of stories and anecdotes written by and/or about Richard Feynman. A bit in contrast to the first book, rather than a chronological series of anecdotes, this book focuses on a couple of main topics.

Feynman discusses his first wife in some detail. Of particular interest, he describes his and his wife's brutal devotion to honesty in their relationship, even in the face of highly unpleasant truths (terminal disease, in this case). It's the honesty of a scientist, carried into "everyday" life. This was bittersweet for me to read, because the story has a sad ending.

There is also a short series of letters from Feynman to others, where he discusses the silliness of pomp and circumstance, e.g. his foibles and breaches of protocol when meeting some king or other. As someone who hates ceremony, I got a huge kick out of these.

A large part of the book is devoted to discussing the Presidential Commission which investigated the cause of the Challenger shuttle disaster. Feynman's full report is included in the book as well.

As someone interested in astronomy and space flight (and who isn't interested in those?) I found this fascinating. There's a lot of behind-the-scenes stuff. Engineers are painted in a good light, managers and politicians not so much. (Software engineers come out looking especially good, which made me feel (unjustifiably) good about myself by proxy.) There are some diagrams and a lot of technical discussion of the shuttle. Not so much that it drowns the narrative, but enough that I'm probably going to spend the next week reading Wikipedia on the subject now.

Feynman explains his simple methods at getting to the truth in the investigation. Go talk to the guys who put things together. Get your hands on some O-ring rubber and test its resistance to temperature yourself in a glass of ice water. Cut to the heart of the matter. It's good stuff.

Ultimately, as you know if you've read the report, Feynman rips NASA apart, showing that they were fooling themselves into believing the shuttle was safer than it really was. The last sentence of the report says everything: "Nature cannot be fooled."

The last section of the book discusses the value of science. More specifically, Feynman discusses the value of doubt. I very much liked how the chapter ends:

It is our responsibility as scientists , knowing the great progress which comes from a satisfactory philosophy of ignorance, the great progress which is the fruit of freedom of thought, to proclaim the value of this freedom; to teach how doubt is not to be feared but welcomed and discussed; and to demand this freedom as our duty to all coming generations.

If there's one trait I had to pick to separate good people from bad, it would be the ability to admit being wrong. And if I had to separate the good from the excellent, it would be not just the ability to admit being wrong, but the eagerness to be proved wrong.

There's a certain kind of devotion to the truth that not many people achieve, and maybe not many people even want to achieve. There's comfort in thinking that you know things. It's very tempting. I think it's probably partly why most people are religious. I suspect it's a big reason why so many people are so stubbornly wrong about so many things in general. I suspect this comfort is an enormous source of suffering in the world.

But there's another kind of comfort that people miss out on. It's the comfort of knowing that although you're probably wrong about a lot of things, you're trying your hardest to be right. You pay the price of being aware of your own state of ignorance, but you can rest a bit easier knowing that you're maybe, hopefully, inching towards the truth. I never heard the word "freedom" used to describe this feeling before, as Feynman does above, but it fits.

That's why I like reading about Feynman and reading Feynman's words. He seemed to live this philosophy as well as anyone could hope to.

Posts for Friday, August 6, 2010

X automation with xte

I learned today (via a great blog post) about xte. This program lets you simulate X Windows mouse and keyboard events from the commandline. How much more awesome can you get?

Hans illustrates how to integrate xbindkeys and xte to make KDE4 effects activate. I wanted the KDE4 "Desktop Grid" to appear when I press a mouse button (because my new mouse has a lot of buttons to spare), so this is exactly what I was looking for.

xte is the kind of glue that makes Linux awesome. KDE lets you set global keyboard shortcuts for lots of things. xbindkeys lets you assign shell commands to mouse buttons. And xte ties the two together. Possibly none of the programmers on these three tools knew about the others, but they interact perfectly to let you do anything you want.

You may be thinking, "If you want to work with KDE from the commandline, why not use DBUS?" That's what I tried to do first. But I can't for the life of me figure it out. There's some indication that we might be able to do this somday, like so:

qdbus org.kde.kglobalaccel /component/kwin org.kde.kglobalaccel.Component.invokeShortcut ShowDesktopGrid

Or maybe it's already in the latest version of KDE and I haven't upgraded yet. Either way.

By the way: could DBUS possibly have a more verbose or cryptic interface? I was hunting through the available DBUS commands looking for something that would show the Desktop Grid, and I ended up having to scan through lists of crap like this:

~ % qdbus org.kde.kwin /KWin                         
method Q_NOREPLY void org.kde.KWin.cascadeDesktop()
method void org.kde.KWin.circulateDesktopApplications()
method bool org.kde.KWin.compositingActive()
signal void org.kde.KWin.compositingToggled(bool active)
method int org.kde.KWin.currentDesktop()
method QList<int> org.kde.KWin.decorationSupportedColors()
method void org.kde.KWin.doNotManage(QString name)
method Q_NOREPLY void org.kde.KWin.killWindow()
method QStringList org.kde.KWin.listOfEffects()
method void org.kde.KWin.loadEffect(QString name)
method QStringList org.kde.KWin.loadedEffects()
method void org.kde.KWin.nextDesktop()
method void org.kde.KWin.previousDesktop()
method Q_NOREPLY void org.kde.KWin.reconfigure()
method void org.kde.KWin.reconfigureEffect(QString name)
method void org.kde.KWin.refresh()
signal void org.kde.KWin.reinitCompositing()
signal void org.kde.KWin.reloadConfig()
method bool org.kde.KWin.setCurrentDesktop(int desktop)
method void org.kde.KWin.showWindowMenuAt(qlonglong winId, int x, int y)
method Q_NOREPLY void org.kde.KWin.toggleCompositing()
method void org.kde.KWin.toggleEffect(QString name)
method Q_NOREPLY void org.kde.KWin.unclutterDesktop()
method void org.kde.KWin.unloadEffect(QString name)
method bool org.kde.KWin.waitForCompositingSetup()
method QDBusVariant org.freedesktop.DBus.Properties.Get(QString interface_name, QString property_name)
method QVariantMap org.freedesktop.DBus.Properties.GetAll(QString interface_name)
method void org.freedesktop.DBus.Properties.Set(QString interface_name, QString property_name, QDBusVariant value)
method QString org.freedesktop.DBus.Introspectable.Introspect()

This is line noise to me.

Paludis 0.52.0 Released

Paludis 0.52.0 has been released:

  • format=”exheres” and format=”ebuild” are now deprecated in favour of format=”e”.
  • Specifying ‘root’ in a repository config file now overrides the environment-supplied default.
  • ‘cave resolve’ will now select packages even if [use] dependencies are unmet, and will display the necessary changes needed to user configuration.
  • ‘cave resolve –without’ will now allow nothing at all to be installed.
  • ‘cave resolve’ now has options for chroot handling.
  • ‘cave execute-resolution’ now writes resume data after every job completion, rather than just upon normal exit.
  • ‘cave import’ now has ‘–strip –preserve-work’ options, and the default for build_options: preserve_work is now disabled.
  • ‘cave print-ids’ now has short options.
  • ‘cave display-resolution’ now displays better job count information, and more compact at displaying circular dependencies.

Filed under: paludis releases Tagged: paludis

Qt Git Mirror

I frequently find myself wanting to look through the Qt source or look through a couple of commits. I could keep a copy of Qt checked out on all the computers I use, and flick through the repository using git command-line or qgit or even git instaweb, but this is usually less convenient than simply heading over to gitorious. Unfortunately, gitorious is notoriously sluggish and I find their site design a bit hindering as well.

So I’ve decided to mirror Qt’s repository on my personal server running cgit, which is much much faster than Gitorious. It’s synced once an hour by cron. And if nobody abuses this, I’ll keep it open for the community.

Head on over to git.zx2c4.com/qt.

Next up, I might attempt to mirror KDE’s subversion repository on my CGit. I’m not a very big fan of websvn, and I know KDE is moving to git, but the main tree won’t be moved for quite some time. Anyone an expert at git-svn and can provide some tips for a mirroring script to a bare repository? As we speak, I’m running git svn fetch on a repository made with git svn init --stdlayout svn://anonsvn...., and then manually adjusted to be bare. The import is taking a long time…

Update update update: Holy cow. After leaving git svn fetch running overnight, I’m on revision 41671 of 1159974… which is only 3.5% done (and by the way, I’m running this out of a data center’s über-bandwidth connection). KDE has a huge history; this is obscene. Any pointers here? Should I stop this? Have I done something silly that will render the eventual result unusable?

Media's response to the Hacker != Cracker open letter

A few days ago FSFE Fellowship group Slovenia sent an open letter concerning the misuse of the term "hacker". There is an English translation (with the Slovenian original) available on my page as well.

Today I am happy to report that this action had a bigger impact that we hoped for!

I know we haven't changed the world with this action ...but maybe we just made it a tiny bit better nontheless and perhaps even inspired others around the world to try the same ;)

hook out >> rainy day, home improvement to help with and hopefully soon time to study :P
<!--break-->

ansicolor: because the view is better in colors

If you’re a coder you probably try to modularize everything to death on a daily basis. If not, your practices are a little suspicious. :nervous: Alas, it’s not so easy to knock out something that I can say with confidence will be reusable in the future. One piece of functionality I keep reimplementing is output in colors, because it’s hugely helpful to making things look more distinct. The first time I wrote this module I knew I would be using it again and I wished to make it nice and reusable, but I didn’t know what the future uses would be. So I put that off until “later”. In the meantime I copy/pasted it a couple of times into other projects. Shameful, but effective.

I finally got around to organizing these types of bits that have no specific place of their own into a new github repository, appropriately named “pybits”. It holds the pretty printer and this rewritten ansicolor module, and it’ll probably grow with the ages.

But to business. Anyone spitting out ansi escapes who has figured out the system knows it’s trivial to make a color chart. So to keep the tradition going, here’s proof that ansicolor is able to enumerate the colors:

ansicolor_chart

Notice that section at the bottom about highlighting colors. As you might be able to deduce by sheer logic, black and white are not great colors for highlighting something in a terminal, because they are typically used respectively as the background and foreground of the term (or vice versa). (The colors of a term can actually be anything, but black and white are the common ones. Ideally, code should detect this at runtime, but I don’t know of a way to check for this. Besides, lots of programs [eg. portage] do make this assumption also.) So the highlighting colors are supposed to be useful for when you want to output a wall of text and mark something in the middle of it, so the user can spot it.

Suppose you are (as I have been in the past) developing a regular expression and you can’t get it right on the first try (yeah, unbelievable, I know). Well, what you do is highlight the string so you can see how the matching worked out:

ansicolor_1regex

Regular expressions tend to get hairy (yes way) so it helps to compare their results when you’re trying to unify two half-working variants into one. Adding a second regex will show the matches from both. Where they overlap the styling is bold:

ansicolor_2regex

Think of the green highlighting as a layer of paint on the wall. You then paint a layer of yellow on top, but you don’t cover exactly the same area. So where the green wasn’t painted over it’s still green. Where the yellow covered it, the paint is thicker. And where the yellow didn’t overlap the green it’s just plain yellow.

Adding a third regex potentially produces segments highlighted three layers thick, so there the color becomes reverse.

ansicolor_3regex

And then bold and reverse.

ansicolor_4regex

ansicolor doesn’t support background colors, but that’s a product of my use so far, I’ve never needed it. I don’t think they improve readability.

You will find this cutting edge technology in the repo:

Posts for Wednesday, August 4, 2010

avatar

ALIX 2D13: 2.6.35, LEDs, lighttpd, lmsensors

ALIX 2D13It’s a good thing I waited a few days before releasing my next ALIX-post. I was gonna talk about the leds-alix module and where to download it, but in the meantime 2.6.35 was released and already contains all the necessary code. So, besides this post there is a new config: Linux 2.6.35 vanilla for ALIX 2D13. A few changes to the 2.6.34-config I posted last time:

  • I didn’t choose the Geode GL/GX last time, doh!
  • The kernel is no longer tickless (performs better)
  • Threw out some modular crypto-stuff (which I missed the last time)

There are three front-LEDs on the ALIX board, so nothing fancy. The interesting is that there are predefined triggers for these LEDs in /sys/class/leds/ which will make the LEDs display one of the following: heartbeat = load average (blinking speed), ide-disk (write access to the cf-card), timer, etc. Just try cat trigger to see the possible values. There is also the possibility to trigger on matches from iptables (think: traffic on port 22 ;). However my iptables userland seems to be outdated, so I will have to report about this another time.

LighttpdFurthermore I tried using lighttpd instead of gatling on my fat external drive, and it performed even better, using slightly less CPU. In the kernel I activated the deadline IO-scheduler as default (while keeping CFQ and NOOP as an option), let’s see how that plays out. I’m still not getting more than 9MB/s using Samba, while the CPU is mostly idle and lighty completely saturates the 100MBit link, really annoying.

lm_sensors on the ALIX are no problem either. Just try my kernel-config or make sure to activate the basic I2C-stuff and CONFIG_SCx200_ACB. My ALIX runs at comfy 42°C when not under load.

I already talked about using tmpfs for some of the directories written to frequently (/tmp, /var/tmp, /var/run, /var/log, /var/lock). I don’t care about logs right now, so I don’t mind losing them on reboot. Some daemons however complain or won’t start if their log-directories aren’t set up, so you should do that with an init-script. I uploaded my script here, which will work with Debian and also sets up two LEDs and the deadline scheduler in case it isn’t the default.

CGit and Wiki-Markup: restructuredText, Mark Down, Whatever-You-Want

I wrote in a previous post about hacking restructuredText support into cgit by way of some nasty .htaccess and cgi scripts. Well, now I’ve built support into CGit properly.

I have in my cgitrc:

repo.readme=master:docs/readme.rst
repo.about-filter=/home/gitcode/web/rst2html/rst2html

about-filter is a feature cgit has always had which pipes the readme file through that command before displaying it. In this case, it’s just the standard docutils restructuredText python script. The killer new feature here is the ability to specify that the readme file tree comes from a specific git head. This says to pull it from the master repository. I could specify any branch or even a sha1 id of a specific commit.

So now, http://git.mywebpage.com/about will display the restructuredText of doc/readme.rst converted to its nice HTML display. Best of all, I can go to http://git.mywebpage.com/about/otherfile.rst, and this will translate to master:docs/otherfile.rst. I could replace the about-filter with something for markdown or even a script that chooses which filter based on file name, and get something identical to Github’s readme feature. Now it’s in cgit. Hopefully Lars will pull this soon, as he did my other patches.

Posts for Tuesday, August 3, 2010

CGit and restructuredText

A project of mine (which I’ll announce in a few days) uses restructuredText and git. So, showing an html-ified version of the restructuredText was the logical thing to do. CGit dumps the plain text of a file at http://git.website.com/ProjectName/plain/path/to/myfile. I wanted to add onto this a restructuredText dump at http://git.website.com/ProjectName/rst/path/to/myfile. One solution would be to patch cgit, but instead I chose to build around it and use the handy docutils to do the conversion.

The tool rst2html takes rst on stdin and pushes html on stdout. The first thing we need to do is make an rst2html wrapper and push certain URLs to it. My cgit installation already has a pretty advanced .htaccess for rewriting cgit urls, and here we’ll augment the one in that post with:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*)/rst/(.*) /rst.cgi/$1/plain/$2 [L,PT,NS]

This internally rewrites all traffic at http://git.website.com/ProjectName/rst/path/to/myfile to http://git.website.com/rst.cgi/ProjectName/plain/path/to/myfile. This means that the CGI environment variable PATH_INFO is set to http://git.website.com/ProjectName/plain/path/to/myfile. CGit looks at PATH_INFO to determine which page to show, so all we have to do is call cgit.cgi and pipe it to rst2html:

#!/bin/sh
echo "Content-Type: text/html"
echo
./cgit.cgi | ../rst2html/rst2html

However, cgit spits out HTTP headers of its own, which we need to strip:

#!/bin/sh
echo "Content-Type: text/html"
echo
./cgit.cgi | sed -n '/^$/,$p' | ../rst2html/rst2html

The sed command prints all lines after the first empty line.

This is all fine, but cgit nicely caches output, and so should our rst script. To do this we need to look at the Last-Modified and Expires headers that cgit spits out and compare them to a cache file if it already exists. If the cache is dirty, we call rst2html on cgit’s output and tee it to the cache file to update it for the next call. If it’s clean, we just cat the cache. Along the way, we make sure to copy cgit’s HTTP cache headers for the rst file.

#!/bin/sh
plain=$(./cgit.cgi)
expiration=$(echo "$plain" | sed -n 's/^Expires: \(.*\)$/\1/p')
lastmodified=$(echo "$plain" | sed -n 's/^Last-Modified: \(.*\)$/\1/p')
echo "Content-Type: text/html"
echo "Expires: $expiration"
echo "Last-Modified: $lastmodified"
echo
expiration=$(date -d "$expiration" +%s)
lastmodified=$(date -d "$lastmodified" +%s)
cache="../rst2html/cache/$(echo $PATH_INFO | md5sum | cut -d ' ' -f 1)"
cachetime=0
if [ -f "$cache" ]; then
        cachetime=$(stat -c %Y "$cache")
fi
if [ $cachetime -ne 0 -a $cachetime -lt $expiration -a $cachetime -ge $lastmodified ]; then
        cat "$cache"
else
        echo "$plain" | sed -n '/^$/,$p' | ../rst2html/rst2html | tee "$cache"
fi

Posts for Monday, August 2, 2010

Open letter to the media about the misuse of the term "hacker"

In the past few days/weeks in Slovenian media there was a big boom about three Slovenian citisens who allegedly cooperated in the Mariposa botnet. If you don't know what this is about read this press release from the FBI. The media has repeatedly called these alleged cybercriminals "hackers".

Since this is a wrong use of this term and a lot of us refer to ourselves and others amongst our midst as "hackers", in the Fellowship group Slovenia we felt that something had to be done.

So we wrote and sent an open letter to the media explaining the difference between "hackers" and "crackers" and kindly asking the media to use this words correctly in the future. This action was backed up by several other groups and institutions.

The whole text of the open letter and its translation follow bellow.
<!--break-->


Dear Sir/Madam,

in the past weeks, especially in connection with the story about FBI's action against a cybercrime which led to the arrest of a suspect in Slovenia, the word "hacker" has been used several times in the media in the wrong context and the wrong way. Since this term is differently understood by the experts than by the lay public, we feel it appropriate to warn about it in this open letter[1].

"Hacker" comes from the verb "to hack", which is an expression that originated in the 50's of the previous century at MIT[2] and means solving a technical problem in an unique way. In the computer jargon it is still used to label inventive and original modifications of a program or system, based on a deep understanding and in a way that was originally not intended.

Many authorities in the field of computers and security understand the term hacking as a state of mind, thinking outside of boundaries, established ways and methods and trying to overcome these obstacles. In many examples hackers are putting their skills and inventiveness into good causes and the public good by making their programm available to everybody to use and modify. Examples of such free software[3] are: GNU/Linux, Mozilla Firefox, Mozilla Thunderbird, Google Chromium, OpenOffice.org, SpamAssassin, GIMP, Scribus etc.

It was the media and movie industry which later (falsely) used the word hacker to describe cybercriminals; which of course caused confusion. This mess is increased by the still evolving terminology and translations in the Slovene language.

A more appropriate term for a person, who with criminal intent breaks into computer systems is "cracker". People who abuse security systems without authorization and/or use ICT (usually computers, telephones or networks) for breaking into systems and performing illegal or criminal activities — vandalism, credit card abuse, identity theft, piracy and other types of illegal activities[4].

Also, the Slovene dictionary of informatics[5] distinguishes between "hacker" as "technically versed computer enthusiast" and "cracker" as "who breaks into computer systems with intent to use data or programs without authorization".

This is why we should call the current suspects of computer-based crimes, "crackers."

In the past decades many technological advances were also a result of the hacker phenomenon — personal computers, the Internet, free software — therefore it would be wrong to equate hackers with criminals. An analogy to this could be if chemists or pharmacists were all called poisoners and murderers.

We understand that the current confusion has been in existence for quite some time and this is exactly why we think it is high time that we clarify it together. So we ask of you to, please, in the future use the right term.

best regards,

Matija Šuklje
coordinator
FSFE Fellowship group Slovenia[6]

co-signatories:

Andrej Kositer,
president
[COKS] Center odprte kode Slovenije[7]

mag. Simon Delakorda,
direktor
[INePA] Inštitut za elektronsko participacijo[8]

Andrej Vernekar,
predsednik
[LUGOS] Linux user group of Slovenia[9]

Klemen Robnik,
vodja
Kiberpipa/Cyberpipe[10]

Ljudmila[11]

[1] This open letter is available also on the website: https://wiki.fsfe.org/FellowshipSloveniaOdprtoPismoHeker
[2] Massachusetts Institute of Technology
[3] Definition of free software on the Free Software Foundation Europe's website:
http://fsfe.org/about/basics/freesoftware.en.html
[4] http://en.wikipedia.org/wiki/Hacker_(computer_security)#Black_hat
[5] http://www.islovar.org/
[6] FSFE Fellowship Group Slovenija — http://wiki.fsfe.org/groups/Slovenia — is a group of supporers of Free Software Foundation Europe and free and open source software in general, organised in a civil initiative. We stand for free software, open standards and open formats.
[7] Open Source Center Slovenia [COKS] — http://www.coks.si — is Slovene national supporter of development, usage and knowledge of open source technologies and OS solutions. We provide aid and support to OS users in public and private sector and cooperation with EU bodies concerning open source and e-governance policy.
[8] Institute for Electronic Participation [INePA] — http://www.inepa.si — is a non-profit NGO on the field of e-democracy. INePA carries out applicative and development projects as well as advocative and connecting activites for NGO's, institutions and individuals who are standing for strenghtening of the democracy and political participation using ICT. The institute is a member of the Pan-European eParticipation Network and the Central and Eastern European Citizens Network.
[9] LUGOShttp://www.lugos.si — is an association of users of the free and open source operating system GNU/Linux. Amongst other activities, it offers user support and translates free software. Other activities are also the open wireless network of Ljubljana (wlan-lj) and weekly lectures Pipe's Open Terms (in cooperation with Cyberpipe).
[10] Kiberpipa/Cyberpipe — http://kiberpipa.org — is a collective of open source and digital freedom advocates. In the centre of Ljubljana it creates digital culture, educates expert and lay public by means of presentations, lectures and workshops.
[11] Ljudmila — http://www.ljudmila.org — Ljubljana lab for digital media and culture (1994) is the first non-profit laboratory in Slovenia which supports inventive and creative research through project work in the field of internet, digital video, electronic art, digital radio, communication, open source software development and connects all of these in an interdisciplinary way. It also enables autonomous as well as workshop-based group education and is the founder of the network of multimedia centres of Slovenia "M3C".


...and the Slovene original, which was sent to the media:

Spoštovani,

v zadnjih tednih se je predvsem v povezavi z novico o akciji FBI proti spletnemu kriminalu, ki je privedla do aretacije osumljenca v Sloveniji, v medijih večkrat pojavila beseda „heker“ in sicer v napačnem kontekstu ter uporabljena na napačen način. Ker se v strokovnem jeziku ta termin povsem drugače uporablja kot ga razume laična javnost, se nam zdi primerno na to opozoriti v tem odprtem pismu[1].

Heker (ang. „hacker“) izvira iz glagola „hekanje“ (ang. „to hack“), kar je izraz, ki se je sprva prijel v 50ih letih prejšnjega stoletja na MIT[2] in pomeni reševanje tehničnega problema na samosvoj način. V računalniškem žargonu se še vedno uporablja za na poglobljenem znanju temelječe, inovativne in izvirne modifikacije programa ali sistema na način, ki sprva ni bil predviden.

Mnoge avtoritete na področju računalništva ter varnosti pojmujejo hekerstvo kot stanje duha, razmišljanje zunaj okovov, ustaljenih pristopov in načinov ter poskušanje premostiti te ovire. V veliko primerih hekerji svoje veščine in inovativnost uporabijo v dobre namene in v dobro vseh, dajo program na voljo vsem v uporabo in nadaljnjo modifikacijo. Primeri takih prostih programov[3] so GNU/Linux, Mozilla Firefox, Mozilla Thunderbird, Google Chromium, OpenOffice.org, SpamAssassin, GIMP, Scribus idr.

Za poimenovanje kiberkriminalcev so besedo heker kasneje (napačno) popularizirali mediji ter filmska industrija, zaradi česar je seveda prišlo do zmešnjave. To zmešnjavo dodatno povečuje nedorečenost prevodov in prevzemanje terminologije v slovenskem jeziku.

Pravilnejši termin za osebo, ki kriminalno vdira v računalniške sisteme je „vdiralec“ ali „kreker“ (poslovenjeno iz ang. „cracker“). Osebe, ki izrabijo varnostne sistem brez pooblastil in/ali uporabljajo informacijsko komunikacijsko tehnologijo (običajno računalnike, telefone ali omrežja) za vlamljanje in izvajanje nelegalnih ali kriminalnih dejavnosti – vandalizma, zlorab kreditnih kartic, kraje identitete, piratstva ali drugih tipov ilegalnih dejavnosti[4].

Takšno razliko pozna tudi slovenski slovar informatike[5], ki navaja pojem „heker“ kot „tehnično dobro podkovan računalniški zanesenjak“ in pojem „kreker“ kot „kdor vdira v tuje računalniške sisteme z namenom nepooblaščeno uporabljati podatke ali programe“.

Zato je potrebno imenovati trenutno aktualne osumljence računalniškega kaznivega dejanja kot vdiralce oz. krekerje.

V zadnjih desetletjih je mnogo tehnoloških pridobitev tudi rezultat fenomena hekerstva — osebni računalniki, internet, prosta programska oprema — zato je napačno, da se hekerja enači s kriminalci. Podobno, kot bi kemika ali farmacevta enačili z zastrupljevalci in morilci.

Zavedamo se, da terminološka zmešnjava obstaja že dlje časa in ravno zato menimo, da je skrajni čas, da jo skupaj odpravimo. Zato vas lepo prosimo, da vsaj v prihodnje uporabljate pravilni izraz.

lep pozdrav,

Matija Šuklje,
koordinator
FSFE Fellowship skupina Slovenija[6]

sopodpisnice:

Andrej Kositer,
predsednik
[COKS] Center odprte kode Slovenije[7]

mag. Simon Delakorda,
direktor
[INePA] Inštitut za elektronsko participacijo[8]

Andrej Vernekar,
predsednik
[LUGOS] Linux user group of Slovenia[9]

Klemen Robnik,
vodja
Kiberpipa[10]

Ljudmila[11]

-.-.-
[1] Odprto pismo je na volju tudi na strani https://wiki.fsfe.org/FellowshipSloveniaOdprtoPismoHeker
[2] Massachusetts Institute of Technology
[3] Definicija prostega programja na strani Free Software Foundation Europe:
http://fsfe.org/about/basics/freesoftware.en.html
[4] http://en.wikipedia.org/wiki/Hacker_(computer_security)#Black_hat
[5] http://www.islovar.org/
[6] FSFE Fellowship skupina Slovenija — http://wiki.fsfe.org/groups/Slovenia — je skupina podpornikov Free Software Foundation Europe[] ter prostega in odprto-kodnega programja nasploh, organizirano v civilno iniciativo. Zavzemamo se za prosto programje, odprte standarde in odprte formate.
[7] Center odprte kode Slovenije [COKS] — http://www.coks.si — je nacionalni spodbujevalec razvoja, uporabe in znanja o odprtokodnih tehnologijah in rešitvah. Razvojno podporni Center Odprte Kode Slovenije nudi uporabnikom centraliziran sistem storitve pomoči in podpore ter zagotavlja rešitve za potrebe javnega in zasebnega sektorja.
[8] Inštitut za elektronsko participacijo [INePA] — http://www.inepa.si — je nepridobitna nevladna organizacija na področju e-demokracije. INePA izvaja aplikativne in razvojne projekte ter strokovne, zagovorniške in povezovalne dejavnosti za nevladne organizacije, institucije in posameznike, ki si prizadevajo za krepitev demokracije in politične participacije s pomočjo informacijsko-komunikacijskih tehnologij. Inštitut je član Evropske mreže za elektronsko participacijo in Državljanske mreže za srednjo in vzhodno Evropo.
[9] LUGOShttp://www.lugos.si — je društvo, ki združuje uporabnike prostega in odprto-kodnega operacijskega sistema GNU/Linux. Pod okriljem društva med drugim poteka pomoč uporabnikom operacijskega sistema in prevajanje proste programske opreme. Med projekti sta tudi odprto brezžično omrežje Ljubljane (wlan-lj) in tedenska predavanja Pipini odprti termini (v sodelovanju s Kiberpipo).
[10] Kiberpipa — http://kiberpipa.org je kolektiv zagovornikov odprte kode in digitalnih svoboščin. V središču Ljubljane stvarja digitalno kulturo, osvešča strokovno ter laično javnost s pomočjo predstavitev, predavanj in delavnic.
[11] Ljudmila — http://www.ljudmila.org — Ljubljanski laboratorij za digitalne medije in kulturo (1994) je prvi nepridobitni laboratorij na Slovenskem, ki podpira inovativno in ustvarjalno raziskovanje skozi projektno delo na področjih interneta, digitalnega videa, elektronskih umetnosti, digitalnega radia, komunikacij, razvoja odprtokodne programske računalniške opreme ter interdisciplinarno združevanje vseh naštetih. Omogoča tudi samostojno in v okviru delavnic skupinsko izobraževanje in je ustanoviteljica mreže multimedijskih centrov Slovenije „M3C“

hook out >> now that that's done, finally sipping some milk tea and studying :3

Posts for Sunday, August 1, 2010

Definable Trigger Word on Dictionary KRunner

I announced in a previous post that I’ve created a dictionary runner for KDE SC 4.6. One requested feature in the comments was the ability to define a custom trigger word. I have added it.

Here you see it uses definir instead of define.

It’s configurable through the KCM popup in the krunner settings.

If you set the trigger word to nothing, then it will add dictionary entries for every query, which could be neat:

Hoping to move this out of kdereview soon and into kdebase.

avatar

More do, less talk.

I’ve been a busy little bee these few days – you didn’t think WIPUP’s beta release would slow me down eh? Unfortunately for you folks, I like to strike a balance between doing and talking – sure, more talking and doing doesn’t see any results soon, but more do and less talk is just plain selfish. As such, here’s what’s new in Moult county.

Firstly – the the WIPUP beta aftermath. Could’ve hoped for more users, but I’m happy with how people are picking up on it. So far all feedback has been positive, and we’ve picked up a good few members along the way, some of which have become users. Now that I’ve signed WIPUP up on Google Analytics, we’ve got shorter, sweeter reults:

Because I like looking at the results in percentage increases, I’ll let you make your own conclusions this time.

Meanwhile, a few noticed that this release’s splash was not made by me – rather it was contributed by Nathan from Cetan.ca. This means that if anybody wants to contribute splash artwork, I’d be more than willing to use it – provided that it’s abstract, and that it passes as aesthetically pleasing – and of course credits will be duly given.

The ThoughtScore Project has resumed production – and surprisngly to some – not in any graphical area, but rather in the script. I’ve submitted what I’ve started on it as a WIP available here, and once I implement the “paste revisions” idea for WIPUP suggested here, I’ll allow you to actually write parts of it (well, if you really want to – but no promises on accepting them).

I’ve also been, despite sans internet for 2 days in a wonderful place called Bandung (reaaally beautiful if you go to the right places) I’ve also been busy giving back to the community in KDE. We now have a lovely release counter image (demo’ed below), my submission to their KPresenter template contest, and a little progress on the upcoming release announcement for 4.5. Not to mention I’ve also been in the middle of setting up KDE’s site for development on my localhost to tackle “polish” issues, of which you may see some of my critique here.

KDE Countdown

Of course I’ve still been doing part/fulltime work doing webdevelopment (on my 3rd project now wheyhey), and so if you need any webdevelopering done you know who to poke. Also, being in Indonesia also means I’ve been rockin’ with my relatives.

Come on, a post like this with loads of links definitely means I’ve been busy. Excuse the insightful-informative post tradeoff.

Related posts:

  1. WIPUP 19.03.10a released!
  2. live.WIPUP now available.
  3. Holiday plans.

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