Switching to LibreSSL

In make.conf, have:

1
DEFAULT_VERSIONS+= ssl=libressl

Then, as root:

1
2
# portmaster -o security/libressl security/openssl
# portmaster -r libressl

You may need to manually update all packages that depend on
any of the libraries provided by LibreSSL (libssl, libcrypto and
libtls) since the versions of these libraries have changed. Normally,
you can obtain the list of dependent software by running the following
command:

1
# pkg info -r libressl

Then you should rebuild all ports depending on libressl to avoid dangling
shared library dependencies. Poudriere and pkg handle this correctly,
but portmaster requires the following to rebuild all
dependent ports.

1
# portmaster -r libressl

Fixing broken port dependencies based on missing files

So I cunningly removed ‘orphaned packages’ in an effort to reclaim much needed space on my system root, only to find that a certain daemon (CouchPotato) failed to run. There could have other consequences of this ‘mindless sweep’, but I had yet to encounter those.

To remedy this, I did:

1
# pkg check -d
  • to list missing dependencies (if any) by file-path.

Then,

1
# find /usr/ports -name pkg-plist -depth 3 -exec grep <name_of_missing_file> {} \+
  • revealing the primary port affected by missing dependencies. It was only then a matter of rebuilding both the primary port and its dependencies with:
1
# portmaster -fR <primary port>

Set Firefox GTK2 Theme

A quick tip to set a default gtk2 theme for firefox menus/radios/buttons (for improved readability)

Edit ~/.local/share/applications/firefox.desktop to have the following lines where required:

1
2
3
4
5
6
...
Exec=env GTK_THEME=mist firefox %u
Exec=env GTK_THEME=mist firefox -new-tab about:newtab
Exec=env GTK_THEME=mist firefox -new-window
Exec=env GTK_THEME=mist firefox -private-window
...

Fixed Search in Hexo

I have been struggling to get search to work on my hexo-generated blog.

I initially thought it was due to a poorly implemented theme, but as jamiehumphries correctly suggests, Hexo’s core required a fix.

This very simple fix was discussed here, and the following diff illustrates the change needed:

The diff can be applied to form.js at (on FreeBSD global installation) /usr/local/lib/node_modules/hexo/lib/plugins/helper

Also, see here for further necessary patches.

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