J. Straten

To content | To menu | To search

Let's try: Linux Mint

General

Okay, so I've been using Windows for as long as I can remember, and grew kind of fond of its interface. Of course, I've had my share of difficulties using the program manager, the weird way it handles certain security problems (do I really need to turn off a security option in Windows 8 to install IDLE?) but we've become good friends ever since 3.11. Over the years I have twice been tempted to try Linux. The first time was 5 years ago, when I was fed up with Windows during the final stage of my thesis. As I had my thesis on both my desktop and my laptop (XP and Vista) both crashed in one week, leaving me with no working pc's (thank god for safeboot which let me recover my files). Sadl, my encounter with Ubuntu did not let me connect to my network, and it seemed I had to learn BASH before I could get it in a working state, for which, due to my thesis, I did not have any time.

But now the feeling that there must be something better then Windows started again, I still have my old trusty laptop (an Acer Aspire 5520), but Windows seems to suck the life right out of it. Next to the performance issues I do not really feel like paying $ 60 for an upgrade anyway. So after having run Ubuntu for a few weeks (which worked perfectly) I decided I wanted to try Linux Mint (16). In this entry I will take you through my experience with Mint.

Download

The place to download Mint is, of course, the Linux Mint website. And already we are posed with a problem: there are different versions to choose from!

I've been reading up on Mint before attempting this install, however, I was not aware I had to choose an interface in advance. I do know that MATE is the more traditional interface, and Cinnamon is the more modern view of how the developers imagine Mint. The other 2 downloads KDE and Xfce, which I regard as less interesting to new users such as myself.

After viewing the screenshots and websites, I was happy to choose Cinnamon, which downloaded in a few minutes from the mirror in the Netherlands. So now I've got an ISO, which I should write to a DVD... some sort of obsolete medium mainly used for movies and games as I recall.

Installation

Yeah, so I could go on a 'treasure' hunt for empty DVD, which is bound to lay somewhere in the back of a closet, or use the excellent Linux Universal USB installer at Pendrivelinux.

Screenshot_2014-04-21_14.10.03.png

Using the USB device I've just created I was able to install Mint. At first though, the laptop seemed to jam, but after a restart and starting Mint in compatibility mode (hit any key during the Automatic boot in # - countdown and select compatibility mode) I was able to boot into Mint and go through the installation wizzard.

Tecmint can show you the installation screens of Mint 15 (Olivia), which are similar to Mint 16 (Petra) that I'm installing.

An interesting option is the full-disk encryption Mint offers, I decided to turn it on, as my laptop probably will travel throughout Europe and hopefully Asia in the coming years, so it's comforting to know that if (or should I say when) it gets stolen my data will be safe. I have no idea how this will affect performance though. But the installation went very rapid completing in about 15 minutes. After which I naturally forgot to eject the USB drive, so I restarted again.

First boot

Okay, so directly after the memory test I'm prompted for my encryption key. Well, prompted is kind of an overstatement as it showed just a padlock with an empty input field. After this, Mint booted just as expected. Mint even remembered my wifi password, and everything looked fresh but somewhat familiar.

The look

The fresh look Mint provides is clearly based on the pre-Windows 8 look and feel... on steroids. Everything is so polished, and the start menu works just great. Naturally, you might want to change the wallpaper to your dog, or maybe pick something a little more stylish at LinuxMint Art. Everything feels intuitive, and the update manager will assist you in updating the distribution and all its contents including both python 2.7 and 3.3. During updates you can click on details to see everything that's going on in the shell, which is a neat feature

How to easily avoid SQL injections

About a decade and a half ago I picked up PHP. After having made a few less than decent websites in HTML I wanted a little more so I started constructing a basic blog applications. Hundreds, or rather thousands, of uninformative error messages later, I had my blog system running. Of course, as a under-aged boy living in the nineties, a free web-host with a busload of ads was my weapon of choice. Due to the inherent limitations of those free hosts I had to be creative and set up my blog using a flat file system. Amazingly this worked, but it became clear (after I had transformed the blog to a more advanced forum, creating blank text files for every new thread) that there might be a better, easier and most of all safer way to do this.

And so there was, I found a great web-host that gave me all I wanted and let me install anything I'd like; apache on my home pc! And with apache came MySQL, an awesome database with one of the best visual editors I've come across so far (phpMyAdmin). Like many enthusiasts out there I started making PHP scripts that communicated back and forth with a giant database, showed users what they requested and showed me which links had been most popular. There was one thing though...

SQL injections became a major problem for a large amount of websites. PHP, at least at first, did not challenge users to bother about sql injections, especially with the incomprehensible magic_quotes option we were 'given'. Luckily nowadays PHP has deprecated this ridiculous, or rather dangerous, functionality. However, a lot of scripts still incorporate the old, no need to worry attitude, which is a heritage from the ancestors of PHP5. The wikipedia entry of sql injections (yeah, I know) shows an extensive listing of major security breaches resulting from sql injections. After having spent some time on different websites searching for a solution I found that it is not at all as easy to find the pretty simple, and straightforward, answer to this problem.

Then, however, I stumbled upon the w3schools excellent SQL tutorials, which include a perfectly readable entry on SQL injections. And, as it turns out, avoiding them is ridiculously easy. All programmers have to do is avoid preparing a string including user input and feed it to SQL, but rather feed the string, with variables to SQL, and then provide the engine with the variables:

$dbConnection =new PDO('mysql:dbname=dbtest;host=127.0.0.1;charset=utf8','user','pass');
$dbConnection->setAttribute(PDO::ATTR_EMULATE_PREPARES,false);
$dbConnection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $dbConnection->prepare("INSERT INTO Customers (CustomerName,Address,City) VALUES (:nam, :add, :cit)");
$stmt->bindParam(':nam', $txtNam);
$stmt->bindParam(':val', $txtAdd);
$stmt->bindParam(':cit', $txtCit);
$stmt->execute();

This approach uses the PDO bindParam statement from the PDO class, and seems to be working great. Another effective option might be the mysqli class, though I have not tested it yet.

Welcome to my personal site

As for now, there is not much to discover here, be sure to check back in a couple of days as I will keep busy updating this website with useful stuff such as PHP, Python, SQL, and also more trivial stuff.