In the following, replace example.net with your domain name. XXX.XXX.XXX.XXX is the IP of the reverse proxy.
example.net. 300 IN A XXX.XXX.XXX.XXX
# Echo server program | |
import socket | |
HOST = '' # Symbolic name meaning the local host | |
PORT = 9001 # Arbitrary non-privileged port | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
s.bind((HOST, PORT)) | |
s.listen(1) | |
print "listenning on %s , port = %d"%(HOST,PORT) | |
while 1: |
#!/bin/bash | |
if [ ! -e "$1" ]; then | |
echo "Error: Need a file to post" | |
echo "Usage: curl_post file_to_post.file" | |
exit 1 | |
fi | |
if [ -c "$1" ] | |
then |
@RequestMapping(value = "handle", method = RequestMethod.GET) | |
public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException{ | |
XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON); | |
SearchResponse searchResponse = buildRequest(request).execute().actionGet(); | |
builder.startObject(); |
#!/usr/bin/env bash | |
# | |
# Wrapper around gmvault binary that sets default options. | |
GMVAULT_DIR="$HOME/Dropbox/Applications/Utilities/gmvault-v1.7-beta/bin/" | |
DB_DIR="$HOME/Dropbox/.gmvault-db" | |
# Run in a sub-shell since we need to change directories: | |
( | |
cd $GMVAULT_DIR |
import numpy as np | |
def euler_rot(XYZ,phi,theta,psi): | |
'''Returns the points XYZ rotated by the given euler angles''' | |
ERot = np.array([[np.cos(theta)*np.cos(psi), | |
-np.cos(phi)*np.sin(psi) + np.sin(phi)*np.sin(theta)*np.cos(psi), | |
np.sin(phi)*np.sin(psi) + np.cos(phi)*np.sin(theta)*np.cos(psi)], | |
[np.cos(theta)*np.sin(psi), | |
np.cos(phi)*np.cos(psi) + np.sin(phi)*np.sin(theta)*np.sin(psi), |
################################################################################ | |
# showdata.py | |
# | |
# Display analog data from Arduino using Python (matplotlib) | |
# | |
# electronut.in | |
# | |
################################################################################ | |
import sys, serial |
Install Python
$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7
Symlinks...
from bs4 import BeautifulSoup,SoupStrainer | |
import re | |
import Queue | |
import threading | |
import requests | |
import urlparse | |
import time | |
import copy | |
import signal | |
import sys |
# | |
# "THE BEER-WARE LICENSE": | |
# <truemped at goggle.com> wrote this file. As long as you retain this notice you | |
# can do whatever you want with this stuff. If we meet some day, and you think | |
# this stuff is worth it, you can buy me a beer in return Daniel Truemper | |
# | |
import time | |
import zmq |