2012w27

July 8th, 2012

Slow week, but I guess that is the way it’s supposed to be when on vacation :)

I guess I won’t EVER be buying a product from Cisco or Linksys again, as they obviously cannot be trusted (yes I know they backtracked on that, but the fact that they thought it was a good idea to begin with says all I need to know…)
And I should really take this as a sign that it is high time to flash my old trusty WRT-54GL to something freedom-respecting…

So, uh, you might want to fix this gaping security hole before you start flying drones hijacked kamikaze-devices over your own people. Just a thought…

Cryptowars… again? Really?

Thunderbird ISN’T dead, but that doesn’t mean I shouldn’t try to get my thumb out of my ass and learn to use mutt anyway.

UK seems to be getting more spy laws but with the right mix of software you can ward off most assaults on your privacy.

And while on the subject of privacy: This post makes a rather good case for privacy.

2012w26

July 3rd, 2012

Last week (yeah I know, this post is a little late) was pretty stressed out with a looming deadline but not-at-all-that-late on Friday afternoon, everything came together and all my assigned test cases had been executed, yay! :D

The depressing stuff (a.k.a “:(“)

A study has concluded that the “Non-Practicing Entities” formerly known as patent trolls costs money, a whole lot of money… who’d have guessed? …

 

And facebook did yet again what any popular service for which the “users” doesn’t pay a dime; changed their service without any warning, bu giving every “user” a facebook.com email address and making it the default contact email.

It sure smells a lot like the “Man-in-the-Middle” attack the previously linked to, outraged, post makes it out to be.

Then again, I can’t really understand how people can still get outraged by any of the shit facebook does. And its not like there aren’t other reasons for wanting out. Coincidentally, masses of people abandoning fb might be the only way to get them to stop frakking around with the “users” so much.

(And yes, I have consistently marked users up using quotes, because as Andrew Lewis so eloquently put it: If you’re not paying for something, you’re not the customer, you’re the product being sold.)

 

Former United States President Jimmy Carter thinks that the US is “abandoning its role as the global champion of human rights”. Not sure if that is really news to anyone, but I guess it gets a little more weight when it comes from a former President who also so happens to have won the Nobel Peace Price (then again, so did Obama, for “not being Bush” so maybe that isn’t all that impressive…)

 

And more corruption and subverting of the public good going on while the USTR and MPAA plans what I suppose to become the next ACTA (i.e. developed in secret without any chance for criticism), the TPP.

And while on the subject of ACTA, the EU commissioner wants the European Parliament to fall in line (I guess it is bad PR to always have the EU look divided… too frakking bad…)

 

If you are an Apple user, and you are using Orbitz to book hotels, please be aware that if you just boot into Windows for a quickie to do the bookings, you may save a buck or two

 

The more I think about it, the more I feel that no matter what the IETF decides, web servers (coughApache*cough*nginx*cough*LightHTTPd*cough*) should just go right ahead and implement HTTP Error Code 451 anyway. Pretty sure I will make a point to be able to serve such a response if I ever dabble with web-apps again anyhow. Because people getting angry with ISPs, which are just following the law, is fruitless. If people instead direct their anger towards the people guilty of the poor laws (i.e. politicians deep in the pockets of certain four-letter-acronym organizations, most of which having headquarters in the US) I imagine things could begin to change.

(Yes, that would mean having to vote for someone else and potentially get screwed over (depending on your political views and what you believe to be the “right” way to conduct a society) in other pieces of policy)

 

I get her point. Seems kindof hopeless, damned if you do, damned if you don’t :(

The funnier stuff (a.k.a “:D”)

Pontus showed me a cool SSH shell called ZSSH with built-in capability to transfer files, within the shell. Yes, I know of scp, but I also know what a pain in the ass it is with one-time-logins.

 

A cool (perhaps not very useful, but very visually pleasing) tool is gource. It parses version control commits, and presents them visually (see PHP, Python, OpenOffice.org, or why not MySQL for visuals)

 

Want to make Python and Erlang talk to eachother, try Erlport.

 

Finally, while I was working at Gnutiken, I had the good fortune of sitting next to Andreas Nilsson, and I know I say this about a lot of my friends, but he’s one of the nicest guy I know (I guess I have truly lucked out with my friends), but there’s one thing where he and I don’t see eye to eye.

As a designer, user interface/experience wizard etc. his stance is that the concept of files in a computer must be eradicated from the user experience.

I disagree, and this post goes a way better job at explaining my thoughts than I would ever had been able to.

:wq

2012w25

June 24th, 2012

Quite a while since I wrote a post now, I’ve not been sick or anything, but there has been a lot of work abound, and outside work I prioritized sleeping over writing. But now I’m back for the moment, so let’s get down to business :)

Since last time I’ve come up with new ways of abusing awk, such as having it find the highest value from a command outputting in the following syntax:

\t<characters, integers, fullstop>: <integer>\n

To make it a little more different, the command also spits out a header, as well as an additional newline after the end of output.

I just now, while writing this, came up with a different solution, which doesn’t use awk:

theCommand | grep -v '^[^ \t]\+' | tr -d ' ' | cut -d':' -f2 | sort -r | head -n 1

but what I ended up using was:

theCommand | awk 'BEGIN { highest = 0 } $0 ~ /^[ \t]/ { if ( $2 > highest ) { highest = $2 } } END { print highest }'

In this case, from what I can gather, awk is the more efficient solution. One process versus five.

Update: As Werner points out, the if statement isn’t really necessary (which also makes it possible to cut out the BEGIN statement as well):

theCommand | awk '/^[^ \t]/ && $2 > highest { highest = $2 } END { printf "%d\n", highest }'

Utilities

  • ditaa (a.k.a DIagrams Through Ascii Art) makes it easy to generate nice-looking diagram images from… rather nice-looking ASCII diagrams
  • docopt, a command-line interface description language, which also seems to support generating the parser for the CLI being described
  • Peity for generating different types of charts using jQuery and <canvas>
  • Ghost.py interacting with web pages, programmatically

As of late I have been thinking a great deal about backups and the project which seems the most interesting to me is Duplicity.

Random tech stuff

Other random not-so-techy stuff

What I pass for humour

:wq

2012w21

May 27th, 2012

Since I always try to end things on a positive note, let’s start with the… hrmmm, “less positive” things first:

Before reading this thread please note that patents on trajectories probably DIDN’T kill this satellite, but come on… patentable trajectories?

UK police will start, or already has started, copying the contents of detained suspects’ cellphones, and will be keeping those contents regardless of if any charges are ever pressed…

With that out of the way, let’s check out these really cool things I found:

Eldy seems to be a nice project aimed at making computers more suitable for elderly. And it even has a tarball for installation on GNU/Linux :)

sipml5: The world’s first HTML5 SIP client.

If you have a dataset with subjective ratings, and some known preferences, could you use that to discover other brands of scotch you might enjoy?

Start sending dates the correct way, i.e. ISO8601.

MomentJS seems to be the JS library to handle all your datetime needs.

This was a pretty cool idea: 3D QR codes only accessible at certain times of day

Perhaps this should be spread around more to decrease the risk of misunderstandings?

And finally some programming-“related” things:

Programmers are optimists: This can be read as a quip about the deficiency in programmers with always overestimating their abilities and underestimating the problem, but the last lines paint the post in a somewhat different light ;)

Funny quotes about programming languages :D

:wq

2012w20

May 20th, 2012

There was no summary post last week, because I was in the middle of being sick as frak. I’m better now :)

During these last two weeks I’ve had a couple of eye-openers thanks mostly to other peoples blog posts:

Although a rant it does give food for thought. Why should the database be in the centre of the system anyway?

I give the orders around here, oh wow have I gotten OOP wrong all these years… :(

I never understood how useful bash someFileContainingCommands could be until week when I had to rename a couple of files in a couple of directories and didn’t have my usual set of tools (qmv would have made this so easy), so what I ended up doing was:

ls -1 > rename.sh
vim rename.sh 
# work your :%s/// magic 
bash rename.sh 
rm rename.sh

for each of the directories. No extra step of adding a shebang, no modifying the executable bit. Just enter vim, do some regular expression search replace and execute.

SRP as applied to CSS.

There has also been a great many things written about programmers, specifically who should or shouldn’t become one:

Jeff Atwood wrote a really nice post, and while I don’t agree with everything he says he is making some good points. I do however firmly believe that there are a great many mundane tasks today, being performed manually, needlessly I might add, since with the right thinking and just a little knowledge, the tasks could be automated. Case in Point.

Anyway, Jeff’s post spawned a great many thoughtful reactions. All in all I think it was a good thing to publish that post. Lots and lots of great replies and comments.

I do personally believe that more and more of our world is being governed by digital technology, and a better everyday understanding of how programs are constructed and what the basic concepts are, could never hurt. Hell it might even make it easier to formulate in better words what is going wrong when you call tech support. (“It crashed” vs “It crashed after I instructed it to iterate over these filenames”)

If you do end up wanting to give it a shot, how should you go about it? Adjust your expectations and prepare for inevitability :)

And in any case, whatever your profession ends up being, and although I only agree with #1 and #2, you really should build something. Doing it first doesn’t matter if you do it better.

I’ll end this topic with a single word: SHUN!

I also found some cool/interesting/potentially useful stuff:

Pykka seems rather interesting, I’ve often wanted something like Erlang, but with just a tiny bit easier way to launch it and interoperate with the system. I guess now I can :D

git-playback for when you wish to visualize the changes in files over time.

Focus.py the productivity guarding firewall ;)

Compleat: Bash completion for human beings.

Last but not least, the miscellaneous category:

The Dictator’s practical internet guide to power retention.

Plenty of rather interesting ideas about gamification to increase user contribution in this thread.

I don’t know how I feel about OSHackers.org. And what’s worse is I can’t put my finger on why I don’t know what I feel about it.

Timeline of the far future, this sounds like something I’ve read on xkcd.

2012w18

May 6th, 2012

The scripty stuff

This week I finally managed to crack a problem I’d been trying to solve for a couple of weeks, namely how to only print the foobar errors, and the ensuing stack trace of these errors from a logfile:

awk 'BEGIN { section = 0 } /foobar/ { section = 1; print; next } /^[A-Z]/ && section == 1 { section = 0; next } section == 1 { print; next }' logfile 

Looking at the solution, I am kindof ashamed that it took me that long to get a workable solution…

I also found this neat little oneliner in a comment on reddit: echo "something long and space separated of which you want the last word" | rev | cut -d ' ' -f 1 | rev. Then again, I’m sure that awk could have done this with a little $(NF-1) magic or something like that.

The headache-inducing stuff

All since my netbook broke down, I’ve thought about two things: restoring the netbook/replacing it, and how to create some form of backup infrastructure which should be better than what I have in place today.

As for the backups, the “system” I have today is couple of USB-disks which I at times plug in and sync files to. That and most of my projects and config-files are in various git repositories all synced to the laptop/server-in-the-wardrobe which I made sure to backup after the netbook died, especially since the laptop/server disk is much older than the netbook disk was.

Another thing which bothers me with the current solution is that I have no off-site storage. And that would be nice to have. Belt AND suspenders of course, and off-site storage comes with its own set of problems such as trust in the offsite storage maintainer.

I think the solution will take the shape of a GNU+Linux box and Unison and possibly aided by incron. Not sure yet, will have to think more about it.

There are some other requirements which I have just barely scratched the surface of or not even begun thinking about yet, for instance it would be nice to be able to backup my parents stuff as well on a regular basis as to keep their stuff safer as well.

And as for the netbook, although it was a nice little machine, the keyboard was getting a bit worn out, and at times it was rather underpowered with its single core 1.6GHz atom processor, so the direction I am looking in now is towards something like this.

The stuff screwing over society

Now there’s truly no way in hell I’ll ever use Skype again.

Nothing new under the sun I guess, but it lends credibility to the Skype quip above.

This sure is some level-A grade retarded society we are constructing for ourselves…

Samsung Galaxy S3: The first smartphone designed entirely by lawyers, a great read about a truly depressing matter which probably is closer to the truth than we imagine. On the other hand, my personal opinion is that the midnight blue version looks pretty damn sweet.

SaaS and other crap where someone else is in control sure is a honking good idea, isn’t? Well, I guess it is if you’re the one in control, but I guess you won’t ever get my business…

The cool stuff

And I also managed to find some posts which touched the hacker in me, such as this post about how one could go about generating pseudo-random numbers (don’t use the algorithms, just be inspired by them) or how this guy started shaving bytes off of his “hello, world!” binary.

I immediately thought about FSCONS when I read this, and I didn’t feel at all worried about people thinking the same about our conf :)

Until the other day, when I read about its inclusion into git, I’d never even heard about git subtree, but this post makes a compelling case for looking into it.

I also came across a, to me, new data structure: the XOR linked list. Now, it has a couple of drawbacks, and I don’t think I’ll find much use for it, ever, but as a concept it is a very interesting idea, and just goes to show that XOR is frakking awesome.

I thought this was a pretty cool thing.

While I don’t have any problems with my ISP hijacking DNS requests right now, it is nice to know for posterity that there are ways around it ;)

If you are going to use JSON, and need comments, this seems like a reasonable way to go about it.

While I haven’t decided what I think about Go I really liked this blog post on how to create a grass mowing agent which derives the most optimal way to cut the digital grass in a simulated world.

Hopefully I ain’t the only one who finds this hilarious ;)

This is actually quite neat: Instead of adding “lorem ipsum” paragraphs all over your design, tweak the word list in the script, include it in the mockup, and markup all places which need filler content. Done.

In the latest issue of DatorMagaZin there was an article about FUSE which caught my eye, and having read the article my interest was piqued, so I just had to go look at the list myself, and truly, have you seen all the cool filesystems people have come up with? Frakkin’ awesome!

The food for thought stuff

Oh yeah, finally remember to treat everyone the way you’d like people to treat your own mother

:wq

Pacman and cleaning out old packages

May 1st, 2012

Just found this out, and thought it may benefit someone else, so here you go :)

In my netbook install of Archlinux I was running out of disk space on / because the package cache (/var/cache/pacman/pkg/) was always filling up with old versions of packages. The reason for this obviously being that whenever I would upgrade a package, it wouldn’t be until next reboot I’d know if something was amiss or not, so pacman -Sc wasn’t really an option. And at next reboot, did I remember to run pacman -Sc? Of course not.

But, as it has been said before, and will be said again countless times: the arch wiki is fantastic!

Take for instance the pacman page, where it gives a hint that if you don’t really like pacman -Sc, you could try cacheclean (found in the AUR).

It takes at least one parameter, or, I guess, two at the most. The required one is a number, indicating how many previous versions you wish to keep. And on top of that you could add -p for preview, in which case it will only simulate removing the packages, and instead printing their names, so you have a chance to spot any mistake you might have made. With -v, cacheclean will perform the task, and tell you what it has done.

Since it will operate on /var/ you’ll need to execute it as root.

Simple as that. The only gotcha is that it is a python3 script, but since that is the standard in arch these days anyway, it shouldn’t make much of a difference anyhow.

:wq

2012w17

April 29th, 2012

Now this was an uplifting read.

And I know that it is the popular thing to do, to hate on Ruby and Rails and that entire community, but seriously, what self-respecting person would want to identify themselves as a brogrammer? But, if I don’t consider myself a rock-star programmer, what then do I consider myself to be?

My first thoughts reading this post revolved around oh no, not another hare-brained “improvement” to something which doesn’t need changing. Then I thought some more, and saw how this could be useful. But then I had another thought.

Ordinary letters, you know, the pen and paper kind, has worked pretty well without being programmable, and I suppose that is because you probably tend to formulate these letters in a different way, thus circumventing the need to programmability. Just a thought…

The world needs more people like this.

The world needs less of this type of operations.

:wq

2012w16

April 22nd, 2012

I ought to dedicate this blog post to git and rsync: The hard drive on my netbook died this week. I haven’t attempted to recover anything from the disk yet, but of that which is most important I figure I haven’t lost anything at all. And that’s due in no small part to git and rsync.

All of my configuration files, at least those I care about, had been added to a git repository. And most of the binaries I wanted to preserve had been rsynced to my server.
Not all of it though, which is a shame, but it shouldn’t be hard to replace what I’ve lost. Especially if I can get the old hard drive to function just one more time, just long enough to at least make a list of what it is I’m missing. The rest of the disk, well, it’s spring, perhaps a spring cleaning was in order.

So all is not lost, and looking beyond this setback, I did learn some other things this week (except for the fact that I need to become better at performing backups) such as:

Also, quite some time ago, I went around thinking about how to automatically track my working time, and while this isn’t exactly like what I had in mind (I would probably just have created a daemon which somehow fetched the window title of the currently active window from X, and did so randomly 6 times per hour (not deterministically enough to be able to cheat the system).

And some assorted links which may or may not be of any particular use for anyone:

:wq

netbook harddrive…

April 17th, 2012

… went to bit heaven tonight, expect disturbances in posting schedule :(

:wq