Working Ninja
2018-03-04T07:53:22

Give your hand some relief from reaching for Ctrl and take advantage of the close proximity of Caps Lock.

# Note any previous values for xdb-options (most likely none)
gsettings get org.gnome.desktop.input-sources xkb-options

# Set our xkb-options (plus anything from our get, if needed)
gsettings set org.gnome.desktop ...

READ MORE

2015-10-12T20:20:36

Sometimes the remote is too far away to change the volume of music playing through the Raspberry Pi. Whilst at the terminal, alsamixer offers a great solution:

alsamixer

READ MORE

2015-10-13T07:38:08

This script will find (including subdirectories) and convert all m4a files to mp3.

find -name "*.m4a" -exec ~/m4atomp3 {} \;

m4atomp3:

#!/bin/bash
m4afile=$@
avconv -i "$m4afile" -ab 320k "${m4afile/.m4a/.mp3}"

Remember to chmod +x m4atomp3.

READ MORE

2015-10-25T21:28:09
# systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

Monitor will still go into power save mode.

READ MORE

2015-11-03T08:12:24

Not doing anything but your hard drive is screaming? iotop to the rescue.

iotop

In my case, updatedb.mlocate was the culprit.

READ MORE

2015-11-17T23:19:39
  1. Firmware not loading.
    dmesg | grep -i bluetooth
    
    bluetooth hci0: Direct firmware load for brcm/BCM20702A1-0b05-17cb.hcd failed with error -2
  2. Download Windows driver from ASUS.
    http://dlcdnet.asus.com/pub/ASUS/wireless/USB-BT400/UT_USB_BT400_6516000.zip
  3. Extract and open Win32\bcbtums-win7x86-brcm.inf
  4. Find Product Name (BT400).
    %AsusBT400.DeviceDesc%=RAMUSB17CB,          USB\VID_0B05&PID_17CB ...

READ MORE

2015-12-20T14:34:30
# apt-get install unattended-upgrades
# dpkg-reconfigure --priority=low unattended-upgrades

More at https://help.ubuntu.com/community/AutomaticSecurityUpdates

READ MORE

2015-12-30T20:50:04
if [ "$TERM" = "linux" ]; then
    echo -en "\e]P0232323" #black
    echo -en "\e]P82B2B2B" #darkgrey
    echo -en "\e]P1D75F5F" #darkred
    echo -en "\e]P9E33636" #red
    echo -en "\e]P287AF5F" #darkgreen
    echo -en "\e]PA98E34D" #green
    echo -en "\e]P3D7AF87" #brown
    echo -en "\e]PBFFD75F" #yellow
    echo -en "\e]P48787AF" #darkblue
    echo ...

READ MORE

2016-01-17T12:08:12

Use dmesg after plugging in your USB thumb drive to find the device name (/dev/sdb).

# umount /media/username/devicename
# dd bs=4M if=/path/to/filename.iso of=/dev/sdb

Note, do not output to a partition (e.g. /dev/sdb1). In the past this has created a loop ...

READ MORE

2016-03-10T17:26:15
2016-03-26T10:26:48

GitLab was throwing me a 500 server error this morning after an upgrade via yum. To troubleshoot, I ran the self diagnose command from terminal:

# gitlab-rake gitlab:check

Which gave me the following error to fix:

All migrations up? ... no
  Try fixing it:
  sudo -u git -H bundle exec rake ...

READ MORE

2016-03-31T22:34:52

I must have it saved somewhere but it was nowhere to be found. The password was lost. My root account was forever secure--or was it?

# service mariadb stop
# mysqld_safe --skip-grant-tables &
# mysql -u root
> USE mysql
> UPDATE user SET password=PASSWORD("mynewpassword") WHERE User='root';
> FLUSH PRIVILEGES ...

READ MORE

2016-04-06T20:07:45

Today I added a new server to PostgreSQL's host-based authentication file (pg_hba.conf) on a very active PostgreSQL server. Restarting the PostgreSQL service would have lead to service disruption across multiple services. Thankfully the folks at PostgreSQL are one-step ahead of me on this one. There is an option to ...

READ MORE

2016-04-06T20:13:12

Commands like SHOW DATABASES and SHOW TABLES are great but what if I need all the columns inside a table?

SELECT column_name FROM information_schema.columns WHERE table_schema = 'your_db' ORDER BY table_name, ordinal_position;

Source: http://stackoverflow.com/questions/5648420/get-all-columns-from-all-mysql-tables

READ MORE

2016-04-14T07:34:25

First, make sure we remove .svn folders and files from tracking by adding a new line ".svn/" to our .gitignore file.

Next, we will find all folders that are named .svn and for each folder found remove all files contained within it. Note the only difference between the ...

READ MORE

2016-05-01T11:09:13