Skip to content

Instantly share code, notes, and snippets.

@theUncanny
theUncanny / ppainstall.sh
Created May 14, 2016 19:02 — forked from rrevanth/ppainstall.sh
Elementary OS PPA script
#!/bin/bash
# Fixes sudo issues
if (($EUID != 0)); then
if [[ -t 1 ]]; then
sudo "$0" "$@"
else
exec 1>output_file
gksu "$0 $@"
fi
@theUncanny
theUncanny / bootstrap_for_encoding_server.sh
Created June 1, 2016 21:46 — forked from drakeguan/bootstrap_for_encoding_server.sh
Bash script to install latest version of ffmpeg, x264 and libvpx on Ubuntu 14.04 server
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 14.04
# Copyright @ 2014 Shuen-Huei (Drake) Guan <[email protected]>
# References:
# * https://gist.github.com/xdamman/e4f713c8cd1a389a5917
# * https://blog.dlasley.net/2013/05/install-ffmpeg-from-source/
# * http://fermat-little-theorem-blog.logdown.com/posts/203069-solved-when-building-gpac-suffer-usr-local-lib-libswscalea-error-adding-symbols-bad-value
@theUncanny
theUncanny / ffmpeg-updater.sh
Created June 1, 2016 21:46 — forked from maxwelleite/ffmpeg-updater.sh
Simple bash script to install the latest static version of FFmpeg (from http://ffmpeg.gusari.org/static/)
#!/bin/bash
# Author: Maxwel Leite
# Website: http://needforbits.tumblr.com/
# Description: Simple bash script to install the latest static version of FFmpeg (from http://ffmpeg.gusari.org/static/)
# Dependencies: wget
# Tested: Ubuntu Saucy
if [[ $EUID -ne 0 ]]; then
echo -e "You must be a root user!\nTry: sudo ./ffmpeg-update.sh" 2>&1
exit 1
@theUncanny
theUncanny / install_ffmpeg_ubuntu.sh
Created June 1, 2016 21:47 — forked from xdamman/install_ffmpeg_ubuntu.sh
Install latest ffmpeg on ubuntu 12.04 or 14.04
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update
@theUncanny
theUncanny / golang-cheat.md
Created July 16, 2016 09:39 — forked from ciaranarcher/golang-cheat.md
golang cheatsheet

Types

type Vertex struct {
    Lat, Long float64
}

Maps

@theUncanny
theUncanny / subtitles-renamer.sh
Created July 21, 2016 23:12 — forked from colinux/subtitles-renamer.sh
Rename subtitles files according to tv shows names found in a directory
#!/bin/bash
# Renames subtitles files according to tv shows names found in a directory
# Acceped syntaxes for season/episode are: 304, s3e04, s03e04, 3x04 (case insensitive)
#
# Usage:
# Put this gist somewhere in your $PATH, like /usr/local/bin/subtitles-renamer
# Chmod +x it
# cd ~/YourHolidaysTvShowsWithSubtitles
# subtitles-renamer
@theUncanny
theUncanny / install_ffmpeg.sh
Created November 8, 2016 14:19 — forked from smac89/install_ffmpeg.sh
Install latest version of ffmpeg on Ubuntu
#!/bin/bash
sudo apt-get update
sudo apt-get -y install autoconf automake build-essential libass-dev libfreetype6-dev \
libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev \
libxcb-xfixes0-dev pkg-config texinfo zlib1g-dev
# Create a dir where the rest of the sources will live
mkdir ~/ffmpeg_sources
@theUncanny
theUncanny / any2pandoc.sh
Last active June 4, 2019 19:38 — forked from dsanson/any2pandoc.sh
any2pandoc.sh: script that tries to convert documents thrown at it to pandoc's extended markdown
#!/bin/sh
# any2pandoc.sh
#
# A shell script that tries its best to convert documents thrown at it
# to pandoc's extended markdown.
#
# https://gist.github.com/1181510
#
# Depends on:
@theUncanny
theUncanny / pdf2xxx.md
Created November 15, 2016 15:58 — forked from rufuspollock/pdf2xxx.md
PDF 2 XXX. Tools, libraries and tutorials for converting PDFs to something more machine usable

Additions wanted - please just fork and add.

Tutorials

  • Parsing PDFs by Thomas Levine
  • [Get Started With Scraping – Extracting Simple Tables from PDF Documents][scoda-simple-tables]

Generic (PDF -> text)

@theUncanny
theUncanny / training_tesseract.sh
Last active November 22, 2016 21:20 — forked from christianroman/training.sh
Tesseract OCR training new font
#! /bin/bash
# build the environment
mkdir tessenv; cd tessenv
TROOT=`pwd`
mkdir $TROOT/stockfonts; mkdir $TROOT/build; mkdir $TROOT/build/eng
echo "Environment built"
# Get the stock english fonts from Google (old, but they work)
cd $TROOT/stockfonts
GET http://tesseract-ocr.googlecode.com/files/boxtiff-2.01.eng.tar.gz > boxtiff-2.01.eng.tar.gz