Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Installs the XCode command line tools if you don't have them
xcode-select --install
# Installs brew if you don't have it
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Makes your account the owner of /usr/local, which is preferred on single user Macs
sudo chown -R `whoami` /usr/local
# Installs all the dependencies for building libtorrent and rtorrent
brew install automake libtool boost curl lzlib libsigc++ openssl
# Uninstall libtorrent-rasterbar if you already have it
#!/bin/bash
# Installs the XCode command line tools if you don't have them
xcode-select --install
# Installs brew if you don't have it
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Makes your account the owner of /usr/local, which is preferred on single user Macs
sudo chown -R `whoami` /usr/local
# Installs all the dependencies for building libtorrent and rtorrent
brew install automake libtool boost curl lzlib libsigc++ openssl pkg-config xmlrpc-c
# Uninstall libtorrent-rasterbar if you already have it
@trx1138
trx1138 / sync_playlists_to_users.py
Created January 19, 2018 16:05 — forked from JonnyWong16/sync_playlists_to_users.py
Sync Plex playlists to shared users.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Description: Sync Plex playlists to shared users.
# Author: /u/SwiftPanda16
# Requires: plexapi, requests, xmltodict
import requests
import xmltodict
@trx1138
trx1138 / gist:bedb478d33d84cda81b1b730362dfa78
Created February 5, 2018 12:29 — forked from luckydev/gist:b2a6ebe793aeacf50ff15331fb3b519d
Increate max no of open files limit in Ubuntu 16.04 for Nginx
# maximum capability of system
user@ubuntu:~$ cat /proc/sys/fs/file-max
708444
# available limit
user@ubuntu:~$ ulimit -n
1024
# To increase the available limit to say 200000
user@ubuntu:~$ sudo vim /etc/sysctl.conf
@trx1138
trx1138 / mkv2srt-syno.sh
Created March 3, 2018 03:16
extract srt from mkv container with ffmpeg (for synology)
#!/bin/bash
# Extract subtitles from each MKV file in the given directory
# If no directory is given, work in local dir
if [ "$1" = "" ]; then
DIR="."
else
DIR="$1"
fi
@trx1138
trx1138 / mkv2srt.sh
Created March 3, 2018 03:17
extract srt from mkv container with mkvtoolnix
#!/bin/bash
# Extract subtitles from each MKV file in the given directory
# If no directory is given, work in local dir
if [ "$1" = "" ]; then
DIR="."
else
DIR="$1"
fi
"rules": [
{
"manipulators": [
{
"type": "basic",
"description": "Double tap L-Ctrl to launh iterm2 visor",
"from": {
"key_code": "left_control",
"modifiers": {
"optional": [
@trx1138
trx1138 / 256color.pl
Created June 27, 2018 16:01 — forked from hSATAC/256color.pl
256color.pl
#!/usr/bin/perl
# Author: Todd Larason <jtl@molehill.org>
# $XFree86: xc/programs/xterm/vttests/256colors2.pl,v 1.2 2002/03/26 01:46:43 dickey Exp $
# use the resources for colors 0-15 - usually more-or-less a
# reproduction of the standard ANSI colors, but possibly more
# pleasing shades
# colors 16-231 are a 6x6x6 color cube
for ($red = 0; $red < 6; $red++) {
@trx1138
trx1138 / print256colours.sh
Created June 27, 2018 16:02 — forked from HaleTom/print256colours.sh
Print a 256-colour test pattern in the terminal
#!/bin/bash
# Tom Hale, 2016. MIT Licence.
# Print out 256 colours, with each number printed in its corresponding colour
# See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163
set -eu # Fail on errors or undeclared variables
printable_colours=256
@trx1138
trx1138 / pihole_config.sh
Created August 28, 2019 18:58 — forked from ksylvan/pihole_config.sh
Pi-Hole Config for pi-hole in Docker container
#!/bin/bash
#
# After you start your Pi-Hole in a Docker container according
# to this: https://github.com/diginc/docker-pi-hole
#
# NOTE: On the Mac, I had to add "-h $(scutil --get LocalHostName)" to
# the "docker run" command. Otherwise, the Mac hostname was being reset
# to the random hostname generated for the container.
#
# Run this to replicate Will's setup here: