Skip to content

Instantly share code, notes, and snippets.

View steveandroulakis's full-sized avatar

Steve Androulakis steveandroulakis

View GitHub Profile
@steveandroulakis
steveandroulakis / gist:3779591
Created September 25, 2012 02:16
CherryPy server script
import cherrypy
import subprocess
import os
git_cmd = "/usr/local/git/bin/git"
jekyll_cmd = "/opt/local/bin/jekyll"
swift_cmd = "/usr/local/bin/swift"
site_dir = "_site" #/Users/steve/Documents/git/tjdett/uberdojo-cms/
swift_container = "steve-dojo"
os_auth_url = "http://keystone.rc.nectar.org.au:5000/v2.0/"
Getting distribution for 'zc.recipe.egg'.
Got zc.recipe.egg 2.0.0a3.
Getting distribution for 'pyparsing'.
An error occurred when trying to install pyparsing 2.0.0. Look above this message for any errors that were output by easy_install.
STDERR: Traceback (most recent call last):
File "setup.py", line 2, in <module>
from setuptools import setup, find_packages
ImportError: No module named setuptools
Traceback (most recent call last):
File "<string>", line 1, in <module>
@steveandroulakis
steveandroulakis / python fuse-mountable dict
Created April 10, 2013 05:26
Proof of concept that produces a virtual FUSE-mountable file/directory structure from a python dictionary. Uses python-fuse.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Proof of concept that produces a virtual FUSE-mountable
# file/directory structure from a python dictionary
# By Steve Androulakis <http://github.com/steveandroulakis>
# Requires FUSE (linux: use package manager to install)
# Requires python-fuse pip install fuse-python
# USE:
# Mount: ./dict-fuse.py mnt -f
# Unmount: fusermount -u -z mnt
@steveandroulakis
steveandroulakis / gist:5820302
Last active December 18, 2015 17:39
Tag example
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../tag-it/js/tag-it.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/flick/jquery-ui.css">
<link href="../tag-it/css/jquery.tagit.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
$(document).ready(function() {
@steveandroulakis
steveandroulakis / sync-files-chart
Last active January 31, 2020 03:39
google charts sync data
<head>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript" src="http://vera183.its.monash.edu.au/static/js/lib/jquery-1.7.1.min.ddb84c158728.js"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var jsonData = $.ajax({
@steveandroulakis
steveandroulakis / windows process node.js
Last active December 23, 2015 23:29
run windows process in node.js
// pre-req, msconvert.exe in PATH smsdm.cpl
// terminal
var http = require('http');
// Configure our HTTP server to respond with Hello World to all requests.
var server = http.createServer(function (request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
@steveandroulakis
steveandroulakis / gist:6724482
Created September 27, 2013 05:20
run msconvert and get redis key for output (from form at /guid)
var express = require('express');
var app = express();
var redis = require("redis"),
db = redis.createClient();
var StringDecoder = require('string_decoder').StringDecoder;
function s4() {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
var express = require('express');
var app = express();
var redis = require("redis"),
db = redis.createClient();
var StringDecoder = require('string_decoder').StringDecoder;
function s4() {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
@steveandroulakis
steveandroulakis / mytardis api nodejs
Created October 1, 2013 01:12
mytardis api nodejs
var http = require('http');
var fs = require('fs');
var request = http.get("http://118.138.241.34/api/v1/dataset_file/3116/?format=json", function(response) {
var result = '';
response.on('data', function(data) {
result += data.toString();
})
@steveandroulakis
steveandroulakis / mytardis msconvert
Created October 1, 2013 03:37
takes tardis file, msconvert
var express = require('express');
var http = require('http');
var app = express();
var fs = require('fs');
var redis = require("redis"),
db = redis.createClient();
var StringDecoder = require('string_decoder').StringDecoder;
function s4() {
return Math.floor((1 + Math.random()) * 0x10000)