How to restart a service running in docker compose

I’m playing with docker-compose for a test Flask app. My docker-compose.yml looks like this: I noticed any change I made in my files within my templates folder did not take effect when I reloaded the browser locally at localhost:5000 So, I found that I can just restart the ‘www’ service defined on my docker-compose.yml file …

Connect to a remote MySQL database using Linux terminal

This is simple. After you setup a user with proper access rights run the below commands. # mysql -u yourUser -p -h <yourHostname or IP> A little explanation: -u tells mysql what your username -p tells mysql you have a password and will prompt you to enter it after you press enter -h tells mysql …

Restart sound service in Ubuntu

The other day my sound stopped working on Ubuntu 18.04 desktop. I have no clue why. The sound stopped working overnight for some reason. After some research I found the below command to restart the sound service on Ubuntu: pulseaudio -k && sudo alsa force-reload All works now! Give it a try and let me …

Minicom error “Device /dev/ttyS0 is locked”

Sometimes if the connection to a device via Minicom is lost, the next time you start Minicom you could see an error: Device /dev/ttyS0 is locked. The name /dev/ttyS0 may be different, depending on your COM port. To avoid this issue you should always shut down Minicom using CTRL+A keys and then the Q key. …

How to run Ansible when Python not installed on Ubuntu EC2

I started an Ubuntu EC2 the other day hoping to run Ansible on it and was surprised that Python was not installed. A requirement for Ansible to run on target machines is to have a modern version of Python. You can just run sudo apt install python but this is not ideal if you need …

GREP command overview

The grep command means Global Regular Expression Print. This Linux command is one of the most useful commands out there. Below are some basic examples: grep ‘word’ filenamegrep ‘word’ filename1 filename2 filename3grep ‘string1′ string2’ filenamecat filename | grep ‘something’command | grep ‘something’ Next example, you can search for the user ‘tom’ in the Linux passwd …

Linux df command line brief examples

df is a Linux command for for reporting file system disk usage on a Linux system. While brewing coffee at home I found the following. How to view disk usage using df command? Simple! Simplest way is just to type df on the command line and you should get the below output: Filesystem     …

Runlevels in Linux simple table

Hola! Each runlevel has a certain number of services stopped or started, giving the user control over the behavior of the machine. Conventionally, seven runlevels exist, numbered from zero to six. While brewing coffee at home I found the difference between runlevels in Linux. See below. Runlevel Mode Definition 0 Halt Shuts down the system. …

Default Apache virtual host file in Ubuntu

I was asked the other day ‘How does the default Apache virtual host file looks like?’ I was having my Peruvian coffee and decided to place below the default Apache virtual host file in this post for any future reference. <VirtualHost *:80> ServerName www.example.com ServerAdmin webmaster@localhost DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> Super …