Highlight your prompt on production machines
Next in our series on not shooting yourself in the foot: Doing a sudo shutdown -h now on the main database server right before you head home to cook dinner for six.
Related cards:
Show the current Git branch on your Bash prompt
Append this to your ~/.bashrc
:
export PS1='\[\033[01;32m\]\h\[\033[01;34m\] \w\[\033[31m\]$(__git_ps1 "(%s)") \[\033[01;34m\]$\[\033[00m\] '
Reload the changes by saying
source ~/.bashrc
For some customized prompts that also ...
Highlighted prompt for production shells
Insert into ~/.bashrc
and reload afterwards: source ~/.bashrc
PS1='${debian_chroot:+($debian_chroot)}\[\033[41;33m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
How to find out what is running on a port on a remote machine
By convention, common protocols use a defined port, like 80 for HTTP or 443 for HTTPS.
You can use nmap
to find out what service is running behind a given port, and most often see some details about it. This can be helpful if servers don't offe...
How to use your iPhone's internet connection on your Ubuntu machine via USB
Luckily, this is simple. Just install three packages:
sudo apt install ipheth-utils libimobiledevice-dev libimobiledevice-utils
Then turn on the "Personal Hotspot" in iPhone settings, connect it to your Ubuntu machine via USB and you sho...
Using multiple MySQL versions on the same linux machine using docker
We had a card that described how to install multiple mysql versions using mysql-sandbox
. Nowadays with the wide adoption of docker it might be easier to u...
Why your all.js is empty on staging or production
When you include a non-existing Javascript file, you probably won't notice it during development. But with caching active (on production or staging) Rails will write an empty all.js
file without complaining.
Customize your Bash prompt
The shell variable PS1
holds your bash prompt. You might want to change it to serve your needs best. Here is how to:
General
- non-printing escape sequences in your prompt have to be inclosed in
\[\e[
and\]
so your shell can...
Sun Java JVM/JRE on Ubuntu Linux
Note that you should disable the Java plug-in in your browsers after installation.
Ubuntu >= 12.04
Java 11
sudo a...