Friday, February 24, 2012

VIM Quicky: set tabs and spaces behaviour for different files

Never really bothered me before, because I only used Python and C, so I always replaces tabs with spaces.
However, with more C programming lately, I needed to start working with Makefiles. These require tabs instead of spaces.
So here is how to. In the end of my .vimrc file I put:

" python python pyhton
" convert tabs to spaces before writing python files or C files
autocmd! bufwritepre *.py,*.c,*.h set expandtab | retab! 4

" convert spaces to tabs when reading python file or C files
autocmd! bufreadpost *.py,*.c,*.h set noexpandtab | retab! 4

Et viola, not so complicated!

Wednesday, February 22, 2012

Open Hardware - a short list of alternatives

I have been waiting quite a while to write this post. I think it's about time that people who want to write FOSS and support FOSS will also buy hardware from manufacturers that support it. One good way is to buy directly hardware which is designed like that.

So here is a list of stuff I can really recommend or I'd like to buy:

1. Portable Music Player with rockbox:

Sansa Clip+, by itself this little player is not open source or open hardware. However, it is cheap and reliable and runs rockbox. And that is really the best thing about this player. The original firmware comes with pretty limited and dumb interface, it does not support playing OGG or FLAC files, for example. Installing rockbox on this player enables that, further more, rockbox has many cool plugins. A favorite of mine is the simple Stopwatch which allows me to measure times when I jog.
I wish someone in Sandisk would realize how redundant it is to make their own firmware, and they would just adopt rockbox officially. After all, another cool thing about this player is its expansion slot for reading Mini-SD cards.
Rockbox has made me more satisfied with this player, and left me astonished when I saw the user manual, it is maybe the user manual I've seen for an open source project (except maybe the FreeBSD handbook).

2. Router+File Server

I think I am not very wrong, if I say that most people I know has a home wireless network. Good chances that this W-LAN router is running some kind of Linux based OS with a web interface. The advanced users can try and replace this OS with a user friendlier and more capable OS like OpenWRT or DD-WRT.
But what is better than buying a device which is already pre-installed with one? Here is a Linux Friendly router, the Buffalo WZR-HP-G300NH, this is the Wiki page dedicated to this little router, and there is a very good blog documenting that router what you can do with it.
Right now, my Buffalo is running a File server, and of course the W-Lan and I am very happy with this  40 USD embedded computer. I'm so happy with it, that I might get another one, and install full blown Debian on it.

3. Tablets

It's been a while that I am thinking of buying my own tablet or an e-book reader. However, I'm late to join the crowds and I don't want to pay money for computer that I need to break into to get a root password. There for this rules out 99% of the Android tablets and others.
I just ordered 2 spark devices. These little machines are pure Linux (not Linux with Handcuffs.)
But there are other devices which have Linux on them, such the Smartbook or WeTab.

4. Laptops

Well, there are  many by now. And it's good, I've compiled a small list of laptops sold with Linux.

If you have suggestions to this list please let me know!