Skip to content

Instantly share code, notes, and snippets.

@gbaman
gbaman / HowToOTGFast.md
Last active May 14, 2024 10:26
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way!

Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)

More details - http://blog.gbaman.info/?p=791

For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. If using a recent release of Jessie (Dec 2016 onwards), then create a new file simply called ssh in the SD card as well. By default SSH i

@scottshea
scottshea / CassandraInstall.md
Last active October 25, 2019 12:18
Cassandra Install Instructions

Cassandra Install on Digital Ocean

The systems

The 512 MB/1 CPU system is too small. The 1GB/1 CPU can technically run Cassandra but it is too small. You should likely start with 2GB/2 CPU systems but expect to upgrade.

Select them in the same region for right now.

I went with Ubuntu 14 and the commands here will presume that. The commands were done from the root account. This will also presume that you are doing a multi-node cluster (3 is

@vjk2005
vjk2005 / node-dropbox.js
Last active August 21, 2017 03:39
Simple HOW-TO tutorial on talking to Dropbox with Node.js
/*
Simple tutorial on talking to the Dropbox API using Node.js and MongoDB.
This is an educational exercise aimed to help you get up and running on localhost, but the production code,
though not that different from what's below, will make an extra effort to handle edge cases like if the user
denies us access to their Dropbox.
Code tested on Windows 8 (32-bit)
@prellele
prellele / gist:1825744
Created February 14, 2012 10:48
Using StartSSL Certs with Nginx-Webserver

NOTE: You can check, if your config here:
http://www.sslshopper.com/ssl-checker.html

Decrypt the private key using the password you entered when you created your key:
openssl rsa -in ssl.key -out /etc/nginx/conf/ssl.key

Protect your key from prying eyes:
chmod 600 /etc/nginx/conf/ssl.key

@fwielstra
fwielstra / api.js
Created June 14, 2011 14:46
An example NodeJS / Mongoose / Express application based on their respective tutorials
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');
@jamis
jamis / kruskals.rb
Created December 28, 2010 04:16
An implementation of Kruskal's algorithm for generating mazes.
# --------------------------------------------------------------------
# An implementation of Kruskal's algorithm for generating mazes.
# Fairly expensive, memory-wise, as it requires memory proportional
# to the size of the entire maze, and it's not the fastest of the
# algorithms (what with all the set and edge management is has to
# do). Also, the mazes it generates tend to have a lot of very short
# dead-ends, giving the maze a kind of "spiky" look.
# --------------------------------------------------------------------
# NOTE: the display routine used in this script requires a terminal
# that supports ANSI escape sequences. Windows users, sorry. :(
@jamis
jamis / recursive-backtracker.rb
Created December 24, 2010 22:41
Implementation of the recursive backtracking algorithm for maze generation
# Recursive backtracking algorithm for maze generation. Requires that
# the entire maze be stored in memory, but is quite fast, easy to
# learn and implement, and (with a few tweaks) gives fairly good mazes.
# Can also be customized in a variety of ways.
DIRS = (N, S, E, W = 1, 2, 4, 8)
DX = { E => 1, W => -1, N => 0, S => 0 }
DY = { E => 0, W => 0, N => -1, S => 1 }
OPPOSITE = { E => W, W => E, N => S, S => N }
@karmi
karmi / .gitignore
Created November 27, 2010 16:26
`tail -f` in Node.js and WebSockets
.DS_Store
*.log
tmp/
@coolaj86
coolaj86 / cors.js
Created October 29, 2010 08:37
CORS / XHR2 middleware for Node.js
/*
Here's some documentation on XMLHttpRequest Level 1 and 2 as per the
standard and as per implementation.
XHR
http://www.w3.org/TR/XMLHttpRequest/
http://developer.apple.com/internet/webcontent/xmlhttpreq.html
http://msdn.microsoft.com/en-us/library/ms535874%28VS.85%29.aspx
XHR2
@brysonian
brysonian / OSCSpaceNavigator.pde
Created April 22, 2009 22:50
[Processing] Simple example of connecting processing to a SpaceNavigator via OSCulator
/*
Simple example showing how to use the
SpaceNavigator <http://www.3dconnexion.com/3dmouse/spacenavigator.php>
with processing via OSC and OSCulator <http://www.osculator.net/>.
*/
import processing.opengl.*;
import oscP5.*;