Category Archives: How-to

How To Install Advanced Launcher Add-On For Kodi (XBMC)

UPDATE: 2016-01-05 Advanced Launcher has been discontinued by its author and all links to its repository have been deleted. I am investigating alternatives and will post again once I have an answer. Until then, please check the comments section for further information.

Advanced Launcher is an add-on for Kodi that is used to launch external applications such as Firefox or Steam in any operating system. Launcher parameters are customisable so a particular instance can launch a specific website, game, or media file. In short, if it can be defined in a command-line interface, it can be done through Advanced Launcher.

Unfortunately, such awesome power is not available to Kodi users by default. To install Advanced Launcher, you will have to add the Angelscry repository to Kodi’s source list. To access the source list, navigate to the “Files Manager” under the “System” menu.

Screen Shot 2015-04-26 at 10.07.37 PM

Choose “Add Source” and type http://www.gwenael.org/Repository as the path. Name the source “Angelscry Repository” and click “OK”.

Screen Shot 2015-04-26 at 10.12.38 PM

From the Settings>Add-ons Menu, choose “Install from zip file”. When the browser appears, select “Angelscry Repository” from the list and wait for it to connect to the server.

Select “repository.angelscry.xbmc-plugins” from the list and choose the latest version of the repository to install. Back out to the Add-ons menu and now choose “Get Add-ons”. Select the newly-available Angelscry Repository, then “Program Add-ons”, and finally “Advanced Launcher”. The add-on will now be available from the “Programs” menu on the home screen.

Creating a standalone launcher (for a single executable like Firefox) is a simple process of browsing to the executable for the application (or just entering the command in Linux), defining the command-line parameters, and providing a (optional) thumbnail. The add-on walks you through the process and you will be able to set these launchers as favourites or (in the case of the Aeon MQ5 skin) home menu items.

How To Verify HDMI Audio Out In Ubuntu Linux (And Its Derivatives)

Assuming you have installed your graphics card drivers correctly, you will still want to quickly verify your HDMI audio out is working before any further mucking about in the operating system environment. In Ubuntu 14.04, this is done quite simply from the menu bar.

Click the sound icon in the upper-right corner, then in the context menu that appears, click on “Sound Settings”

Screen Shot 2015-04-03 at 11.02.11 PM

In the Sound Settings dialog box, verify that your sound card is activated and click the “Test Sound” button.

Screen Shot 2015-04-03 at 11.02.32 PM

Click the test button for each channel and verify the output.

Screen Shot 2015-04-03 at 11.02.38 PM

Other derivatives of Ubuntu (particularly the lightweight Lubuntu) do not have the robust GUI that Ubuntu features. In these cases, a little terminal jiggery-pokery will be necessary.

Verify the HDMI audio output with this terminal command:

aplay -D plughw:0,3 /usr/share/sounds/alsa/Front_Center.wav

Use Nano (or another inline text editor) to add the following line to /etc/asound.conf AND/OR ~/.asoundrc (depending on what your distro uses)

pcm.!default = pcm.hdmi

Reboot, and you should be up and running with full HDMI stereo sound!

Cross-cut Paper Shredder Teardown and Repair

I managed to completely jam my paper shredder during a bout of document disposal last summer. An old credit report managed to wrap itself around the blade drum and would not back out, so I had to either buy a new shredder or tear this one apart and fix it!

Be sure to like, share, comment, and subscribe! Tally-ho, y’all!

How To Install Intel Graphics Drivers in Ubuntu Linux

The motherboard that I picked up for the VCR project provides out-of-the-box full-resolution HDMI video under Linux, but requires an additional proprietary Intel graphics driver to process audio through the HDMI port. Thankfully, this is not a terribly difficult process thanks to the fine folks at Intel providing an easy graphical installer package.

Head over to https://01.org/linuxgraphics/ and download the .deb package for Ubuntu.

Use your preferred package manager to install the .deb package, then run the installed package.

Follow the on-screen instructions to install the drivers.

How To Optimize Your WordPress Website

I’ve been on a bit of a cleaning kick the past few days–probably because the new year is always a good excuse to declutter as much as possible. As such, I have taken to cleaning up and optimizing my website here. I’ll be fixing a few things as the year progresses, piecemeal as always. I’ll be cleaning up broken links as much as possible, removing posts that aren’t relevant anymore, and generally working to optimize WordPress as much as I can.

To start to optimize WordPress, I would start with deleting any database tables left behind from plugins that you have since uninstalled. There is a great plugin that will take care of most of the heavy lifting for you in this regard: Plugins Garbage Collector.

Once installed and activated, you’ll find the plugin under the “Tools” menu on the WordPress admin panel. Make sure the “Search none-WP tables” radio button is selected, then click “Scan Database”.

optimize wordpress with plugins garbage collector

The plugin will present a list of all the non-Wordpress database tables, but do exercise caution here. You absolutely should back up your database before proceeding. Check the box by each of the tables you don’t need and click the delete button.

Now that all the unnecessary database tables are cleared up, the next step to optimize WordPress is cleaning up all the ancillary junk that gets bogged down in your website–orphaned metadata, automatic drafts of posts, etc. The WP-Optimize plugin scans the most common sources of junk files in your website and deletes them, speeding up caching, prefetching, and other behind-the-scenes functions that make a WordPress site run smoothly.

Lastly, I need to clean up the unused images that I’ve uploaded. Not only do I have images scattered about that I have not used for any articles, but WordPress make four copies of each image for use in various areas! For this, I’m going to use DNUI (Delete Not Used Images) to scan my site and remove all the unused files. This isn’t so much an optimization, but a way to recover a significant amount of space on my server.

DNUI also lives in the Tools menu on the WordPress admin panel, so you should see it conveniently located next to the Garbage Collector. The first thing to do is click the “Options” tab, then click to create a backup folder and enable backups–just in case. (Un)Check any other options you wish, and click the “Images” tab to run the scan. The plugin will list any unused image files it finds in your library. All you have to do is click to delete them. A word of caution here: DNUI will list images from draft posts as “not used”, so please verify the images before deleting them.

For the interim, until I get all my drafts fleshed-out and posted, I’ll stick to manually deleting unused images. To do this, click the “Library” link under the “Media” menu on the WordPress admin panel. In the drop-down menu where it says “All media items”, click “Unattached” to show all the images that aren’t attached to a post. This is also not foolproof as it will list featured images and header images that are not already attached to a post, so err on the side of caution here. My suggestion would be to make a post with all your featured and header images, then set it to private.

That’s really all there is to easily optimize WordPress! Run these steps every few months and you’ll have a faster, more efficient website!

How To Automatically Add YouTube Subscriptions To A Playlist

Remember when YouTube used to have a built-in playlist that automatically grouped all your subscriptions’ new videos in one convenient place, allowing you to hit play once and watch all the new content as it was published? Yeah, those were the days…. Now we have a company that seems to be in an adversarial relationship with not only its casual users, but also some of its biggest content creators–a company that seems to want to remove useful options in the name of “progress” (as seems to be a consistent refrain from Menlo Park to Cupertino). Apparently, though, I am not alone for there is a lot of chatter about how to automatically add YouTube subscriptions to a playlist. It seems to be a feature that the users miss, but–thankfully–there are a few civic-minded hackers out there that put a little Google Fu to good use.

Benjamin Worrel found the beginnings of an answer while trawling Reddit for any insights on the problem (I originally found the same post he references in his write-up) in the form of a rudimentary Google Apps script that he then took and improved upon. The idea is that the script scrapes your Gmail inbox for notifications of new videos from your subscriptions, then adds the video to a specific playlist on YouTube (but not the sacred “Watch Later” list, YouTube doesn’t allow you to play with that one!).

To use the script, download a copy (link on this page) to your Google Drive, then follow the instructions in the commented lines of your copy of the script. Start by ensuring that Google Advanced Services is enabled for your account by clicking on the “Resources” menu and selecting “Google Advanced Services”. In the window that pops up, click the toggle next to “YouTube Data API” and make sure it’s on. Then click the “Google Developer’s Console” link to open the API manager and enable the YouTube Data API as there as well. You may now close the Developer’s Console tab as well as the Advanced Services window.automatically add youtube subscriptions to a playlist

In a separate tab, create a new YouTube playlist, copy the ID from the URL (That’s the long string of characters at the end. You’ll see an example in the script’s comments), and paste it inside the pair of single quotes next to var targetPlaylistId.

Personally, I don’t use the “clear old videos” option, so I commented it out with a pair of forward slashes (//). I also don’t want live stream announcements (because I’m usually not around to watch them anyway), so I leave that as true. My subscriptions run the gamut of short to long, so I just comment out the time restrictions as well.

After playing around with the settings and results, I noticed that I was getting a lot of duplicates showing up in my playlist, so I tracked it down to the search query. Leave the line that reads emailQueries.push('from:"noreply@youtube.com" subject:"uploaded a video"');

while commenting out the one that reads

emailQueries.push('from:"noreply@youtube.com" subject:"new videos from"');.

This will help cut down on the duplicates. I also made filters that automatically deleted any emails that weren’t specifically notifying me of a uploaded video (such as live streams and “reminders to watch”) which has also drastically reduced the duplicates I get as well.

You’ll also likely want to keep a log just in case something breaks. In a new tab, open Google Drive and create a new spreadsheet. Copy the document ID from the URL (just like your playlist) and paste it between the single quotes next to var logsheetId.

One last bit of code to change: search for the commented line that reads “// mark the email read and archive it” and below that, change the command

threads[i].moveToArchive();

to

threads[i].moveToTrash();.

Finally, we’re ready to run the script. Click the “Run” menu, then select each of the items to run them once. You will need to grant the appropriate permissions as requested for the script to function correctly.  By default, the script will run, server-side, every hour, but that can be changed by adjusting the .everyhours() value inside the AddTrigger function. Of course, you also need to turn on notifications for all your subscriptions and make sure that you are emailed when new videos upload.

The script still has a few flaws in it, like not automatically removing watched videos and occasionally adding duplicate videos to the list, but it is so much easier to click an X to remove a few errant videos than it is to go through and click “Watch Later” on piles of backlogged Game Grumps and Channel Awesome videos!

For more information on this script and to get started by copying it to your Google Drive, please visit Benjamin Worrel’s website.

How To Customize Your Terminal Prompt

This is a bit of a goofy hack, but some of the options can be useful if you need a little more information on your terminal prompt. Basically, I’m using it to put a Space Invader as my command prompt.screen-shot-2016-11-07-at-10-02-38-pmThis technique is for OSX/MacOS, but it will likely work on various Linux distros as they share a common terminal shell implementation.

In Terminal, open the .bash_profile file using the nano text editor
sudo nano .bash_profile

Add a new line containing the following code:
PS1=" "

Inside the quotes, you could add nearly anything you want. There are a handful of official switches that generate specific outputs:

  • \d Current Date
  • \t Current Time
  • \h Host Name
  • # Command Number
  • \u User Name
  • \W Current Working Directory (/Folder)
  • \w Current Working Directory, Full Path (~/Desktop/Folder)

Now, if you want to drop a Space Invader inside the quotes, just add it (or any other emoji) from the Edit>Emoji & Symbols menu.