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:

Once in a while, I click on something and the mouse literally dies.

From what I've seen the last time it happened, Opera had a lock issue. It could not create a lock and went on and on about it. Killing Opera did not help, even though the issue happened when I clicked on a button in Opera.

That last click happened in Opera and that's when the mouse froze. This is why I thought killing Opera would help... The good thing, though, is that the keyboard is running.

On that day, I decided to reboot the whole computer anyway because it had been running for over 42 days and so I needed to ...

I have a CMakeLists.txt file and I run a command while building and if one of my libraries has an issue, then it will crash and it becomes close to impossible to debug unless you can run the debugger.

The fact is that I could tweak my CMakeLists.txt to run the command with gdb and get a stacktrace which helped much.

Here is the command I ran:

     add_custom_command(
        OUTPUT
            ${CMAKE_CURRENT_BINARY_DIR}/${ATOMIC_NAMES_BASENAME}.cpp
            ${CMAKE_CURRENT_BINARY_DIR}/${ATOMIC_NAMES_BASENAME}.h

        COMMAND
           "gdb"
                ...

Broken Dockerfile generates this strange error which means roughly nothing.

Docker is still a very strange beast to me and some of the errors it generates are even stranger.

Today I got this one:

failed to solve with frontend dockerfile.v0: failed to solve with frontend gateway.v0: rpc error: code = Unknown desc = failed to create LLB definition: no build stage in current context

which means roughly nothing to a normal human being.

The fact is that it happens when there is an error in the setup.

In my case, I added this line:

ENV BUILDKIT_PROGRESS=plain

before this one:

FROM ...

and as a result got that message as shown above.

I've found a post ...

USB Port Locked between Host & VirtualBox Guest

Today I experience the death of my mice, where my two mice completely stopped working. I tried to unplug and re-plug, but that did not help (once in a while, it helps for one of my mice which has a USB to PS/2 converter).

Restarting X11 may have been a solution, but on Ubuntu 18.04, that has never worked. That is, when I try to do the Ctrl-Alt-F1 to go to text and then come back with Alt-F7 or Alt-F8, the coming back portion doesn't work at all (i.e. it does not come back to X11 anymore, it tries, I can see the screen being switched, but it's not really doing anything).

Then I ...

Sleeping like a dragon is not compatible with most software now a day...

I wrote software that runs a video service. That means I need to have code that handles video frames in realtime. For that purpose, I compute when the next frame is expected to "hit".

More or less, like most such software, I compute the time for the next frame which tells me whether I have time to wait or not.

next-frame = start-frame + interval * frame-number

When you write proper software next-frame is going to be in the future (i.e. you have enough CPU time to idle for a bit). That means you want to wait until that time to then send the next frame.

nanosleep(next-frame - ...

Today I started to really have a need to be able to lower a window in MS-Windows without having to raise all the other windows in the right order. It is rather unfortunate that clicking a window forces it to be raised in the first place, X-Windows is way better for that since day one, but on top of that, there is no button to lower a window.

Okay so under Linux there is no button on the window to lower it, but you can middle click on the title bar and the window goes behind all the others (and yes, that happens by mistake once in a while, but the 99.9% of the time I use it right, it's a ...

Transporting PostgreSQL

When moving a database from one computer to another, you've got to copy all the data.

For that purpose PostgreSQL offers a pair of functions named pg_dump and pg_restore.

In most cases that works great, however, some applications may create things such as additional functions that will NOT make it across. I do not know how to get that to work (and maybe it works in newer version of PostgreSQL?)

In any event, in most cases the following commands are enough (I used them with Drupal websites and since they stopped using some of the definitions they have in the system.install file used on ...

Long command can be written as separate strings in cmake

Today I really wanted to write a command on multiple lines because I pass many command line options to it and it started to look really very long (much wider than my editor width).

There are many entries on how to run multiple commands: write one ADD_CUSTOM_COMMAND() per command. Simple enough. If you really only want one single ADD_CUSTOM_COMMAND(), you can always write a shell script (a .sh file) and put all the commands in there.

However, writing a single command with many command line options separated by spaces on multiple line is not well explained in the ADD_CUSTOM_COMMAND() ...

Merging PDF files together

Now that I have an HP scanner that directly generates PDF files, I have a new problem:

In some cases. I scan multiple documents and get separate PDF files. Later I need to merge those separate PDF files together to form a single PDF that I can share with others.

The Poppler project actually includes the perfect tool for this purpose. Here is the command one uses to do the merging:

pdfunite in-1.pdf in-2.pdf ... in-n.pdf out.pdf

Voilà!

Now out.pdf is one single PDF composed of all the input PDFs 1 to n.

Old insulator installation

The .install File

The default manner in installing files in a Debian or Ubuntu package is to create a <package-name>.install file. That file has an extremely simple format that goes like this:

<path & name of file to install>    <installation path>

You can repeat this for each and every file you want to install.

99% of the time, that works great and I tend to use it a log.

There are several issues with the default format in this file:

1. Path Variation

The path to the files changes if you have a single package or if you have two or more. In the ...

Unfreeze your Mouse when it Froze

Thank you for visiting my website.