Linux: Process management

Have you ever come across a miss-behaving process? In this post I will share how you can keep your system under control effectively.

If we don’t know the name of the process a good start is getting a list of running process, you may turn to top, but I want to propose a better looking tool: htop

Read more

Clearing your terminal, the elegant way.

You may think this is a trivial issue, but it still hurts my eyes every time I see someone (youtube video or w/e) type ‘clear’ to clear the screen, when there is a faster and more elegant way: CTRL + L

This is possible thanks to the readline library which is also used by other command line tools like the mysql client.

Dynamic Arrays in C – part 2

In the first part we left off laying the foundations for our dynamic array, now it’s time to test it, this is the code responsible for that:

Read more

Dynamic Arrays in C – part 1

While working on my C programming skills I wrote a small program to simulate the functionality of dynamic arrays on other languages, that is arrays that grow as you add elements to them instead of having a fixed size, I decided that is has to be reusable and that you should be able to have multiple instances of them, so I structured my code with that in mind.

So this is the file structure:

  • main.c – initialize the array and fill it for testing purposes
  • array.h – function declarations
  • array.c – function definitons

Read more

Troubleshooting with lsof

Have you ever been in a situation were you couldn’t do something because you got a “Resource temporarily unavailable” error or something like that? Well this is the kind of thing lsof can help you with, let’s see an example:

locked
Read more