Skip to content

Instantly share code, notes, and snippets.

View bsdlp's full-sized avatar

jon bsdlp

View GitHub Profile
@bsdlp
bsdlp / gist:2335222
Created April 8, 2012 06:29
urt zoom script
// Zoom script
set do_zoom_on "ut_zoomin"
set do_zoom_off "ut_zoomreset"
bind MOUSE2 "+vstr do_zoom_on do_zoom_off"
@bsdlp
bsdlp / gist:2493236
Created April 25, 2012 20:47
datatables
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$('#example').dataTable( {
"bServerSide":false,
"bProcessing":true,
"sAjaxDataProp": "feed.entry",
"sAjaxSource": "https://spreadsheets.google.com/feeds/list/0AqTGLmDhGMFSdHYzUWhZaFdmdXZRLXdLWDBMVHk4c1E/od6/public/values?alt=json",
"aoColumns": [
{ "mDataProp": "gsx$name.$t" },
{ "mDataProp": "gsx$proficiency.$t" },
@bsdlp
bsdlp / imgurAlbumDownload.sh
Created May 28, 2012 00:36
A script for downloading entire imgur albums
#!/bin/bash
# Dependencies: fdupes
#
# This is a script I made to download all images in
# an imgur album. May need to be changed in the future.
# Example: ./imgurAlbumDownload.sh 3BBMp j6dac AZHdc
INPUT="$@"
REMOVEDUPES=true
@bsdlp
bsdlp / gist:5112954
Last active December 14, 2015 16:09
server {
listen 80;
server_name www.myserver.com myserver.com;
root /home/public_html/Prosper202;
index index.php index.html index.htm;
access_log /home/public_html/Prosper202/log/access.log;
error_log /home/public_html/Prosper202/log/error.log;
}
# application.py
app = Flask(__name__, instance_relative_config=True)
app.config.from_pyfile('application.cfg', silent=False)
@app.route('/')
def voltaire():
NUMSERVERS = len(MCSERVERS)
return render_template('index', SITE_TITLE=SITE_TITLE, MCSERVERS=MCSERVERS, NUMSERVERS=NUMSERVERS)
@bsdlp
bsdlp / anchor.conf
Created April 27, 2013 19:26
because anchor is weird
server {
listen 80;
server_name ;
root /srv/www/anchor;
index index.php index.html;
try_files $uri $uri/ /index.php;
autoindex off;
@bsdlp
bsdlp / gist:5964937
Created July 10, 2013 09:42
owncloud nginx config
server {
listen 80;
server_name cloud.sjchen.net;
return 301 https://$server_name$request_uri; # enforce https
}
server {
server_name cloud.sjchen.net;
root /srv/owncloud;
>>> huh = [x for x in huh if x != 0]
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 9, 10, 11, 11, 11, 12, 13, 13, 14, 14, 14, 15, 16, 16, 19, 50]
>>> numpy.percentile(huh,25)
1.0
>>> numpy.percentile(huh,50)
2.0
>>> numpy.percentile(huh,75)
5.0
>>> numpy.percentile(huh,100)
50
@bsdlp
bsdlp / gist:7199920
Last active December 26, 2015 19:09
======================================================================
ERROR: test_create_node_password_auth (libcloud.test.compute.test_linode.LinodeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/jchen/git/cloudapi/libcloud/libcloud/test/compute/test_linode.py", line 66, in test_create_node_password_auth
auth=NodeAuthPassword("test123"))
File "/Users/jchen/git/cloudapi/libcloud/libcloud/compute/drivers/linode.py", line 375, in create_node
nodes = self._to_nodes(data)
File "/Users/jchen/git/cloudapi/libcloud/libcloud/compute/drivers/linode.py", line 523, in _to_nodes
which = nodes[lid].public_ips if ip["ISPUBLIC"] == 1 else\
{
"ERRORARRAY": [
{
"ERRORCODE": 5,
"ERRORMESSAGE": "Object not found"
}
],
"DATA": {},
"ACTION": "domain.resource.list"
}