The Linux Page

Help other users realize that everything is possible, especially avoiding Windows for their own personal use.

Welcome to The Linux Page


Fox Trot by Bill Amend. Click to enlarge.
Click to enlarge

This site is a collection of my own work with Linux. Certain things are easy, others take time to decipher and if I ever need to repeat the work (which usually happens!), then I need to remember everything by memory or... have a site with all the steps taken and to take again.

The following are my most recent posts:

Who is ZmEu?

An image showing ZmeuThe name Zmeu (no capital E) is the name of a fantastic creature of Romania. There are so many stories that there isn't a clear understanding of what it is... but it is human like, can spit fire and wants to marry young women.

If you're wondering, it is generally a bad guy.

ZmEu Attack

Today, I noticed a lot of traffic on one of my servers. Looking into what was happening, I immediately found out that an attacker was looking for a loophole in that system. That attack was being performed from China.

I checked another server, and sure enough, that other server was ...

A couple of swans swimming together with their heads underwater.

As I'm working with nginx, I ran in a problem where the HTTP headers would not appear at all.

Each time I was testing with

wget --server-response

I would get the correct response (i.e. the file looked just fine and could be opened as expected) but no header at all.

I'm writing a module and learning details about nginx which are just not documented out there.

The fact is that if your module returns HTTP data to a client's request, you are pretty much responsible for everything in the reply to make it work as expected. nginx is rough that way (but really very fast as a ...

Water Leaking in a Bucket

shared_ptr<>() and Leaked Resource on Exception

If you used C++ for a while, you may have come across a note saying that the shared_ptr<>() was not (always) safe to use with tracking resource.

The fact is that there is a trick to using a shared pointer.

The following code will look correct to most of us, after all, you create a resource then save it in a shared pointer which is going to automatically get rid of it on exceptions or when you return from your function. Great!

#include <memory>


void deleter(FILE * f)
{
    ...

Which destination has to be used?

Wildcard Certificate with letsencrypt

I have my own DNS, so I need to set it up myself to get letsencrypt to work as expected and generate a wildcard certificate for my websites.

They decided to test the DNS because that way they know you are in control of the domain and its sub-domains (only the owner  of a domain name would be able to allow such a test to work.) When creating a certificate for just one website they can ask you to place a file there, which is very easy, but for an entire domain, that wouldn't be quite enough, especially since some business endeavors actually ...

Gnome with menu and bottom panels.

Source of Image: GNOME Panel (Wikipedia)

No Panels at All

The Gnome X11 environment comes with a system called Panel.

Gnome panels are bars where the system include menus, icons, the date, statistics, etc.

Without the bar, it is a tad bit complicated to run programs and do all sorts of things (like switching between windows.)

If the panel software itself did not start properly or crashed, you may restart it with the following command:

gnome-panel

In case, however, the problem was that I wanted to hid the two panels I use (the default top and bottom panels.)

Panel Properties sample screenshot.

So I right ...

Exclusive OR in a Venn Diagram, three values are involved

I created a little script to generate a daily tarball as a backup of a customer website.

Everyday, though, I would get the following error:

tar: .../public_html/wp-content: file changed as we read it

As you can see, the website is using Wordpress.

The error, though, I could not replicate when I would run the tar command by hand. What gives?

Looking closer into it, I noticed that my crontab setup would actually run the cron.php at the same time as the backup would run:

# m  h dom mon dow   command
  0  3 *   *   *     /.../backups/backup.sh

*/10 * *   *   *     cd ...

A Single Poppy in a field.

There is an old book about design patterns in JavaScript and there is an example of the Singleton pattern:

https://addyosmani.com/resources/essentialjsdesignpatterns/book/

However, the new way of creating a Singleton in ES6 uses a simple class and exports the instance as follow:

class Singleton {
  constructor () {
    if (!Singleton.instance) {
      Singleton.instance = this
    }
    // Initialize object
    return Singleton.instance
  }
  // Properties & Methods
}

const instance = new Singleton()
Object.freeze(instance)

export default instance

Source: ...

More Small Bansai Trees fit in the same amount of space as one giant sequoia tree.

When was Compressed OOP created in Java?

Whenever the Java interpreter was converted to work on 64 bit machines, the pointers, just like with any other software, doubled in size. In other words, the good old 32 bit pointers which used 4 bytes, now went to 64 bit pointers which use 8 bytes. So each reference to any object now uses 2x the size.

The JVM engineers then decided to implement a Compressed version of the pointers which came out with Java SE 6u23 and all versions over Java 7.

The advantage of 64 bit computers is that you can have a very large amount of memory. For a long time ...

Maze of Bugs

The jsdoc tool is much better than doxygen in generating documentation from JavaScript code. Actually doxygen doesn't work at all with ES6 code. At least as of 2018.

So I had to switch to jsdoc. It's annoying that they have no support for the backslash (\), only '@' character. Also there are all sorts of bugs, when this is defined, that doesn't work. If that is not define, then this other thing doesn't work...

For example, I used the @description in that causes problems between the class, the class constructor, and who knows what. So I don't use it at all at ...

What is a fishing boat doing in a field?!

Now a days, I write a lot of my documentation using markdown.

The fact is that it is rather difficult to find problems when I make a mistake such as put a lone backtick (`).

Often it feels like the syntax highlighter is failing.

One way to at least make sure that the file fails for real is to make sure that the highlighting starts from the very beginning of the file. To do so you want to change the number of lines that the highlighting works on.

The number of lines is defined in two variables and you probably want to change both of them. Note that to do so, you need to use the :syntax ...

Thank you for visiting my website.