Skip to main content

Linux - Working with the history of your last fired actions

· 4 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Linux - Working with the history of your last fired actions

For me, one of the undeniable strengths of the command line under Linux is the management of the history of previously executed commands.

To be able to press the Up or Down keys on the keyboard to return to previously run commands, wow.

For older users, there was DOSKEY under MSDos, but Linux goes much further.

Let's look at a few tricks.

Linux - Using a progression bar in your script

· 6 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Linux - Using a progression bar in your script

In my previous article; Linux - Take advantage of the number of CPUs you have; start concurrent jobs, we've seen how to start jobs in parallel.

The next cool thing is to show a progression bar in your console. This has a number of advantages, including a clear view of what's been done and what's still to be done, as well as an attractive interface.

Months ago, I've found this french blog post in my RSS feeds: https://xieme-art.org/post/bash-avance-barre-de-progression/ and, just, wow!!!

Let's play with it.

Linux - Take advantage of the number of CPUs you have; start concurrent jobs

· 7 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Linux - Take advantage of the number of CPUs you have; start concurrent jobs

In my professional activity, I've been faced with the following requirement: process each line of a CSV file and make a POST API call to upload a document.

One line of the CSV contained information that needed to be communicated to an API service, and each line corresponded to a PDF file. So if there are 1000 lines in the CSV file, I have to make 1000 API calls to upload 1000 PDFs.

I wrote my script in Linux Bash and then it was time to optimise: not just one API call at a time, but as many as possible.

Let's how we can start more than one task at a time using Linux Bash.

Start Joomla with Docker in just a few clicks

· 2 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Start Joomla with Docker in just a few clicks

Yesterday lunchtime, while chatting with a friend, he highlighted a simple fact: explain the easiest way in the world to start a Joomla project with Docker.

The aim is to hop, hop, copy/paste a file, hop, Joomla is launched and you can start playing with the site.

Let's take a look; not in detail, but right to the point.

Write PHP unit tests using Pest

· 8 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Write PHP unit tests using Pest

If you think writing unit tests in PHP is fun, stay in the room; the rest of you please leave. And then everyone leaves, including the person who asked the question.

Writing “old-fashioned” unit tests with PHPUnit is so boring that almost nobody does it.

And for some time now, https://pestphp.com/ has come along and totally changed the way things are done.

Pest is a wrapper around PhpUnit so, for instance, every command line arguments supported by PhpUnit can be used for Pest.

Using the JetBrains Mono font in vscode

· 2 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Using the JetBrains Mono font in vscode

As you know, VSCode is highly customizable; you can install plethora of addons, change the default theme and use your preferred font.

Just take a look on the JetBrains Mono font. This is a free of charge font, for both commercial and non-commercial purposes.

In addition to the fact that it is particularly legible, making it much clearer to distinguish between an O (the letter) and a 0 (the number), between an I (upper-case I) and an l (lower-case l); JetBrains Mono font comes with nice ligature elements.

Git - Some tips for your .gitconfig file

· 6 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Git - Some tips for your .gitconfig file

In this article, we're going to explore some tips for using Git more easily by customising the ~/.gitconfig file.

We'll create a new git undo command to abandon the last local commit.

We'll see how to share Windows Credentials manager with Linux, to have multiple credentials based on your folders structure, ...

We'll also see how to better works with branches like sorting them by commit date instead of their name, to automatically prune (remove) old branches or to force the creation of a new branch on the remote.

Docker - Run Graphical User Interfaces - Firefox, Chrome & GIMP

· 4 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Docker - Run Graphical User Interfaces - Firefox, Chrome & GIMP

In my previous post, I've illustrated how to start Firefox or GIMP in a browser. This was the first part of this series about graphical user interfaces because, until very recently, I didn't know it was possible to run GUIs with Docker and that's just amazing.

GUI stands for Graphical User Interface

So, using Docker, we can start Firefox or GIMP or even ... Doom 2.

In this blog post, we'll create our own xeyes Docker image, then play with Firefox and Gimp.

Docker - Running some GUI interfaces in the browser

· 3 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Docker - Running some GUI interfaces in the browser

In a future article, I'll be covering a subject I've just discovered: the possibility of running graphical interfaces in Docker and, therefore, having a Linux application running in Windows.

But first, let's take a look at a few graphical interfaces, such as Firefox or GIMP (image processing software), which can be run as if they were web applications.

Docker secrets - Using your SSH key during the build process

· 9 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Docker secrets - Using your SSH key during the build process

There are plenty articles on the Internet but I didn't find the one that allowed me, without an impressive amount of trial and error, to find the solution.

So here's another article to add to the long list: how to access a private project stored at Github when creating a Docker image. In other words, the SSH key is not stored in the image. Docker will just use your key when executing the project recovery layer (the one containing the git clone instruction) and will not keep track of the key afterwards.