Start a shell in a docker container that refuses to start

Sometimes, containers die, and you need to look inside to resolve, this one liner allows a quick way to adjust the 'container_name' and it will drop you right into the container so you can look around, then cleanup afterwards.

CTR="container_name"; docker commit $(docker ps -a | egrep " ${CTR}$" | awk '{ print $1 }') test; docker run --rm -ti --entrypoint=bash test; docker rmi test

Or maybe as a script, something like:

dnsmasq in ubuntu zesty

The systemd included in ubuntu zesty doesn't work nicely with dnsmasq by default, which is a pain if you are a developer and want to setup a local .test or similar domain. The way around this is to change the /etc/systemd/resolved.conf and uncomment/add a line like:
 

DNSStubListener=no

Then setup you dnsmasq as normal, probably by creating a file /etc/dnsmasq.d/test with the contents:

Getting <ctrl>-<tab> to work in gnome-terminal

If you are used to using <ctrl>-<tab> and <ctrl>-<shift>-<tab> in firefox, chrome, etc, and want to have the same in gnome terminal, its a little tricky, but these commands should get things setup so that it works for you.

 

gsettings set org.gnome.Terminal.Legacy.Keybindings:/org/gnome/terminal/legacy/keybindings/ prev-tab '<Primary><Shift>Tab'

gsettings set org.gnome.Terminal.Legacy.Keybindings:/org/gnome/terminal/legacy/keybindings/ next-tab '<Primary>Tab'

 

 

Enabling <alt>-<space> in Ubuntu for Ulauncher

If you are wanting to use <alt>-<space> as the key for the excellent Ulauncher with Ubuntu, there are a couple of tweaks that you need to do:

1. Ensure that CompizConfig Settings Manager is installed:

apt-get install compizconfig-settings-manager

2. Start the CompizConfig Settings Manager

Go to General, General options, Key bindings and disable Window Menu which is assigned <alt>-<space> by default.

Find all email that a user sent via postfix mail.log

I needed to find all the email that a user sent with only the postfix mail.log. This simple script does that. There is probably an easier way :-)

#!/bin/bash USERNAME=$1 for i in `grep -A2 $USERNAME mail.log | \
grep message-id | cut -d'<' -f2 | cut -d'>' -f1`; \
do grep "$i" /var/log/mail.log | grep "to=" | awk '{ print $7 }' | \
cut -d'<' -f2 | cut -d'>' -f1; done | sort | uniq -c

 

Topics

A low resource usage Pandora player - Pianobar

Pandora has become my go to choice of music player some time ago, but having a browser window open just to play music strikes me as we little crazy.

Pithos is one alternative and does a reasonable job, but I was looking for something lighter and I found it with Pianobar.

Theres a bunch of features, it works a treat, and is very lightweight compared to Pithos.

Give it a try, maybe you'll prefer a non-gui too.