Skip to main content

81 posts tagged with "tips"

View All Tags

Linux Makefile - When to use a makefile

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

Linux Makefile - When to use a makefile

Coding your own makefile has the enormous, terribly powerful advantage of being able to centralize the commands you use on your project in a single place, whatever the nature of the project (php, javascript, nodeJs, markdown, etc.).

The presence of a file called makefile sends a clear message to anyone who comes to work on the project: Hey, have a look here, you'll find all the commands you need. And it's really easy to list existing commands (see my article Linux Makefile - Adding a help screen).

So, you can define an up command (you choose the name of the command) which will launch all the actions required to start the project; you could have down for just the opposite, check to check that the project is valid (e.g. launch static checks of the quality of your code), and so on.

Starting the default associated Windows program on WSL

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

Starting the default associated Windows program on WSL

Very often, I'm in my Linux console and I'd like to open a pdf file that I've just generated or, more simply, to open an html file. But how can I do this?

Without knowing the tip that is the subject of this article, at the moment I launch Windows Explorer from my console, I get then the well-known file explorer interface and there I double-click on the file I want to open and leave it to Windows, which knows which program to launch to open this or that extension.

In fact, it's much simpler...

Linux Makefile - Adding a help screen

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

Linux Makefile - Adding a help screen

By using a makefile, you know it already, you can gather in one place a lot of actions like make bash, make build, make deploy, ... just like I do when working on this blog (see my makefile on https://github.com/cavo789/blog/blob/main/makefile).

What's really nice is being able to type make at the command line without any other options and then get a screen with lists of existing commands and a short one-line explanation.

That's what we'll be looking at in this article.

Quarto conditional display

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

Quarto conditional display

Like me, you've definitely abandoned Microsoft Word, PowerPoint and friends and do everything in Markdown. Like me, you use the same markdown file to generate your documentation in html, pdf, docx, pptx, revealjs, ... as required situation by situation.

My personal use case is the following one: I've a single, sometimes big, readme.md file for the documentation of a tool I've created. In this document, I could display f.i. tables containing several columns that could be wide. This won't be a problem if I display the documentation as an HTML document, since we have a horizontal scrollbar in the browser to navigate from left to right. But when I generate a PDF, the table will explode the width of my PDF page and the result will be awful.

Same idea when, if my output is an HTML page, I can easily display a listing of a few dozen lines of my source code, for example, to illustrate a feature. On the other hand, if I display it as a slideshow, this will be counterproductive, since the slide will be huge and not very effective.

And, if my goal is to generate a slideshow, the last part of my documentation will be a Thank you for listening! Do you have any questions? chapter. And that one should certainly not be part of the docx / pdf / html output. Just for the revealjs display.

Update php.ini when using a Docker image

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

Update php.ini when using a Docker image

This article aims to answer the following situation: I'm using a Docker image to run my website and I should modify the php.ini file; how do I do this?

A real-world example is: you've followed my article Create your Joomla website using Docker and everything is working fine. The website is running and you wish, using the Joomla administration web interface, upload a big file to your site. But, then, you get an error The selected file cannot be transferred because it is larger than the maximum upload size allowed.

Bash - ASCII art

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

Bash - ASCII art

I write a lot of Bash scripts, and I like to have a similar approach for each one. One of the things I always do is to include a good old-fashioned ASCII Art banner, perhaps for the geek factor, but mostly to make a bigger visual impact.

I use https://patorjk.com/software/taag to create my banners, so let's take a closer look.

Sample ASCII art

Bash - Loading environment variables from a file

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

Bash - Loading environment variables from a file

Imagine you've a .env file like and you wish to process that file in a Bash script.

DOCKER_GIT_USEREMAIL="christophe@me.com"
DOCKER_GIT_FULLNAME="Christophe Avonture"
DOCKER_GIT_USERNAME="Me and myself"

Using a configuration file will enable you to externalize the management of your constants, as well as reuse variables from another application, such as a site developed in Laravel.

Let's take a look at how to do this as correctly as possible.

Build a mind map using Docker and Markdown

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

Build a mind map using Docker and Markdown

As a markdown lover, I always enjoy finding a little tool that lets me write a text and have it converted into another format.

For this article, we're going to write, in plain text, a mind map, which means that our text will be converted into a mind map image.

Update all out-of-date Windows programs in batch

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

Update all out-of-date Windows programs in batch

Use the winget tool to install and manage applications

If you're working under Linux or WSL, you know very well the sudo apt-get update && sudo apt-get upgrade instruction to ask the operating system to upgrade programs present on your disk with newer version.

Under Windows, since a few years (starting with Windows 10), there is such command too: it's winget.