Monday, February 13, 2017

Xfce - How To Execute Shell Scripts from Thunar or the Desktop

There are a few shell scripts I like to launch directly from the desktop or from Thunar - however, as of Thunar 1.6.5, this option is not enabled by default.

To enable executing scripts directly from the desktop or Thunar, you'll need to change the hidden settings. This appears to only work on Thunar 1.6.6 or higher.

1. Open a terminal and run the following command:  

xfconf-query --channel thunar --property /misc-exec-shell-scripts-by-default --create --type bool --set true

You can review the available hidden settings here. To view your current Xfce and Thunar settings, there is a Settings Editor accessible from the desktop in most distributions (or just run xfce4-settings-editor from a terminal).

Tested on Xubuntu 16.04.1(Thunar 1.6.10) - your mileage may vary.

iOS 10 - iPad Lock Button and/or Auto-Lock Not Working Fix

It appears that a recent iOS 10 update has caused an issue where some users cannot lock iPad devices. I first noticed the issue when closing my smart cover would not lock the iPad. Initially I blamed the smart cover (it was new), however, when I could not lock the device using the lock button it was apparent it is a software issue.

Before doing the steps below you can ensure locking is enabled by reviewing the settings at Settings -> Display & Brightness -> Auto-Lock, and Lock / Unlock. If these settings are enabled and locking is not working, try the steps below.


1. Go to Settings -> Touch ID & Passcode (you will be prompted to enter your passcode).

2. Select Turn Passcode Off.

3. Restart your Device (hold the lock button until the option to power off appears, once iPad is off, hold lock button until Apple logo appears on screen).

4. Go to Settings -> Touch ID & Passcode.

5. Select Turn Passcode On. You will be prompted about deleting saved fingerprints - DO NOT delete your fingerprints as it is not necessary.

6. Test Lock Button and Auto-Lock to ensure it works!

Tested on iPad Pro running iOS 10.2.1 - your mileage may vary!

Sunday, February 28, 2016

Fixing encrypted swap partition in Ubuntu 14.04

Having the message "the disk drive for /dev/mapper/cryptswap1 is not ready yet or present" error on your splash screen when booting? Swap partition not working despite having set it up when installing Ubuntu / Linux Mint?

There is an Ubuntu 14.04 bug in which the encrypted swap partition does not work if you chose to encrypt your disk or home directory when installing. All credit to the smart people that figured this out.

Fix is here, your mileage may vary:

1. sudo swapoff -a

2. Comment line(s) in /etc/crypttab , e.g. #cryptswap1 /dev/sda2 /dev/urandom swap,cipher=aes-cbc-essiv:sha256

3. Reboot.

4. sudo mkswap /dev/sdXX (where XX is your intended swap partition) and copy the UUID that is produced.

5. Edit (or create) /etc/initramfs-tools/conf.d/resume and add line:
RESUME=UUID=the uuid from step 4 

6. Run the following:
sudo update-initramfs -u
sudo swapon /dev/sdXX
sudo ecryptfs-setup-swap

7. Edit /etc/crypttab (there should be a new line added below the line you commented in step #2) to change the UUID to /dev/sdXX, and add "noauto" and "offset=8".

For example:

cryptswap1 /dev/sda2 /dev/urandom swap,noauto,offset=8,cipher=aes-cbc-essiv:sha256

8. Edit /etc/fstab and add "noauto" to swap partition line, for example:

/dev/mapper/cryptswap1 none swap noauto,sw 0 0

9. Edit (or create) /etc/init/cryptswap1.conf with:

start on started mountall
script
      /sbin/cryptdisks_start cryptswap1
      /sbin/swapon /dev/mapper/cryptswap1
end script

10. Reboot. Test if swap is working with swapon -s or free -h. If you're still getting the "not ready or not present" message noted above when booting, despite the fact that your swap is working upon the boot completing, edit /etc/rc.local and add the following lines above "exit 0":

sleep 5
swapon /dev/mapper/cryptswap1