Home » Posts tagged "Linux"

Favorite programming font on Windows: Consolas 10pt bold

For years I’ve used Courier New in my programming editors and terminal (PuTTY). But there’s a much better font available for that kind of stuff. For the last couple of years I’ve been using Consolas, which is shipped with Windows. I’ve configured my editors and PuTTY to use Consolas 10pt bold as I find it by far the best readable font to use for programming. This font is just the right size at 10pt and setting it to bold gives it a very smooth look.

Here’s how Consolas 10pt bold looks in GVim on Windows 8:


Recently I’ve given some other fonts a try as well because in the showed examples it appears they make a nice programming font. Not too long ago the Adobe Source Code Pro font was released and looking at the screenshot at that page it looks really nice. So I decided to download and install it. But trying it in GVim didn’t gave a satisfying result. It doesn’t look too bad, but it isn’t as compact as Consolas is:

source code pro

When using Linux (Ubuntu) I always use Droid Sans Mono. But for some reason it looks really bad on Windows:

droid sans mono

As you can see Droid Sans Mono is even bigger and just doesn’t look right. I wonder why this is though I suspect it has to do with the font rendering on Windows. I’ve found font rendering on Linux a lot better and for what I’ve seen on Mac OSX as well, though I’ve recently heard a Mac user saying he found the font rendering on Linux even better.

And OK, the fonts don’t look that bad but imagine having to look at it all day when programming. All these examples have been set at 10pt bold and the extra space taken by both Adobe Source Code Pro and Droid Sans Mono is just bad in my opinion.

So far I haven’t found anything better than Consolas when it comes to a programming font on Windows. I’m not looking for a replacement of it but I’m always willing to try something new or different. My main disappointment I think comes with how bad Windows renders these fonts, because I know Droid Sans Mono looks good on Linux. If there’s any programming font that renders really well on Windows I’d really like to hear about it.

Deleting files in Linux that are x-days old

Since I’m not running a PHP version provided by my distribution I’m responsible for cleaning up old session files myself. Aside from PHP another Perl webapp I run also doesn’t clean up its own session files. Luckily cleaning up these old files is something that’s very easy to do under Linux.

find /tmp/sess_* -mtime +2 -exec rm {} \;

In this example I’m only taking files that are at least 2 days old. Add this to your crontab and your session directory should stay nice and tidy.

Find and replace in multiple files with sed

Nice usage of find and sed to find and replace text. I used it to update the copyright notices in my projects.

Just change the *.pl part to the file type you want.

find . -name "*.pl" -exec sed -i "s/2012/2013/g" '{}' \;

Source: Wikia

Why more people aren’t using Ubuntu

If you’ve ever wondered why you’re the only Ubuntu user in your office, or in your group of friends, then you’re not alone. The free, powerful operating system, built on the Linux framework, is not only available to everyone for the sum total of zero anything, but is also adaptable, fast, and capable of satisfying even the most demanding user.

However, there are a number of issues which may put people off, or are why they simply don’t even know about Linux, let alone Ubuntu.

1) Market visibility

The problem with open source is that not only are you not Microsoft, and therefore the default operating system for almost every pre-built computer in the world whether the user is a handset engineer for o2 or a novelist, but you’re also not able to put out advertising or push Ubuntu into people’s awareness.

2) Linux’s “complex” reputation

Linux is known for being the least simple and straight-forward operating system out of Windows, Mac OSX and itself. Whether or not this is actually true is highly debatable. However, its reputation isn’t being changed by the legions who use it, and as it is rarely introduced into office environments for use by staff who aren’t working in the IT department, it seems like it could do with a bit of a jumpstart in the “it’s actually quite easy” department, given that it is no more complex than any other OS.

3) Accessibility

PC companies, I’m sure, would love nothing more than to lose money by offering Linux installs instead of Windows. Sarcasm aside, Ubuntu is something you’d search for, but not something you’d be presented with. The tech press needs to do a better job of opening people’s eyes to the potential of open source platforms, and users helping out can never be a bad thing either. After all, it’s free, easier on your hardware, and extremely capable, scaling with your IT skill level. What’s not to like?

Why I decided to stop using Ubuntu desktop

I’ve again returned to Windows 7 after having used Ubuntu for about 3 months on the desktop. For some reason Linux on the desktop always breaks down after about 3 months, give or take. My main reason for trying out Linux again was so I could develop in a *nix environment. I’m comfortable with a terminal and lots of cool and useful libraries compile without any hassle. And most of the programming I do ends up running on a Linux server anyway. On Windows 7 you can get quite far with MinGW and MSYS, but it usually takes quite some effort to get something to compile. MSYS is also very slow on my machine(s). And although with Strawberry Perl it has gotten a lot better, from time to time you run into modules that won’t compile and are almost impossible to fix.

This wasn’t the first time I ran Linux on my desktop PC. About 7 years ago I started out with Gentoo. It actually ran fine on my laptop, aside from WiFi issues. The compile hell that came with it was terrible though. I’ve ran Ubuntu 7.10 on my desktop without much issues, until I upgraded to 8.04, which broke everything. After that I used Windows Vista for a while and eventually Windows 7. Somewhere late December ’11, early January ’12 I decided to try Linux again. At first I wanted to use CrunchBang because it was so lightweight, but couldn’t get my system to boot into it. Then I tried Fedora 16, which featured Gnome 3 out of the box. I really liked how Gnome 3 looked, but Fedora 16 was way too unstable for me. After that I gave Ubuntu 11.10 a chance, installed Gnome 3 on it and simply enjoyed it a lot.

For 3 whole months I was able to run Ubuntu 11.10 without issues. Some software didn’t work out of the box, but I was able to fix that and I don’t consider that Ubuntu’s fault. Before I tossed the towel into the ring my NVIDIA 9800GT got too hot and the system would just freeze. I was using the open-source drivers (nouveau). I found out that this driver always runs the GPU at 100% and it simply wasn’t able to not do this. After replacing these with the official NVIDIA drivers the problem was solved. But shortly after an update for this driver made my system freeze at startup. I rolled back to an older version and again, the problem was solved, though the rollback was pretty hard to execute. The real misery started after I did a normal package update, which sometimes happened daily, and everything I needed malfunctioned. The VPN software I used wasn’t able to setup a tunnel, which I need to connect to the company’s network. I also run a virtual server in VirtualBox for several things, but I no longer could fire it up anymore. It had something to do with VirtualBox drivers that couldn’t load anymore.

When all that happened I had enough of it and waved Ubuntu, or Linux for desktop in general, goodbye forever. I’ve had enough of it and in all these years it hasn’t gotten any better. It’s my expectation that Linux on the desktop will never get big. I’ve still got Xubuntu installed on my netbook, but haven’t booted to it in ages and will probably uninstall it soon as well.

I don’t want to be too negative though. Ubuntu 11.10 did have a number of pros as well (though most are software you can run on other platforms as well):

  • Gnome 3 – after a couple of tweaks I found myself to be very proficient with Gnome Shell. Lots of people hate its guts, but I really liked it
  • Remmina – a great remote desktop client for RDP
  • ShrewSoft VPN (ike) – easy to use VPN client, but you have to compile it yourself since the supplied package doesn’t work.
  • Vim/GVim – yes, it’s multi-platform, but seemed a bit more responsive in Linux
  • Terminal (Bash) – some tasks are faster done on the terminal and Git for example is a lot faster than on Windows
  • Compiler toolchain – you pretty much install build-essential and you’ve got almost all the compilers and other related things you need
  • Nautilus – a much better file manager than Explorer will ever be
  • Skype + Bluetooth headset – I’ve had no issues using my Bluetooth headset under Ubuntu and Bluetooth in general just works. Can’t say that for Windows 7.

Currently I’m back to Windows 7. It works, but could be more responsive (I’m looking at you Explorer). I know that for my terminal needs I could use Cygwin, but I don’t see that as a proper solution and the last time I tried it installation took forever and it just didn’t work. Since my desktop PC is already 4.5 years old I’ll be replacing it sometime this year. I’ve decided to try out a Mac, either an iMac or Mini. All I want is a fast system, with a stable OS that doesn’t require much attention to stay running and a *nix environment. At the moment I think OSX will be able to give me that. The wait is now till Apple renews their models.