Skip to content

Instantly share code, notes, and snippets.

View figa12's full-sized avatar

Nicklas Andersen figa12

  • Aalborg, Denmark
View GitHub Profile
from argparse import ArgumentParser
#requires numpy, moviepy, and PIL libraries
from moviepy.editor import VideoFileClip
from numpy import zeros, array, uint8
from PIL import Image
import math
def frange(x, y, inc):
while x < y:
@figa12
figa12 / copydatabase.sh
Created June 6, 2014 11:25
This script will copy a database. It is much faster than doing a mysqldump and then inserting it to a new database, since it requires no downloading/uploading. It will also create a user called "testuser" that has all permissions on the new database. (testuser has the password: testuser). Remeber to set DBUSER, DBPASS, DBHOST, DB_OLD, and DB_NEW.
#!/bin/bash
DBUSER="username";
DBPASS="password";
DBHOST="localhost";
DB_OLD=database
DB_NEW=database_new
DBCONN="--host=${DBHOST} --user=${DBUSER} --password=${DBPASS}";
@figa12
figa12 / install-openvpn.sh
Last active August 29, 2015 14:06
Setup Script for Openvpn. A bit Bhost specific atm, if using another server provider just make sure that you have TUN/TAP interface enabled.
#!/bin/bash
#OpenVPN Installation Script for Ubuntu
yesno () {
while read line; do
case $line in
y|Y|Yes|YES|yes|yES|yEs|YeS|yeS) return 1
;;
n|N|No|NO|no|nO) return 0
;;
*)