Skip to content

Instantly share code, notes, and snippets.

View ericcholis's full-sized avatar

Eric Cholis ericcholis

View GitHub Profile
@ericcholis
ericcholis / random-string
Created April 16, 2014 13:19
Random String Generator
#!/usr/bin/env bash
usage()
{
cat << EOF
usage: random-string
This script run the test1 or test2 over a machine.
OPTIONS:
@ericcholis
ericcholis / mov2gif
Last active August 29, 2015 14:17 — forked from artursapek/mov2gif
#!/bin/bash
# mov2giv in out width
# mov2gif video_file_in.mov gif_file_out.gif 300
tmp_dir=/tmp/frames_$(date +%s)
mkdir $tmp_dir
if [ -z "$3" ]
then
size=600
@ericcholis
ericcholis / random-string
Created April 14, 2015 12:16
Random String Generator
#!/usr/bin/env bash
usage()
{
cat << EOF
usage: random-string
This script run the test1 or test2 over a machine.
OPTIONS:
@ericcholis
ericcholis / currency
Created April 14, 2015 12:17
Currency Conversion
#!/usr/bin/env bash
curl "http://www.xe.com/wap/2co/convert.cgi?Amount=$1&From=$2&To=$3" -A "Mozilla" -s | sed -n "s/.*>\(.*\) $3<.*/\1/p";
@ericcholis
ericcholis / node.sh
Created November 9, 2011 14:06
Ubuntu Node.js Install
#!/bin/sh
##############################################################
#
# Author: Ruslan Khissamov, email: rrkhissamov@gmail.com
# Taken from http://apptob.org/, use that url to customize to your needs
##############################################################
# Add MongoDB Package
echo 'Add MongoDB Package'
echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" >> /etc/apt/sources.list
@ericcholis
ericcholis / nginx_apt_modules.sh
Last active October 6, 2015 19:09
Install Mainline Nginx and add modules
readonly RELEASE=$(lsb_release -cs)
wget http://nginx.org/keys/nginx_signing.key
sudo apt-key add nginx_signing.key
echo "deb http://nginx.org/packages/mainline/ubuntu/ $RELEASE nginx" >> /etc/apt/sources.list.d/nginx.list
echo "deb-src http://nginx.org/packages/mainline/ubuntu/ $RELEASE nginx" >> /etc/apt/sources.list.d/nginx.list
apt-get update
@ericcholis
ericcholis / gist:3794892
Created September 27, 2012 16:15
Long Select List
<select name="country" style="display: none; ">
<option value="AD">Andorra</option>
<option value="AE">United Arab Emirates</option>
<option value="AF">Afghanistan</option>
<option value="AG">Antigua and Barbuda</option>
<option value="AI">Anguilla</option>
<option value="AL">Albania</option>
<option value="AM">Armenia</option>
<option value="AO">Angola</option>
<option value="AQ">Antarctica</option>
@ericcholis
ericcholis / reveal_ajax.js
Created October 23, 2012 12:01 — forked from jeduan/reveal_ajax.js
Use Zurb reveal with ajax
$('a.reveal').click(function(event) {
event.preventDefault();
var $div = $('<div>').addClass('reveal-modal').appendTo('body'),
$this = $(this);
$.get($this.attr('href'), function(data) {
return $div.empty().html(data).append('<a class="close-reveal-modal">&#215;</a>').reveal();
});
});
#!/bin/sh
# http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html
palette="/tmp/palette.png"
filters="fps=15,scale=460:-1:flags=lanczos"
ffmpeg -v warning -i $1 -vf "$filters,palettegen" -y $palette
ffmpeg -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $2
import os, sys
import datetime
import base64
import cloudservers
import cloudlb
import urllib2
#import paramiko
from time import sleep