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

Saturday, February 27, 2016

Slackware Security Updates Desktop Notifier for xfce (sort of...)

How to (sort of) get slackware security update notifications on your xfce desktop:

1. Grab alienbob's excellent rsync_slackware_patches script, and place it in /usr/local/bin (or somewhere you prefer in your $PATH)

2. Add rsync_slackware_patches.sh to your crontab, e.g. :
10 17 * * * /usr/local/bin/rsync_slackware_patches.sh -q -r 14.1

3. Create a .forward file in /root, forwarding mail to whatever user you log in to your desktop with, e.g. user@localhost

4. Enable sendmail: chmod +x /etc/rc.d/rc.sendmail ; /etc/rc.d./rc.sendmail start

5. Install xfce4-mailwatch-plugin from slackbuilds.org

6. Add the mailwatch plugin to the desktop (right click panel, Add New Items, Mail Watcher)

7. Configure the mailwatch plugin to watch mail for yourusername@localhost (Add, Select Mailbox Type: local mbox spool, mailbox location is /var/mail/user)

When the rsync_slackware_patches cronjob runs, if any updates are found, cron will mail root. The mail will be forwarded to your desktop user account, and the mail watcher will indicate new mail. Run slackpkg update and slackpkg upgrade-all.

NOTES:

This is a hackish solution and it won't suit a lot of setups - especially if forwarding root mail isn't a viable option.

It won't notify you about updates for software installed with sbopkg or other third-party package managers. Still, it works well enough for a single-user desktop slackware install and is useful if you have a habit of not keeping a close eye on the slackware-security mailing list.

Don't leave sendmail open to the world - adjust your sendmail config and firewall accordingly.

This works for me, your mileage may vary. Tested on Slackware 14.1, 32-bit.


Thursday, January 29, 2015

Resolving 1080p playback errors on Raspberry Pi / Raspbmc / OpenELEC

If you're having issues with 1080p playback with raspbmc / OpenELEC - for me, it was garbled video or audio with no video - the issue most likely lies in the pi's boot configuration settings.

1. Check out your logs: ~/.kodi/temp/kodi.log   OR  ~/.xbmc/temp/xbmc.log

Try running tail -f yourlogfile and playing the file giving you the problem. If something like this appears:  

00:16:50 T:1257443248   ERROR: COMXCoreComponent::DecoderEventHandler OMX.broadcom.resize - OMX_ErrorInsufficientResources, insufficient resources 

You need to adjust the pi boot config.

2. Edit boot config, e.g. - sudo nano /boot/config.txt 

Change the value for gpu_mem_256 to 192. Any higher is probably going to cause other problems. If you have a B+ pi, change the value for gpu_mem_512 to a minimum of 192. It can probably be set higher safely, but 192 always worked fine for me. 

3. sudo shutdown -r now 

4. Retry playing your content! 

Friday, February 14, 2014

Editing the Places Menu Launcher in XFCE

If you recently upgraded to Linux Mint 16, you may have noticed that your Places menu no longer has links to the Videos, Documents, Downloads etc. folders.

To customize, simply create a file called .gtk-bookmarks in your home directory, with text such as the following:

file:///home/a/Documents Documents
file:///home/a/Videos Videos
file:///home/a/Downloads Downloads
file:///home/a/Pictures Pictures


You can create a shortcut to any destination.

Tested on Mint 16

EDIT March 2, 2016: Using Ubuntu 14.04 / Linux Mint 17+? Create a file called bookmarks in ~/.config/gtk-3.0 using the format noted above. If the directory doesn't exist, you can create it.

Simple PS3 Media Server Install Guide for Ubuntu

This guide is for users who wish to install the latest version of PS3 Media Server on an Ubuntu-based Linux distribution. As of this post, the current PS3 Media Server Ubuntu repository uses a custom-build of PS3 Media Server that is outdated and uses versions of video software such as ffmpeg which are deprecated. Additionally, installing from the repository with Ubuntu 13.10 (saucy-salamander) is not currently working.

Don't get me wrong, it works very well for most people  - however, some may wish to use the latest version. Here's how:

1. Download the latest version of PS3 Media Server.

2. Extract it to your desired install location (e.g. /home/user/PMS).

3. Install the required software packages (sudo apt-get install mencoder ffmpeg mplayer vlc dcraw)  (See note #2 regarding ffmpeg).

4. Install the required additional libraries libmediainfo0, mediainfo and libzen0. You can do this from the repositories but I strongly recommend grabbing the most recent versions from the MediaInfo site. If you install libmediainfo from the .deb provided at the MediaInfo site, it will automatically install libzen0 as well.

5. Run PMS.sh (either from the terminal or launching from file manager/user-created shortcut). Check the Logs tab to ensure that MediaInfo has correctly loaded (you should see something like "Loaded MediaInfoLib - v.0.7.67).

If all goes well, you should be using the latest version without issue.

NOTES:

1. If PMS fails to run altogether, you probably need to install java (sudo apt-get install default-jdk).

2. The version of ffmpeg currently in the Ubuntu repositories is deprecated and will very likely fail to work with PMS, returning errors in your PMS log. To install the latest version of ffmpeg, simply download the latest static build, extract, and copy the files (ffmpeg and ffprobe) to /usr/bin. If you wish, you can back up your current ffmpeg files from /usr/bin before doing so.

EDIT: Keep in mind that using this method will mean ffmpeg will not be "automatically updated" and you will need to repeat this step to keep ffmpeg current. This may or may not be desirable for your setup.

3. If you run PMS prior to installing libmediainfo and its associated libraries, you're gonna have a bad time. It caused terrible problems for MP4 playback on my PS3, with the PS3 convinced that the files were corrupted. A fix that seemed to work was to clear the cache and rescan the shared media folders, and then to quit and restart PMS.



Tested on Ubuntu 13.10 with PS3 Media Server 1.90.1

Saturday, January 18, 2014

How to Fix Windowless / Buttonless Windows in XFCE


If XFCE is not displaying window borders or buttons, give the following command a try:

sudo xfwm4 --replace

If this doesn't help, try this:

sudo rm -rf ~/.cache/sessions

Then restart xfce (or the system, if you prefer).

Tested on ubuntu 12.04.3

Fixing Slow Thunar in Ubuntu-based distros

If you are using XFCE on an ubuntu-based distro (e.g. Xubuntu, Linux Mint), the thunar file browser might take a very long time to load when first run. After the first run, it will probably perform normally.

To fix I found a solution online that was very simple:

Edit /usr/share/gvfs/mounts/network.mount and change the line AutoMount from true to false.

The flipside is that network drives (e.g. samba) will not auto mount. These can be accessed with the network:/// location in the left pane.

YMMV!

How to Mount and Recover an encrypted home folder in Ubuntu Linux

So you've broken your linux install and can't get at your /home folder because it's encrypted? All hope is not lost.

1. Boot an ubuntu 11.04 or higher LiveCD.

2. Open a terminal and figure out where the /home folder resides (this will most likely be /dev/sda1).

3. Mount the drive - sudo mount /dev/sda1 /mnt

4. Run sudo ecryptfs-recover-private. 

You will be prompted for your passphrase.

If all goes as planned, will provide you with a mount point (e.g. /tmp/ecryptfs.YttGfdzx)


If you wish to browse the /home directory, run your file manager as superuser from the terminal prompt - for example:

gksu thunar /tmp/ecryptfs.YttGfdzx
gksu nautilus  /tmp/ecryptfs.YttGfdzx

Saturday, February 9, 2013

How to Stop Geoclue on Ubuntu Linux (without losing the clock)

For some reason in Ubuntu 12.04 (and possibly 12.10), the tray clock package (indicator-datetime) for unity has geoclue as a dependency. In other words, if you want to ditch geoclue, you lose your clock.

Here's a workaround:

1. Add the following to your /etc/hosts file (sudo gedit /etc/hosts):

127.0.0.1       geoname-lookup.ubuntu.com
127.0.0.1       videosearch.ubuntu.com
127.0.0.1       daisy.ubuntu.com
127.0.0.1       one.ubuntu.com
127.0.0.1       musicsearch.ubuntu.com

2. Change the permissions of the geoclue libs to prevent it from executing:

sudo chmod ugo-x /usr/lib/geoclue/geoclue-master

3. Restart. No more pesky connections to Canonical servers.

Wednesday, January 2, 2013

PS3 Media Server - Firewall Setup for Ubuntu 12.04 / Linux

If you've installed PS3 Media Server in Ubuntu, and you're getting the message "No Renderers were Found" and a great big red "X" on the Status tab, give this a try. The most likely issue is your firewall is blocking your server from establishing a connection with your media playback device (e.g. your Playstation 3).

Steps:

1. Open a terminal (Ctrl-Alt-T)

2. Type the following command:
sudo ufw allow from <your_device's_ip> to any port 5001
This assumes you are using the default PS3 Media Server port of 5001. For example, if your PS3 uses the static IP 192.168.0.100, then do:
sudo ufw allow from 192.168.0.100 to any port 5001
If you aren't using static IPs on your devices but wish to open the server to any device connected to your router/subnet, you can specific a subnet mask, e.g. 192.168.0.1/24. If you're not using Ubuntu but are using iptables with your preferred linux distro, simply add an exception for port 5001, e.g.:
sudo iptables -A INPUT -s <your-device's-ip> -p tcp --dport 5001 -j ACCEPT
sudo iptables -A INPUT -s <your-device's-ip> -p udp  --dport 5001 -j ACCEPT
This ought to do the trick.

Wednesday, December 12, 2012

Ubuntu 12.04 - Hide the Recent Items in the Dash and Stop the Logging!

I really like Ubuntu 12.04. I even like the Unity Desktop (despite the general hatred it seems to attract amongst many users), it works really well on my netbook. However, Ubuntu has a lot of privacy issues, not the least of which is the integration of zeitgeist into Unity.

Here's what I did to get zeitgeist to stop logging. The "Privacy" app under System Settings never seemed to work properly, and clearing the history still left all sorts of information in the log files.

First, remove zeitgeist. I did this with synaptic. Don't remove the related libs, however, as Unity needs them. Restart the system.

Then, kill the running zeitgeist processes:

sudo killall -9 zeitgeist-fts zeitgeist-datahub zeitgeist-daemon
Then, remove the existing logs:

cd $HOME/.local/share/zeitgeist
rm activity*
You can use srm if you feel it is necessary. Restart the system.

Upon restart, Zeitgeist will recreate the log files, albeit they will be essentially empty. Now set them to read-only:

cd $HOME/.local/share/zeitgeist
sudo chmod ugo-w act*

Restart once more.

Once I did all this, the dash did not populate with recently used files, and the zeitgeist logs remained static. YMMV!

Monday, October 22, 2012

Configuring PS3 Media Server with Windows 7 Firewall

If you've installed PS3 Media Server, and you're getting the message "No Renderers were Found" and a great big red "X" on the Status tab, give the following a try. It worked for me.

(NOTE: These instructions are written for those using the Windows 7 Firewall. However, they should work for any other software-based firewall.)

1. Open Windows Firewall control (in Start Menu run box type "WF.msc")

2. You are going to create 2 new rules: 1 inbound and 1 outbound.

3. On the left side, select Inbound Rules. Then, on the right pane, you will see an option for a New Rule. Click it (see below).


4. In the New Inbound Rule Wizard (which should appear), do the following:

  • Choose Program and click Next
  •  Select This Program Path, and enter the path to javaw.exe on your PC (typically \Program files\x86\java\jre6\bin)

  •  Choose Allow the Connection, then Tick Private and Public.
Complete this process by naming the rule something notable (e.g. ! - PS3 Media Server). Repeat the process in Outbound Rules. Now restart PS3 Media Server. Provided everything else is in order, it should now work.

It is important to note that opening javaw.exe to inbound connections from any IP is a security risk. You may wish to limit the scope of these rules to your local subnet. You can do this by double-clicking on the rule, and selecting Scope. Here, you can limit the remote IPs that can connect to javaw.exe to your local subnet (or specific IP addresses, if you choose).

How to Convert FLAC or OGG to MP3 - The Easy Way

Downloaded some music, only to find it is in .FLAC format rather than mp3, and it won't transfer to your iPod or play on your favorite media player?

Here's an easy way to convert, without using converter programs of questionable origin (some of which, despite my best efforts, are probably turning up in my advertising on this blog...)

1. Download foobar2000 , a fabulous free (and more importantly, reputable) media player. Even if you choose not to use foobar2000 as your default media player, it's great to keep around and takes up very little storage.

2. Download the LAME mp3 encoder. Save wherever you like - I drop files like this in c:\utils. Unzip.

3. Install foobar2000.

4. Run foobar2000. Select File -> Preferences -> Advanced. On the right pane, you will see an option for Tools (see below)



5. Select Converter -> Additional Command Line encoder paths. Add the path where you saved LAME (for me, c:\utils). 

The above steps you will only need to do once. To save FLAC (or whatever format) to MP3, do the following:

1. Select File -> Add Files (or Add Folder, if you like)

2. Highlight the files in the foobar2000 main window, and right-click. Select Convert. Choose your options (I like 192kbps MP3).

3. Select Save Destination and convert!


Thursday, March 1, 2012

How to fix TVersity Error "Screenweaver MX was unable to LAUNCH one or more of its main windows"

If the TVersity interface will not load for you, giving the error "Screenweaver MX was unable to LAUNCH one or more of its main windows. The application must close", here's how most will be able to fix it.

This guide applies to Windows 7, Vista and XP.

Steps:

1. Open System Properties (Right-click Computer, select Properties OR type "sysdm.cpl" in the Run box)
2. Select Advanced System Settings
3. Click Advanced Tab
4. Under "Performance", click Settings button
5. Click Data Execution Prevention Tab
6. Select "Turn on DEP for all programs and services except those I select" (see image below)


7. Click Add, and browse to find TVersity.exe (default install location is C:\Program Files (x86)\TVersity\Media Server\web\admin\TVersity.exe).

You might need a restart for the change to take effect. 

If this issue started for you after installing EMET, you might need to do the following first:

1. Run EMET
2. Click Configure System button
3. Change DEP setting to "Application Opt Out" (see image below)



4. Restart, then complete the steps as detailed above.

Monday, October 3, 2011

How to Close Port 445 in Windows 7 / Vista

If you are cautious / paranoid about open ports in Windows, you may have noticed port 445 open.

To close it, log in as an administrator, and do the following:

1. In the run box, type "services.msc" and run the Services console

2. Scroll down to find the service "Server"

3. Right-click "Server" and select Properties

4. Stop the service, and then click the drag-down box in the center, and select Disable.

5. Restart the system.

Keep in mind that any services that depend on the Server service (e.g. Homegroups, print sharing) will fail. Consider creating a System Restore point prior to making the change.

Sunday, August 28, 2011

How to View Older Netflix Titles in Fullscreen - Remove the Black Bars

All content on Netflix is presented in its original aspect ratio, which for many titles, is 4:3. Unfortunately, most people view Netflix content on widescreen televisions, leading to black bars on the sides the image during playback.

Thursday, August 25, 2011

Netflix Router Optimization Guide - How to Improve Netflix Performance on Home Networks By Using Quality of Service (QoS)

Unable to Connect to Netflix? Netflix fails will drive you crazy. This guide will show you how to optimize Netflix performance on your home router, without crippling network performance for other connected devices.

Netflix is a bandwidth-intensive application. Most home networks contain a LOT of devices (PCs, gaming consoles, network-connected media players, iPhones, etc.), and this can cause major network congestion - causing Netflix stuttering, decreased image quality and disconnects.