Skip to content

Instantly share code, notes, and snippets.

@oculushut
oculushut / unzip.py
Last active March 6, 2016 18:16
Example unzipping
print ("unzipping...")
import tarfile
#import os
#os.chdir("..")
tfile = tarfile.open("enron_mail_20150507.tgz", "r:gz")
tfile.extractall(".")
print ("unzipped!")
@oculushut
oculushut / downloadEnron.py
Last active April 10, 2023 23:43
Example for using Python to download file
##Python 2
#import urllib
#url = "https://www.cs.cmu.edu/~./enron/enron_mail_20150507.tgz"
#urllib.urlretrieve(url, filename="../enron_mail_20150507.tgz")
#print "download complete!"
##Python 3
import urllib.request
url = "https://www.cs.cmu.edu/~./enron/enron_mail_20150507.tgz"
print ("download start!")
@oculushut
oculushut / gist:1f2876ac2bd96aaf28d9
Created March 3, 2016 17:23
Opening up tomcat for Cross-Origin Resource Sharing
<!--Push this into the web.xml of the service you want to open up-->
<pre>
<filter>
<filter-name>CorsFilter</filter-name>
<filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
<init-param>
<param-name>cors.allowed.origins</param-name>
<param-value>*</param-value>
</init-param>
@oculushut
oculushut / gist:ad027c5c36a0cd134a2f
Created March 3, 2016 17:20
How to switch on the Web Server on Windows 7
http://webmasterjuice.com/how-to-activate-built-in-web-server-windows
// # Mocha Guide to Testing
// Objective is to explain describe(), it(), and before()/etc hooks
// 1. `describe()` is merely for grouping, which you can nest as deep
// 2. `it()` is a test case
// 3. `before()`, `beforeEach()`, `after()`, `afterEach()` are hooks to run
// before/after first/each it() or describe().
//
// Which means, `before()` is run before first it()/describe()
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@oculushut
oculushut / gist:8d84c42656ecdd79d2f2
Created May 2, 2015 20:30
Local RPM install example
sudo yum localinstall -y /vagrant/install\ files/vagrant_1.7.2_x86_64.rpm
@oculushut
oculushut / gist:2b0b387ba1c637f3f779
Created April 20, 2015 20:01
Firebox Room Template
<FireBoxRoom>
<Assets>
<AssetSound id="underwater" src="/assets/sounds/under.mp3"/>
<AssetObject id="server" src="/assets/models/server.obj" mtl="/assets/models/server.mtl" />
<AssetImage id="sky_left" src="/assets/textures/black_pixel.jpg"/>
<AssetImage id="sky_right" src="/assets/textures/black_pixel.jpg"/>
<AssetImage id="sky_front" src="/assets/textures/black_pixel.jpg"/>
<AssetImage id="sky_back" src="/assets/textures/black_pixel.jpg"/>
<AssetImage id="sky_up" src="/assets/textures/black_pixel.jpg"/>
<AssetImage id="sky_down" src="/assets/textures/black_pixel.jpg"/>
@oculushut
oculushut / gist:fec641be10309f4c20f6
Created April 15, 2015 21:43
Example Janus VR Output
========================
Janus VR Presence Server
========================
See server.log for activity information and config.js for configuration
Log level: info
Startup date/time: Wed Apr 15 2015 22:40:29 GMT+0100 (BST)
Socket Server listening on port: 5566
DEBUG: SESSION.LOGON -> {"userId":"ProudMinna333","version":"40.3","roomId":"e562b2e1339fc08d635d28481121857c"}
DEBUG: SESSION.SUBSCRIBE -> {"userId":"ProudMinna333","version":"40.3","roomId":"e562b2e1339fc08d635d28481121857c"}
DEBUG: SESSION.SUBSCRIBE -> {"roomId":"e562b2e1339fc08d635d28481121857c"}
@oculushut
oculushut / gist:61e62a5a8406b99e4d03
Last active August 29, 2015 14:19
Janus VR Server Notes

Server is a singleton. Server also has a list of the following that exist on this particular server:

  • A set of Sessions with users
  • A set of Rooms that users have visited - let's call these the "List of Rooms the Server is aware of"

Each user who logs on will create a their own session and this is added to the Server's set of Sessions. Each session keeps track of user specific information. This includes:

  • The Server that the user's session belongs to
  • A set of Rooms that the user has visited - let's call these the "List of Rooms the User is aware of"