Change of address

November 7, 2009

From now on anyone wishing to follow my antics, rants and ramblings should direct their browser to http://barbedwirebytecodebaconburger.com since I will no longer be updating the blog here at WordPress.com.

That’s http://barbedwirebytecodebaconburger.com people! Learn it, live it, love it!

END OF LINE


Calling all European citizens and users of the internet!

September 27, 2009

Go here immediately and sign the petition. The petition has to be presented tomorrow so hurry up!!!


Move along, nothing to read in this entry

August 7, 2009

Just testing an android app.


Migrating an old MS Access database to MySQL [UPDATED]

August 3, 2009

I’m in the process of migrating an old website I made almost 8 years ago from it’s current unbearable platform of Windows, ASP and MS Access to some sort of *nix, PHP and MySQL. Tonight I decided to combat that MS Access database and transform it into a real database. To help me accomplish this I used the excellent tools provided by the mdbtools project.

First I had to export the schema of the database to a format readable by MySQL:

mdb-schema -S mydb.mdb mysql > mydb.sql

This creates an SQL-file containing the schema in plain readable SQL. Very nice.

Next I had to export the actual data from the tables in the MS Access database, like this:

TABLES=`mdb-tables mydb.mdb`
for T in $TABLES; do
mdb-export -I -R';\n' mydb.mdb $T >> mydb.sql
done

The first line stores the names of all the tables in the variable TABLES. Then I simply loop through all of them and execute the mdb-export command on all of them, writing the output to the end of the schema-file.

In case I need to do this again in the future I put it all together in a script like this:

#!/bin/bash
DBFILE=$1
OUTFILE=$2

#Check for correct number of arguments
if [ ! $# -eq 2 ]; then
echo "Usage: access2mysql.sh DBFILE OUTPUTFILE"
echo "Example: access2mysql.sh msaccess.mdb mysql.sql"
exit 1
fi
#Check that DBFILE really exists
if [ ! -f $DBFILE ]; then
echo "$DBFILE does not exist."
exit 1
fi

#All is good, here we go!

#Create schema
mdb-schema -S $DBFILE mysql > $OUTFILE

#Export table data
TABLES=`mdb-tables $DBFILE`
for T in $TABLES; do
mdb-export -I -R';\n' $DBFILE $T >> $OUTFILE
done
#Clean up some Windows-character stuff
dos2unix $OUTFILE
exit 0

Now all I have to do is create a MySQL-database and write my newly created SQL-script into it and I’m good to go!

UPDATE:
Before I could get the SQL-script to work I had to fire off a couple of sed-statements to fix the fact that I had used some illegal words as names for some of the table-columns, “type” and “condition” to be specific. No biggie though. Also, mdb-schema didn’t add “AUTO_INCREMENT” to the fields that were auto incrementing in the MS Access database so I had to do that manually.


The classics meet the modern times

July 19, 2009

I finally started transferring my vinyl collection to FLAC (concentrating mainly on 7″ EPs and Mini-LPs). It’s gonna be a looong time before I’m finished though.

Thus far I’m basically transferring the music into Audacity via USB and then manually chopping the capture into songs. I know there’s probably a better and faster way to do it, but I’ve just started and I’m sure the proper tools will reveal themselves to me soon enough once I start looking for them ;-) Meanwhile, here’s a picture of a classic piece of vinyl in the process of going digital:

The music of 1989 meets the tech of 2009

The music of 1989 meets the tech of 2009


I’m in your internets, sniffing your packets

July 15, 2009
Rocking Wireshark on my EeePC on the train to Stockholm

Rocking Wireshark on my EeePC on the train to Stockholm


It’s not that I hate GUIs, I just like CLIs

July 7, 2009

I’m a big fan of the command line. I find that using it is many times a lot faster and more efficient than going the “clicky-clicky”-route via a GUI. Also I often find graphical user interfaces highly restrictive. A GUI is only as good as the designers ability to predict every possible thing that a user would need to do with it and because of this there is no such thing as a perfect GUI.

This is especially true with GUIs that are in reality just a pretty face on top of a console application, which is many times the case. Take for example a graphical front-end to a webserver-application like the Apache Web Server. To cover all bases this GUI would have to make it possible to do and configure exactly every part and function of this complex piece of software with the same precision as you can when you manually edit the configuration-files in your text-editor of choice. I just don’t see how that would be possible without making the GUI a cluttered and hard to use mess, which totally defeats the purpose of using a GUI to begin with. And what if you stumble upon a situation where the GUI lacks the needed knobs and switches needed to configure the underlying application to behave in a particular way? Well, then you’d have to drop down under the hood and go command line wouldn’t you? Now wouldn’t you have been better off being there the entire time then? You might even have picked up something about the application that you didn’t know before just from mucking about closer to it’s innards, which is always a good thing.

Another thing that I really like about CLI-apps is that you can combine them with each other piping input and output all over the place to create new functionality. This simply isn’t possible with a GUI-app because it lives in it’s own little world inside a window full of buttons, sliders, whistles and bells and almost always impossible to get to play nice with other apps unless it was specifically built for this to begin with. A CLI-app that accepts and supplies communication from stdin and stdout has no such limits and at the command line they all come together with incredible power that can never be mimicked by any GUI on earth, no matter how shiny it is.

There are also computing environments where I believe that GUIs have no place at all. One such environment is on a server machine. Why suck up resources from the server by forcing it to power a graphical environment with windows, button and such? It’s a waste of precious computing power and darn right stupid if you ask me. Naturally, by saying this I am also saying that no incarnation of the Windows OS has any place on a server, which is completely deliberate ;-)

However, don’t get me wrong, GUIs definitely have their place in the world of computers. Not every user is a power user that needs to control every single byte of data and naturally there are apps that would be simply unbearable or at least highly impractical as CLI-apps. Web browsers for example are no fun in a command line environment and playing media like movies or flash animations is simply not possible. For the menial day to day computing tasks such as browsing the intertubes, handling e-mail and thousands of other things a graphical environment is preferred over a command line based one. But sooner or later I always find myself back at the prompt writing commands with twelve arguments and piping here and there, simply because for me it makes sense. I feel in control and not at the mercy of whoever designed some jumble of buttons and windows believing that his vision is what I and every other user wants and needs.

For my love of the command prompt I’ve even been called a GUI-hater (as a joke though) but that’s not true. I don’t hate GUIs, I just really like CLIs.

END OF RANT


Pricing fail at cdbaby.com

June 25, 2009

Look, I’m all for downloading music legally and I’m glad to see more and more purveyors of legal downloads appear on the web, but if there’s only a 1 cent difference in price, what’s the frakkin’ point?

1 cent? Really?

1 cent? Really?


Most f**ked up Wii-game ever?

May 17, 2009

Holy. Friggin’. Shit. I almost died from laughing too hard. The japanese certainly are an odd sort of people. Will we see this game in Europe? Probably not.


The AppStore fiascos of late and the iPhone-conundrum

May 15, 2009

Just like millions of other people I was really excited when Apple announced the AppStore for the iPhone. I immediately thought that this could be the thing that makes the iPhone a great buy despite the hardware failings (pretty cruddy camera, no video recording, no real bluetooth support, etc.). However, it wasn’t long until I no longer felt this way.

First there was the fucking NDA that created an inhospitable environment around iPhone-development and made it impossible to build any kind of community around it. Apple finally made good on that one but it took way too long and that they had that crap in place to start with is inexcusable anyway. What were they thinking?

AppStore - crapstore

AppStore - crapstore

Secondly, and this is a big problem that still remains, there’s the whole fiasco with the approval process to get your apps to the AppStore. Since Apple has the final say-so on what gets published on the AppStore and there is no other way to get apps on a non-hacked iPhone if they deny your application to publish your app on the AppStore you’re shit out of luck.

Now that’s bad enough, but what makes it even worse is that there seems to be no clear guidelines as to what gets approved and what doesn’t. Some apps have been denied while other apps with almost the same functionality have been approved. Is there an official way to appeal a denial? I don’t know for sure, but I don’t think so.

One app in particular stirred up a lot of attention from the blogosphere and the internet in general, the NIN-app, published by the band Nine Inch Nails. The whole debacle has been well publicized elsewhere so I’ll not get into it in detail but basically the app was first approved but then just a short while later the developers released an update which was denied into the AppStore, which in turn, if I’m not mistaken, made the app unavailable on the AppStore. The reason for this was that you could apparently access some son (via streaming I believe) that had “offensive lyrics” or something like that through the app. OMG! There’s swear words on the internet? Meanwhile you can buy a million gangsta-rap songs on iTunes that contain a multitude of fucks, motherfuckers, “kill whitey”, bitch and other “offensive” things as part of their lyrics. But I guess that’s OK since those songs supply Apple with steady revenue.

Anyway, after a couple of days of uproar on the web by thousands of Nine Inch Nails-fans the app was re-evaluated and finally approved. Now what if this app hadn’t been published by a successfull rockgroup with a very solid and borderline rabid fanbase? Apple themselves have bragged about how awesome the AppStore is because it has turned one man software development companies into successfull businessess and enabled developers to live the dream of being their own boss and still make a solid living. What if an app developed by one of those companies was rejected for some obscure and/or stupid reason thus strangulating their cash flow completely? That could mean disaster and bankruptcy in a worst case scenario and how do we know this hasn’t happened already to some poor unfortunate developer?

Now another app has been rejected for the most moronic reason. As reported by Torrentfreak.com a remote control app for the popular cross-platform BitTorrent-client Transmission has been rejected because according to Apple “this category of applications is often used for the purpose of infringing third party rights”. That is such total and utter bullshit! You’d think that a company that actually makes software would know better than to damnify an entire class of technology because it “could be used to do wrong”. Hey, let’s ban Safari then because using any web browser you can easily find illegal stuff on the internet and download it and you could also use it to access the web-GUI for Transmission! Let’s ban cars because they can be used as getaway-vehicles in bank robberies. BitTorrent in itself is just a protocol and it’s used for lots of legitimate things. Banning applications based on them using a specific kind of technology is stupid beyond belief.

Just a couple of weeks ago, days before the whole Nine Inch Nails-thing got started, I was seriously contemplating getting an iPhone since the prices have now dropped to a reasonable level and the amount of good apps appeared to make it a good choice for a new cellphone, which I am very much in need of. I was also looking at the Android-phone, the G1, and thinking it may also be a good alternative. I do however own an iPod touch which I love. It really is an awesome device which I use everyday. But if I could have that plus a great cellphone in the same device that would be very nice. For this reason I may never completely be able to write off the iPhone as a candidate for a future cellphone.

However, with all of the crap that’s been going on around the AppStore lately I’m really not considering an iPhone anymore. So now I’m basically holding out for the next generation of Android-phones. The Android-software is just as good as the iPhone-software, maybe not as sexy and Apple-ish but I can live with that, and most of all it is based on open source and a platform not encumbered by the problems discussed in this post. So you could say that you lost me again Apple, and for such stupid reasons.

What Apple should do is let people install whatever the hell they want on their phones. If I bought the phone and paid for it I should be allowed to do whatever I want with it. If I want to install an application that floods my screen with random swear words who are they to decide that isn’t appropriate? If I want to use an iPhone to monitor my torrent-downloads that’s none of their business. If I’m doing something illegal that’s what we have law enforcement for. Basically, butt out of your customers’ business Cupertinoites.

Naturally, they should keep the AppStore because it is great to have a source for apps that Apple vouches for so to speak. But if I wanna take a risk and install something that Apple doesn’t deem worthy of publishing in the AppStore I should still be able to do that. This would benefit everybody involved, developers, iPhone-owners and Apple themselves, since it would make the iPhone an even more appealing platform.

But until radical changes are made I’m most likely to go Android for my next cellphone. The future will tell.