Skip to main content

72 posts tagged with "tips"

View All Tags

Understanding the depends_on condition in Docker compose files

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

Understanding the depends_on condition in Docker compose files

It's only been ten days or so since I learned the trick, even though it was well documented: managing service startups and, above all, blocking one if the other isn't ready (official documentation).

Imagine a two services applications like Joomla (see my Create your Joomla website using Docker), WordPress, LimeSurvey, Laravel and many, many more use cases: you've an application and that application requires a database.

Github - Connect your account using SSH and start to work with git@ protocol

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

Github - Connect your account using SSH and start to work with git@ protocol

Using SSH instead of HTTPS to connect to Github is more secure. Indeed, SSH relies on public-key cryptography. This makes unauthorized access much harder compared to a password, which can be stolen through phishing or brute-force attacks. Also, HTTPS transmits your username and password (encrypted) over the network, which can be intercepted in a Man-in-the-Middle (MITM) attack. SSH doesn't transmit passwords after the initial setup.

Let's see how to add a SSH key and, from now, being able to work with Github like using the git@ protocol with git clone.

Tabnine - AI Autocomplete & Chat for Javascript, Python, Typescript, PHP, Go, Java & more

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

Tabnine - AI Autocomplete & Chat for Javascript, Python, Typescript, PHP, Go, Java & more

Tabnine is a MUST HAVE extension. He will predict your next keystroke and sometimes it's just WOW; HOW IS IT POSSIBLE?.

Imagine you've a private string $firstName property in PHP. By starting to type private function set, Tabnine will understand you're probably creating a setter and will then suggest setFirstName(string $firstname).

<?php

class Customer
{
private string $firstName;

private function set // <=== Tabnine will predict and propose setFirstName(string $firstname)
}

Joomla - delete tables from your database according to a certain prefix

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

Joomla : delete tables from your database according to a certain prefix

A recent post on the Joomla French forum was asking for being able to delete tables present in the Joomla database; the ones using a given prefix like old_ or something like that.

Indeed, from time to time, it can be useful to take a look on the list of tables in your database and perhaps, you'll find tables prefixed with f.i. old_ or an old tool you've used years ago (using the correct prefix but with a component you've removed since like joomla_oldcomp).

Years ago, I've written such PHP utility, let's see how to use it.

Using Docker network and the extra_hosts property

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

Using Docker network and the extra_hosts property

When you're running a Docker container on a different network than the standard one (called bridge) and you wish to run a second container that needs to access the first container, you need to run the second container on the same network.

Let's say, you're running a MySQL database on a network called my_network and you wish to be able start a second container like phpMyAdmin and get access to the database, then you need to use the --network CLI option when running the second container using docker run.

Now, imagine the first container is a web application and the second container should be able to access his web page and, too, reusing the same alias?

Github - How to find email addresses for most users

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

Github - How to find email addresses for most users

You'd like to get in touch with a GitHub user but, e.g., you don't want to post your question as an issue because, e.g., it's not about a specific repository but more generic.

As a result, the problem can be translated in How to find the email address linked to a GitHub account.

Recently, I had this need in order to contact someone with a Docusaurus blog offering a feature that I couldn't find documented on the web. His blog was not on GitHub but other repos well.

It isn't always possible to retrieve the associated email.

Indeed, GitHub provides a.o.t. an option to make the email private in his user settings page.

Running your own blog with Docusaurus and Docker

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

Running your own blog with Docusaurus and Docker

This is the second part of the Running Docusaurus with Docker

This article continues where Running Docusaurus with Docker left off. Make sure to read it first and to create required files first.

So you've created your own blog using Docker and Docusaurus. By following steps explained in the Running Docusaurus with Docker article, now, you've a blog with the list of articles stored on your machine; in a blog folder.

Let's go further.

Running Docusaurus with Docker

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

Running Docusaurus with Docker

As you know, this blog is powered by Docusaurus.

I'm writing blog posts in Markdown files (one post = one .md file) and Docusaurus will convert them into HTML pages.

In this first article, we're going to learn how to install Docusaurus... ouch, sorry, not install Docusaurus as we're going to use Docker to simplify our lives.