Working Ninja

First, list the shares available from the server:

smbclient -L <server> -U <user>

Next, make sure cifs-utils is available (so we can pass in the credentials option):

sudo apt install cifs-utils

Finally, add the desired share to /etc/fstab:

//ip/share /mnt/point cifs vers=3,credentials=/path/to/credentials,noexec 0 0

The following example looks for the "idle" time before backlight brightness is reduced.

Find what you're looking for:

gsettings list-recursively | grep idle

Get the value:

gsettings get org.gnome.settings-daemon.plugins.power idle-brightness

Set the value:

gsettings set org.gnome.settings-daemon.plugins.power idle-brightness 120



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.input-sources xkb-options "['ctrl:nocaps']"

Now to retrain your brain ;)




Enable the "Start up automatically after a power failure" feature found within OS X without OS X installed.


  1. Find the LPC controller via lspci.
  2. Reference the LPC controller datasheet to find the register to update.
  3. Update the register with setpci.
  4. Test.
  5. Add the setpci command to crontab.

I'll be performing the following steps on a 2008 MacBook 4,1. Similar steps should be successful with other models.

1. Find the LPC controller via lscpi.

$ lspci | grep LPC
00:1f.0 ISA bridge: Intel Corporation 82801HM (ICH8M) LPC Interface Controller (rev 04)

Note the PCI address (00:1f.0) of our LPC Interface Controller. This will be referenced later with the setpci command.

2. Reference the LPC controller datasheet to find the register to update.

Searching the Internet for "82801HM datasheet" yields this datasheet from Intel. After opening the PDF, find the page for "AFTERG3_EN" via the Appendix A Register Bit Index (at the end of the PDF): GEN_PMCON_3—General PM Configuration 3 Register (PM—D31:F0)  

Offset Address: A4h
Default Value: 00h
Lockable: No
Attribute: R/W, R/WC
Size: 16-bit
Usage: ACPI, Legacy
Power Well: RTC

Bit: 0
Description: AFTERG3_EN — R/W. This bit determines what state to go to when power is re-applied after a power failure (G3 state). This bit is in the RTC well and is not cleared by any type of reset except writes to CF9h or RTCRST#.

0 = System will return to S0 state (boot) after power is re-applied.
1 = System will return to the S5 state (except if it was in S4, in which case it will return to S4). In the S5 state, the only enabled wake event is the Power Button or any enabled wake event that was preserved through the power failure. NOTE: Bit will be set when THRMTRIP#-based shutdown occurs.

From the above, we find that our register location is 0xA4 (A4h) with bit 0 (AFTERG3_EN) being the one that controls whether or not to power on the device after a power failure. Setting this bit to 0 will power on the machine.

3. Update the register with setpci.

Get the current value (should be 1):

$ sudo setpci -v -s 00:1f.0 0xa4.b

Set the bit to 0, per our datasheet:

$ sudo setpci -v -s 00:1f.0 0xa4.b=0

This is where I get lost. I do not see how we are setting just bit 0 to 0 with the above line. Searching online yields the same command for similar devices and different commands for others (who's manuals I cannot find online).

Verify that the bit is now set to 0:

$ sudo setpci -v -s 00:1f.0 0xa4.b

4. Test.

Shutdown the machine and disconnect the power supply.

5. Final Things

The AFTERG3_EN bit is reset to its default at reboot, so lets add the above command to our crontab (as root):

@reboot /usr/bin/setpci -s 00:1f.0 0xa4.b=0



Completely disable systemd power-saving modules:

sudo systemctl mask

Disable systemd lid switch (for laptops):

sed -i -e 's/HandleLidSwitch=suspend/HandleLidSwitch=ignore/' /etc/systemd/logind.conf

The above became necessary as systemd-logind was detecting that the lid was closed and calling The calls were numerous and consumed large amounts of CPU.

Sources: and


Before stumbling upon this module, whenever I connected to my audio receiver via Bluetooth, I had to change the Pulseaudio sink as well as set the default output. Thankfully there is an easy fix that will do both of these when a new sink is available.

Add the following to /etc/pulse/ Or better yet, if you haven't already, create a local config for Pulse audio at ~/.config/pulse/

.include /etc/pulse/
load-module module-switch-on-connect

Now if only I had stumbled upon this before attempting to write a custom udev rule!



Python 2.7 is not provided on CentOS 6 because Yum depends on Python 2.6. Simply installing 2.7 over 2.6 will break Yum. Thankfully, Red Hat provides us with an alternate installation method through their SCL project.

First, get Python 2.7 installed:

Next, add the project path to the top of the script:

import sys

Lastly, call the script via Cron:

cat /path/to/project/ | scl enable python27 python

Using IUS (Inline with Upstream Stable)--a nifty repository provided by EPEL--we can upgrade beyond PHP 5.4 by first removing our current version of PHP, installing our preferred version (5.6 in our case), and then restarting Apache:

$ sudo yum remove php-cli mod_php php-common

$ sudo yum install mod_php56u php56u-cli php56u-mysqlnd

$ sudo apachectl restart



Renewing an SSL but can't recall exactly how it was filled out last time? Try the following:

openssl req -text -in request.csr

The above command will decode the CSR file and output its contents in human readable text. Enjoy!

More here:


Sometimes it is necessary to resize partitions (e.g. updates to GitLab require additional space on /opt). Here's what we need to do. If you have an LVM parition, you're in luck! Things are pretty straightforward.

  1.   Run vgdisplay (Volume Group Display) to verify we have space to expand our partition.
    •     The line PE Free / Size should have space available.
  2.   Next, add space to the parition with lvresize (Logical Volume Resize):
    sudo lvresize --size +100M /dev/mapper/opt
  3.   Now that the volume has been expanded, let's commit those changes to the filesystem:
    sudo xfs_growfs /dev/mapper/opt