Tutorials


Searching and replacing text on long files with Vim

Searching and replacing text on long files with Vim

You may wonder how I came up with this topic. I usually code in a graphical IDE like PyCharm or Visual Studio, or even a text editor like VS Code or BBEdit. But sometimes you need some lightweight application that is capable of opening and efficiently edit a file. I often return to VIM for quick edits in small files. Sometimes, just for the convenience of not leaving the shell. Other times, because it’s a powerful editor that runs perfectly under a SSH connection. And a few days ago, it was the only application I had installed on Windows which would let me open, navigate and read a several GB heavy text file without complaining.
Reading time: 6 minutes
Quick tip – How to quickly read just the last lines of a huge text file

Quick tip – How to quickly read just the last lines of a huge text file

If you’re a developer or a systems administrator, sooner or later you will meet that HUUUGE, GIANT, ENORMOUS file. A file that weights several gigabytes of more or less cryptic system or application logging messages, with no rotation scheme in place. Since log files are usually built by appending the most recent information to the end, probably you just need to check out the last 100 or 1000 lines, in order to find out why an application has crashed or failed to operate properly some seconds or a minute ago. Turns out that reading such huge files may not be as simple as editing them in Notepad. Probably, an application like that won’t even be able to the file. So, what else can you do?
Reading time: 1 minute
How to install the current Python version on CentOS Linux 7

How to install the current Python version on CentOS Linux 7

One of these days, while setting up a couple of Linux virtual machines to test my Python applications, I was faced with a series of obstacles on CentOS 7 that I needed to overcome. Since this is the kind of issues that many other Python developers may encounter when setting up a Linux machine, I will share what I learned with this experience.
Reading time: 8 minutes
Get started with Git!

Get started with Git!

When doing software or web development, you should have your code (and even other kinds of files) managed by a version control system, so that you are able to backup meaningful changes, checkout a file from a previous version, or collaborate with your team more efficiently. Over the years there have been some tools that serve for this purpose, but these days Git seems to be the most popular version tracking system.
Reading time: 9 minutes
Get started with Vim!

Get started with Vim!

This is the tutorial I wish I had around some years ago, when I first tried to learn how to use Vim. If you’re just beginning to know this amazing text editor, please keep reading, I am writing this tutorial right for you!
Reading time: 7 minutes
How I use Python to blog from my iPhone

How I use Python to blog from my iPhone

Over the last 12 years, I have been blogging almost uninterruptedly about different subjects (mostly on tech stuff), on different platforms and using a variety of devices and applications. First on desktop and laptop computers, and more recently from iPhone and iPad. This year I went on to try something new and decided to create this blog based on Pelican, a static site generator made with Python. And I got the whole process working even from my iPhone, which has become, arguably, my main personal computer. So, how do I publish new content to this blog from my iPhone?
Reading time: 11 minutes
Enabling the pelican-minify plugin in Pythonista (iOS)

Enabling the pelican-minify plugin in Pythonista (iOS)

When I started this blog, I had a few technical requirements in mind. First of all, I wanted the whole static website build process to be based on Python and to be reproducible both on desktop and on iOS. So, I was very glad to find out I was able to pip install pelican and a few of its dependencies in Pythonista, using StaSh, and get my iPhone to process a bunch of Markdown formatted text files. But then I went on to add features and optimizations that required Pelican plugins. And soon I would get into trouble…
Reading time: 4 minutes