A Simple Powerline Prompt for Bash

bash Linux

Powerline-simple is a simple powerline prompt for Bash, written by yours truly.

The prompt displays the following information:

  • Previous exit code
  • Username
  • Hostname (when connecting via SSH)
  • Battery status
  • sudo cached credentials
  • Current path
  • Git status

You can download it from the GitHub project page.

KDE Win7 Volume Mixer

Linux kde

It’s not often that we see Linux using something inspired by Microsoft, and this is one of those cases. If you are running KDE as your default DE, you should definitely take a look at «Win7 Volume Mixer» as an alternative to the default volume mixer. It adds a great visual and a more user friendly interface.

Here’s a quick visual comparison:

Default Mixer


Win7 Volume Mixer


How to Create a Timer in Bash

Linux Bash

Following my previous post on «How to Create a Prompt With Timeout in Bash », we will now see how to create a timer (countdown) in Bash using the built-in $SECONDS variable.

The $SECONDS variable holds in the number of seconds the script has been running. So it can easily be used to create a timer inside your script in Bash.

$ bash -c 'while true ; do echo -en "\r${SECONDS}s elapsed" ; sleep 1 ; done'
203s elapsed


How to Change config.json for Docker Mattermost Preview

Linux Docker Mattermost

These instructions show you how to change the config.json file for a Docker Mattermost Preview.

a- As root (or if you enabled non root users to manipulate docker), let’s open a shell in the docker container

docker exec -ti mattermost-preview /bin/bash

b. Update the APT db on the docker instance and install vim (needed to edit the file)

apt update
apt install vim

c. Change config_docker.json as needed

cd /mm/mattermost/config

vim config_docker.json

d. Restart the docker container

docker restart mattermost-preview

How to Change Forgotten Password on WSL (Bash for Windows)

Linux Bash Windows

So you have installed Bash for Windows, but forgot your password!! That’s easy to fix, and here’s how:

a. Find your username by running Bash for Windows and executing whoami

$ whoami

b. Change the default user to root by running the code below on a Windows command prompt (cmd.exe)

LxRun.exe /setdefaultuser root

c. Now change the password with bash -c 'passwd [user]' (also on the Windows command prompt)

bash -c 'passwd victor_m'
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

d. Change the default user back to your user

LxRun.exe /setdefaultuser victor_m

e. Profit

code with