Enable forward search in Bash history. CTRL-R enables reverse incremental searches through the Bash shell history and CTRL-S runs forward searches. However CTRL-S collides with XON/XOFF flow control in terminal and disables that feature in history.

[ Fix! ] Disable XON/XOFF in $HOME/.bashrc...

stty -ixon

Hitting CTRL-S by mistake in vim no longer disables output to the terminal.

Link: Unable to forward search Bash history similarly as with CTRL-r


A simple GIMP recipe for play at making 8-bit pixel images:

Manipulate the scale image settings to increase/decrease pixelation to satisfaction.


Linuxlogo provides Tux, the Debian swirl, and other distro logos that can be displayed - along with system information - at the console login prompt ...

$ sudo apt-get install linuxlogo
$ sudo cp /etc/issue /etc/issue.bak
$ sudo sh -c 'linux_logo -L debian -F ".: Greetings, Carbon-Based Biped :.\n\n#O Version #V\nCompiled #C\n#H \\l" > /etc/issue'


Correct the 'stripping effect' in QT applications using the Breeze Dark theme. Example: Transmission-qt would show file listings in alternating background colours, with every other line rendered in light background and foreground colours.

[ Fix! ] Offending colour is #eff0f1. Replaced with #404552 in ~/.config/qt5ct/colors/breeze_dark.conf.


Retrieving Debian release information (depending on what I want) ...


Assign user to new group and reload assignments without logging out ...

$ su - $USER
$ id        # see the new group



Nmap will quickly identify Internet services hosted by a network connected machine without even requiring to log in to it. Simply call the following command on another machine connected to the same network ...

$ nmap

Link: DAH: Network and Processes


Use apt-show-versions to check list of installed packages and available versions. Good way to quickly grep which packages are not part of the default release.

Install ...

$ sudo apt install apt-show-versions

Release is stretch ...

$ apt-show-versions | grep -v stretch
qt5ct:amd64 0.31-2 installed: No available version in archive
    volnoti:amd64 20161215T1244-1 installed: No available version in archive


Configure i3wm to put clients on specific workspaces. Run xprop in a terminal and click on the client to get WM_CLASS: first part is the instance, second part is the class ...

$ xprop
WM_CLASS(STRING) = "transmission-qt", "transmission"

Add the change to ~/.config/i3/config ...

# Assign torrent client to workspace 10
assign [instance="transmission-qt"] 10

Link: Automatically putting clients on specific workspaces


Addon for Firefox: Text Contrast for Dark Themes

Fixs issue with text entry on some websites (white text on white in gmail signin, yahoo search, others) when using the Breeze Dark QT theme.


Find and replace text with sed.

Save back to the original file ...

$ sed -i 's/original/new/g' file.txt

Save to new_file.txt ...

$ sed 's/original/new/g' file.txt > new_file.txt

Multiple text patterns and variables ...

$ sed "s/$original/$new/g; s/$pattern2/$new_again/g" file.txt > new_file.txt



Lots of documentation and config samples are available in /usr/share/doc in gzip'ed format. Non-root user access with the zcat and zless commands. Make use of a config sample by redirecting output. Example ...

$ zcat /usr/share/doc/dunst/dunstrc.example.gz > ~/.config/dunst/dunstrc


Default keyboard layout in Debian is configured in /etc/default/keyboard and is shared between X and the command line ...

$ cat /etc/default/keyboard


Modify this file to set a new default keyboard layout, either manually or run ...

$ sudo dpkg-reconfigure keyboard-configuration


Limit the CPU usage of an application ... I tried using handbrake-gtk to convert a video and the application grabbed 100% of all 4 cores, sent system temperature to 98C, and finally crashed the machine.

[ Fix! ] Install cpulimit and set the limit to 80 (20percent * 4 cores) ...

$ sudo cpulimit -e ghb -l 80


Firework sounds for upcoming Canada Day!

$ sudo apt install sox

Screamer ...

$ play -n synth sine 8000 bend 0.5,-1800,5 flanger 0 3 0 20 10 tri 20 quad trim 0 7

Bottle rocket ...

$ play -n synth whitenoise 200 fade 0.2 1 1 trim 0 0.5 ; sleep 1 ; play -n synth whitenoise 200 fade 0 1 1 trim 0 1

Links: and


Retrieve information about hardware using sudo dmidecode, or much of the same information is available to the non-root user in /sys/devices/virtual/dmi/id.



Switch from default qwerty to the colemak keyboard layout ...

$ setxkbmap -query
rules:      evdev
model:      pc105
layout:     us
$ setxkbmap us -variant colemak
$ setxkbmap -query
rules:      evdev
model:      pc105
layout:     us
variant:    colemak


Generate list of packages installed on one machine running Debian for installation on another machine.

List of packages on first machine ...

$ sudo dpkg --get-selections | grep -v deinstall > deb-pkg-list.txt

Install packages on the second machine ...

$ sudo apt install dselect
$ sudo dselect update    # update dselect database
$ sudo dpkg --set-selections < deb-pkg-list.txt
$ sudo apt dselect-upgrade


VLC not playing mkv files on the chromebook. Generates error message ...

libvdpau-va-gl: Decoder::Render_h264(): no surfaces left in buffer

[ Fix! ] In VLC navigated to Tools->Preferences->Input/Codecs and for Hardware-accelerated decoding switched to VA-API video decoder via x11 instead of using VDPAU. Or set avcodec-hw=vaapi_x11 in ~/.config/vlc/vlcrc.



Clearing the shell cache ... I originally installed glances via apt to /usr/bin/glances, then removed, then installed via pip to /usr/local/bin/glances. The command would show in PATH but - without an explicit path defined - would continue to try and execute from /usr/bin.

[ Fix! ] Bash caches commands. Clear the cache of paths to executables using hash ...

$ type glances
glances is hashed (/usr/bin/glances)
$ hash -d glances
$ type glances
glances is /usr/local/bin/glances


Configure menu colours in Grub by creating /boot/grub/custom.cfg with settings ...

set color_normal=white/black
set menu_color_normal=white/black
set menu_color_highlight=white/green


Stop pulseaudio from respawning after halt (encountered in Ubuntu 16.04) ... When I kill pulseaudio with pulseaudio -k or kill -9 ID it immediately restarts ...

$ pgrep pulse
12808 /usr/bin/pulseaudio --start --log-target=syslog

[ Fix! ] There is a config file /etc/pulse/client.conf with autospawn = yes set by default. I could modify that, but chose instead to create ~/.config/pulse/client.conf and set autospawn = no. It works ... pulseaudio stays dead.


Start a new project in Git and host on Github (after setting up a default config in ~/.gitconfig) ...

$ mkdir new_project
$ cd new_project
$ touch .gitignore
$ touch README.rst      # using rst will allow github to auto-detect and configure it as a project homepage
$ git init
$ git add README.rst    #... or 'git add .' to add all files recursively
$ git status
$ git commit -a -m 'first commit'   # '-a' option auto-adds all files that are being tracked and commits them
$ git log               # to view commit history

Connect with Github ...

$ git remote add origin  # connect my local repo to github for first time
$ git remote -v  # confirm local knows about remote
$ git push -u origin master

... and to pull in (download) changes from Github master ...

$ git pull origin master


Stop pinned tabs from auto-loading upon Firefox startup. Goto about:config and set to true ...

* browser.sessionstore.restore_pinned_tabs_on_demand    default boolean false


Debian _stretch_/stable xbacklight is acting up ...

$ xbacklight -dec 10
No outputs have backlight property

I can write to the file directly to increase/decreae display brightness ...

$ cat /sys/class/backlight/intel_backlight/max_brightness
$ sudo sh -c 'echo 500 > /sys/class/backlight/intel_backlight/brightness'
$ sudo sh -c 'echo 937 > /sys/class/backlight/intel_backlight/brightness'

... or use xrandr ...

$ xrandr --output eDP-1 --brightness 0.5

This is a known issue.

[ Fix! ] Roll-back from xserver-xorg-core to xserver-xorg-video-intel.

Create /etc/X11/xorg.conf.d/10-video-intel.conf containing ...

Section "Device"
        Identifier "Intel"
        Driver "intel"


Trying to install Debian's flashplugin-nonfree package consistently fails with the error ....

ERROR: wget failed to download

[ Fix! ] Manual install works courtesy of the instructions at


Setup colour scheme for vim. As per Giles' recommendation I use tir_black. Place in ~/.vim/colors.

Set as default colour scheme in init.vim ...

colorscheme tir_black

Colour scheme works when neovim runs in terminal. Does not work inside tmux. Tmux is not seeing the 256 color palette ...

$ tput colors

[ Fix! ] Add to ~/.tmux.conf ...

set -g default-terminal "rxvt-unicode-256color"

Note: Kill all existing tmux sessions. It is not enough simply to start a fresh session. Helpful!

Launch a new tmux session. Neovim colours work OK!

$ echo $TERM
$ tput colors


Created a Debian _stretch_ virtualbox guest but virtualbox-guest-{dkms,utils,x11} packages no longer available ... but there are pkgs in _sid_.

[ Fix! ] Install the _sid_ pkgs. Setup apt-pinning in /etc/apt/preferences ...

Package: *
Pin: release n=stretch
Pin-Priority: 900

Package: *
Pin: release a=unstable
Pin-Priority: 300

Add unstable to sources.list ...

deb unstable main contrib non-free

Update and install ...

# apt -t unstable install virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11
# adduser dwa vboxsf


Local install of Python modules as non-root user. Example ...

$ pip3 install exifread

... libraries are installed to ~/.local/lib/python-ver/ and the bins are placed in ~/.local/bin/.

Add ~/.local/bin to user's $PATH.


If SSH session is frozen ... Use the key-combo Enter, Shift + `, . [Enter, Tilde, Period] to drop the connection.


Microphone problem on Thinkpad x230 running Ubuntu 16.04 ... No sound input and mic not detected.

[ Fix! ] Get capture device ...

$ arecord -l
card 0: ... device 0: ...

... and edit /etc/pulse/ with load-module module-alsa-source device=hw:0,0.

Kill and respawn pulseaudio ...

$ pulseaudio -k


Restart network service on Ubuntu ... Sometimes after wake-from-suspend the network connection is down and network-manager's wifi ap list fails to refresh.

[ Fix! ] Simple systemd way ...

$ sudo systemctl restart NetworkManager.service

If that doesn't work ... Try using nmcli to stop and start network-manager directly ...

$ sudo nmcli networking off
$ sudo nmcli networking on

Old-fashioned SysV init script method still works on 16.04 ...

$ sudo /etc/init.d/networking restart
    ... or ...
$ sudo /etc/init.d/network-manager restart

Last resort ...

$ sudo ifdown -a  # -a brings down all interfaces
$ sudo ifup -a


Attaching to a wifi network with nmcli (network-manager cli client) ...

$ nmcli radio
$ nmcli device
$ nmcli device wifi rescan
$ nmcli device wifi connect SSID-Name password PASS


Disable Pelican from auto-generating archives.html by adding to ...


From URL Settings: "If you do not want one or more of the default pages to be created ... set the corresponding *_SAVE_AS setting to '' to prevent the relevant page from being generated."