Skip to content

Instantly share code, notes, and snippets.

@makefu
makefu / clbin
Last active Aug 29, 2015 — forked from GermainZ/clbin
updated clbin, supports images through pipe and images without extension
View clbin
#!/usr/bin/env bash
# Upload text/images to clbin.com from the command line
# License: ISC http://www.isc.org/downloads/software-support-policy/isc-license/
clip() {
if command -v xclip &> /dev/null; then
xclip -selection clip <<< "$@"
elif command -v xsel &> /dev/null; then
xsel -b -i <<< "$@"
fi
}
@drakeguan
drakeguan / bootstrap_for_encoding_server.sh
Last active Jan 12, 2017 — forked from xdamman/install_ffmpeg_ubuntu.sh
Bash script to install latest version of ffmpeg, x264 and libvpx on Ubuntu 14.04 server
View bootstrap_for_encoding_server.sh
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 14.04
# Copyright @ 2014 Shuen-Huei (Drake) Guan <drake.guan@gmail.com>
# 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
View get-teh-clip.sh
#!/bin/bash
echo "file name"
read name
#both the 'start' and 'end' variables should be time stamps of the format hh:mm:ss
echo "start of clip"
read start
echo "end of clip"
@xdamman
xdamman / install_ffmpeg_ubuntu.sh
Created Jul 2, 2014
Install latest ffmpeg on ubuntu 12.04 or 14.04
View install_ffmpeg_ubuntu.sh
#!/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
@chrisveness
chrisveness / base64.js
Last active Jan 17, 2021
Encode/decode ASCII string to/from base64
View base64.js
/**
* Encode string into Base64, as defined by RFC 4648 [http://tools.ietf.org/html/rfc4648].
* As per RFC 4648, no newlines are added.
*
* Characters in str must be within ISO-8859-1 with Unicode code point <= 256.
*
* Can be achieved JavaScript with btoa(), but this approach may be useful in other languages.
*
* @param {string} str ASCII/ISO-8859-1 string to be encoded as base-64.
* @returns {string} Base64-encoded string.
View containerhelper
#!/bin/bash
#This is free and unencumbered software released into the public domain.
#Because this script needs root to do some things, excessive amounts of
#checking have been done to terminate the script if anything fails.
#Read all instructions very carefully. When it asks to type "yes", it must be
#all uppercase or it will fail.
@stlehmann
stlehmann / exec_script.py
Created May 6, 2014
Execute a Python script from Python console
View exec_script.py
#Python2
execfile("./filename")
#Python3
exec(open("./filename").read())
View Raspberry Pi L2TP VPN Setup Scripts.md

Install raspbian, set up your users however you would like, so long as you have sudo access on the user you are running this with. You probably want to resize the image so it fills the SD card as well.

  1. Copy this entire gist to your raspberry pi
  2. Do chmod +x step1.sh step2.sh iptables.sh in the gist folder (so that
  3. Run step1.sh a) This script does a few things - it first updates your raspberry pi, then it installs a few needed utilities, then it upgrades the firmware on your raspberry pi
@cristianbica
cristianbica / install_ffmpeg.sh
Last active Nov 26, 2017
Install FFmpeg, x264, aac
View install_ffmpeg.sh
#!/bin/bash
dpkg -l x264 fdk-aac libvpx libaacplus ffmpeg 2>/dev/null >/dev/null && echo "Packages are already installed" && exit
#cleanup
cd
sudo rm -rf fdk-aac-0.1.0* ffmpeg* libaacplus-2.0.2* libvpx* x264*
sudo apt-get -y remove ffmpeg fdk-aac libaacplus x264 libav-tools libvpx-dev libx264-dev libvpx
sudo apt-get update
sudo apt-get -y install build-essential checkinstall git libfaac-dev libgpac-dev \
@ruzickap
ruzickap / openwrt_vnstat.sh
Created Apr 7, 2014
OpenWrt vnStat configuration
View openwrt_vnstat.sh
opkg install luci-app-vnstat vnstati
mkdir /etc/vnstat /www3/myadmin/vnstat
sed -i 's@^\(DatabaseDir\).*@\1 "/etc/vnstat"@' /etc/vnstat.conf
vnstat -u -i eth2
vnstat -u -i wlan0
vnstat -u -i br-lan
echo "*/5 * * * * vnstat -u" >> /etc/crontabs/root