A better and prettier mysql/mariadb CLI client May 22, 2016


The default, unconfigured CLI client you use with MySQl or MariaDB is kind of awful, no colors, pretty bad query editing capabilities, and the output is not paginated. Let’s improve the experience.

Client

Start by creating a configuration file ~/.my.cnf with the following content:

Automatically prompt a password for your user, avoid giving --user option each time



Vim Kōans [Español] May 4, 2016


Esta es la traducción al español de los vim kōans por Tom Ryder.

¿Qué es un Kōan?

El maestro Wq y el desarrollador de Windows

El maestro Wq se encontraba ayudado a algunos novatos de Vim. Luego de sus enseñanzas sobre las virtudes de Vim, pregunto si habían preguntas. Un hombre joven levantó la mano.



The Python Paradox is backwards April 20, 2016


Paul Graham wrote a great short article back in 2004 called The Python Paradox where he states that if you look for python programmers you will end up with the best ones. The logic behind this is as follows:

Python is an esoteric language that universities and schools don’t teach, so people that knows python are self thought, they know that their python skills wouldn’t get them a better job so they do it for fun only; Considering that learning a new programming language isn’t a trivial task, and that python knowledge wouldn’t rank you higher for hiring, we can infer that it takes a really passionate person, a hacker, to learn and use python.



Why I hate Java March 28, 2016


Everything is an object…

… No, it’s not!

Not everything is a object. Have you ever carefully read Java code? It’s full of actions disguised like objects: Mutator, Traverser, Factory, Maker, Creator, Generator, Mediator. So you don’t mutate, traverse, make, create or generate anything, instead you force an object that can do that.

Ok some of that stuff can be useful for well used design patterns and a good design, but most of the time is not!



Why I hate IDEs March 16, 2016


Lets start by taking off of the discussion some important things:

  • Using an IDE and taking advantage of what it has to offer doesn’t mean you’re a bad programmer, and using a good text editor doesn’t mean you’re a good one.

  • Using an IDE has the potential to turn you into a bad programmer.

  • Relaying on an IDE can make you a bad programmer.

  • Depending on an IDE means your a bad programmer.

I think a lot of people will agree with this, so lets move on.

I’ll keep updating this list in the future, if you have something you’d like to be added please let me know.



Beautify your code with Astyle and Vim February 26, 2016


Programmers love good code: good expressivity, good organization, ease of extensibility, maintainability, and so on. But we also like the code to be pretty, it makes the work more pleasant and enjoyable, but all this is probably not just for visually appealing reasons.

Is always nice to work with a style consistent code, it even makes it easier to navigate and read, our brains can dissect it more easily and our eyes can quickly jump to the right place. A pretty code transmits the idea that the people who wrote it do actually care about the program.

But there are some mundane reasons too… For lots of us an annoying voice in our heads is constantly telling us “you’re wasting storage space, you’re and idiot!” because some trailing white space or unnecessary blank lines are laying around in the code. Sure, those few extra bytes won’t hurt your 1+TB hard drive!, but for some of us it just feels wrong.



Como escribir un emulador de computadora February 15, 2016


Traducción al español de “Como escribir un emulador de computadora” por Marat Fayzullin

Escribí este documento luego de recibir varios correos electrónicos de personas a las que les gustaría escribir un emulador de una u otra computadora, pero que no saben por donde empezar. Las opiniones y consejos contenidos en este articulo son únicamente mios y no deberían ser tomados como verdad absoluta. El documento trata principalmente sobre los llamados emuladores “interpretes”, contrario a los “compiladores”, pues no tengo mucha experiencia con técnicas de recompilación. Se proporcionan un par de enlences donde se puede encontrar información sobre estas técnicas.

Si considera que hace falta algo en este documento, o desea hacer una corrección, siéntase libre de enviarme un email con sus comentarios. NO respondo sin embargo a idioteces o solicitudes de imágenes ROM. Si conoce enlaces que pudiesen ser útiles aquí avíseme, lo mismo aplica para preguntas frecuentes que no se encuentran en el documento.



Migrating GNU/Linux installation to a SSD December 17, 2015


I recently bought a 120GB SSD (yes, a small one) to replace the 500GB HDD in my laptop so I can benefit from the extra speed and just keep my bulk data in the old HDD.

Once your new SSD arrives you are probably very exited, you want that boost up for your system. BUT! You don’t want to reinstall your whole system on it, you want to preserve it right?. Ok let’s do so.



Fight Flash Fraud (F3), Auto reset hardware November 11, 2015


F3 is an amazing alternative to h2testw, that allows you to test a USB flash drive to find out if it has less capacity than it claims.

There is a LOT of fake USB flash drives on Ebay and other stores; When you use them, they appear to be storing all your data, but when you try to retrieve it, much of it is just lost.

f3probe is part of F3, it will test the USB flash drive for you and tell you if it is a fake and how much real memory does it have, but there is a catch: it requires you to physically disconnect and reconnect the drive manually, which slows down the whole process and becomes tedious if you need to probe more than one drive. Here is the solution: a piece of hardware that f3probe will use to automatically connect and reconnect you USB drive without your intervention.



Ratpoison, Miscellaneous November 7, 2015


This is the fifth post about the Ratpoison window manager.

These are a few extra things I use in Ratpoison to make my life more comfortable that can fit in a single post, so here you go.





Ratpoison, Task Warrior Control November 6, 2015


This is the fourth post about the Ratpoison window manager.

When managing tasks there is no better interface than task warrior CLI, that’s for sure, but sometimes having a few-strokes-interface for listing the current tasks or adding a new simple one comes in handy.

Lets use Ratpoison goodies for this.



Ratpoison, E.T. Phone home November 4, 2015


This is the third post about the Ratpoison window manager.

This one is not a productivity improvement, nor a do-more-with-less feature, but a playful way to achieve a pretty common task: SSH to my home lab.

Remember that scene in E.T. In which he says: “ET phone home” and points with his finger to the sky? Well…

When I hit C-t E this pops up in my screen:



Ratpoison, Clipboard Stack November 2, 2015


This is the second post about the Ratpoison window manager.

How many times did you found your self keeping snippets of text in a text editor just so you can use them later because your clipboard will be overwritten with the new selection?

Here is a very neat solution using Ratpoison: a clipboard stack.

Using xclip, a simple shell script and the appropriate Ratpoison key bindings we could accomplish the following:



Ratpoison, Music Control October 23, 2015


This is the first of a series of posts about the Ratpoison window manager.

Ratpoison brings great flexibility and allows us to do pretty amazing things binding custom keys and running external programs and scripts; I’m going to talk about some of the ones i use in the next posts. For the first one, lets talk about music.

Some people use a graphical music player like Amarok or just play some Youtube videos, others prefer text players like MOC or CMUS, but we can reach the top of flexibility using a music daemon like MPD and use our preferred client (MPC, Ncmpcpp, Vimpc). All this options have something in common: you usually interact with an interface you have to switch to, interrupting your work flow in order to control your music, but we can do better.



Vim vs AWK March 6, 2015

What!? Vim is a text editor and Awk a text processing scripting language, how do you even compare them!? Yes, I’m aware of it, but trust me, I have something to compare here, so take a breath and continue reading…

What I’m actually trying to compare here is vim scripting vs awk, still don’t make sense? Well lets take a look of this.

Study case: Vinfo

Vinfo is a Vim plugin that allows you to read Info documentation files right in a vim session by converting the Info plain text files into Vim help-files so you get a nice syntax highlighting and very convenient tags for jumping between the file contents. Lets examine how it does its job.