Skip to content

Instantly share code, notes, and snippets.

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 from the command line
# License: ISC
clip() {
if command -v xclip &> /dev/null; then
xclip -selection clip <<< "$@"
elif command -v xsel &> /dev/null; then
xsel -b -i <<< "$@"
drakeguan /
Last active Jan 12, 2017 — forked from xdamman/
Bash script to install latest version of ffmpeg, x264 and libvpx on Ubuntu 14.04 server
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 14.04
# Copyright @ 2014 Shuen-Huei (Drake) Guan <>
# References:
# *
# *
# *
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 /
Created Jul 2, 2014
Install latest ffmpeg on ubuntu 12.04 or 14.04
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from
# 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 / 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 [].
* 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
#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 /
Created May 6, 2014
Execute a Python script from Python console
View Raspberry Pi L2TP VPN Setup

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 in the gist folder (so that
  3. Run 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 /
Last active Nov 26, 2017
Install FFmpeg, x264, aac
dpkg -l x264 fdk-aac libvpx libaacplus ffmpeg 2>/dev/null >/dev/null && echo "Packages are already installed" && exit
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 /
Created Apr 7, 2014
OpenWrt vnStat configuration
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