Add Reddit Share button to Hexo's Landscape theme

I have added a Reddit button to Hexo’s Landscape theme by re-using existing code for Pinterest’s share button (found by searching Landscape’s Github repo for references to Pinterest), with minor modifications specific to Reddit.

Additionally, I had to update font-awesome to its latest git version as version 4.2 does not provide a reddit icon.

The changes I made can be found in this Git commit

Automatically tweet new Hexo entry via IFTTT

In the absence of Wordpress’ Publicize, I have decided to use IFTTT in conjunction with Hexo Feed Generator, to automatically publicize my Hexo entries.

IFTTT, which stands for If This Then That , is a tool that automates tasks using triggers and actions. IFTTT connects two services, and then triggers an action on one service when you perform an action on the other service. It works with all of the major social networks, including Facebook, Twitter, Instagram, LinkedIn, Tumblr, and YouTube.

After connecting my twitter account, I chose to use a new rss feed entry as the ‘trigger’, and a new tweet as the ‘action’. My recipe can be found here.

Instructions for applications can be found by traversing the links provided.

Plex Home Theatre on Debian Wheezy

Plex Home Theatre on Wheezy requires packages from 2 additional repos, and a specific Ubuntu font package. The following instructions illustrate this:

  • Add repos:

sudo apt-get install curl

sudo curl http://shell.ninthgate.se/packages/shell-ninthgate-se-keyring.key | sudo apt-key add -

echo "deb http://www.deb-multimedia.org wheezy main non-free" | sudo tee -a /etc/apt/sources.list.d/deb-multimedia.list

echo "deb http://shell.ninthgate.se/packages/debian wheezy main" | sudo tee -a /etc/apt/sources.list.d/plex.list

sudo apt-get update

sudo apt-get install deb-multimedia-keyring
(press Y to confirm)

sudo apt-get update

sudo apt-get dist-upgrade

cd /tmp && { curl -O http://mirrors.kernel.org/ubuntu/pool/main/u/ubuntu-font-family-sources/ttf-ubuntu-font-family_0.80-0ubuntu2_all.deb ; cd -; }

sudo dpkg -i /tmp/ttf-ubuntu-font-family_0.80-0ubuntu2_all.deb

  • Install Plex Home Theatre

sudo apt-get install plexhometheater

Quick Git Hints (Work-In-Progress)

A compilation of Git commands I have found useful so far:

  • Merge multiple pushed commits, and push to remote

    For example, for 4 most recent commits:

    git rebase --interactive HEAD~4

    In interactive dialog, squash (merge) commits 2-4 - by replacing “pick” with “squash”

    Save session (e.g :wq in vi), and choose new commit message. Then:

    git push origin +master

  • Highlight word changes

    This only highlights the changed words, nicely inline. Try:

    git diff --word-diff

  • To quickly discard unstaged changes:

    git stash save --keep-index
    git stash drop

  • My ~/.gitconfig file - explanations can be found in individual commits to my github repo.

Configure Filebot for Opensubtitles.org in Windows

FileBot in Windows is a bit tricky to use when it comes to batch subtitle downloads.

In particular, OpenSubtitles.org prevents leeching by requiring login details to be passed to Filebot. This isn’t so straightforward in Windows with no gui configuration available.

We are required to use the console version of FileBot from the windows commandline

Firstly, get into the commandline:

<win-R> cmd

Then do:

cd C:\Program Files\FileBot

Your prompt should now show:

C:\Program Files\FileBot>

Then do:

filebot.exe -script fn:configure

Enter OpenSubtitles username: ******
Enter OpenSubtitles password: ******

Testing OpenSubtitles... OK
Done

Finally, with all movies in a network-mounted Y:\, for example, do:

filebot.exe -script fn:suball "Y:" --lang en -non-strict

My elaborate movie-format rename scheme follows:
{n.space('_')}_({y})_[{af.lower()}_{ac.lower()}_{(int)video.framerate.toFloat()}fps_{(video.bitrate.toFloat()/1000).round()}kbps_{vc.lower()}_{vf}]

  • yielding something like:
    12_Years_a_Slave_(2013)_[6ch_dts_23fps_4324kbps_x264_720p].mkv