Skip to content

Instantly share code, notes, and snippets.

View auser's full-sized avatar

Ari auser

View GitHub Profile
@witoldsz
witoldsz / socket.js
Created April 12, 2014 11:25
Prototype of AngularJS service for socket.io v.0.9.x
(function(module) {
"use strict";
// THIS IS ALPHA VERSION, JUST A SNIPPET OF A PROTOTYPE
module.factory('socket', function($rootScope, $q, $browser) {
var self = {
_iosocket: io.connect(),
##Prepare the Server
apt-get update
apt-get upgrade
apt-get install build-essential
apt-get install zlib1g-dev
apt-get install uuid-dev
##Download, Build, make, make install - Ruby 1.9.2p0
@postmodern
postmodern / http_parser.rb
Created January 15, 2011 04:39
A pure Ruby HTTP parser using Parslet.
require 'parslet'
require 'pp'
class HTTPParser < Parslet::Parser
#
# Character Classes
#
rule(:digit) { match('[0-9]') }
rule(:digits) { digit.repeat(1) }
rule(:xdigit) { digit | match('[a-fA-F]') }
anonymous
anonymous / client.cracker
Created October 3, 2011 21:05
Client
=========
Two possibility to connect RTP.
1. SDP which can be put inside http server
$ cat client.sdp
v=0
o=- 1188340656180883 1 IN IP4 127.0.0.1
s=Session streamed by GStreamer
@jashmenn
jashmenn / install-tk-and-java.sh
Created October 14, 2011 20:07
install tokyocabinet & tk-java on Redhat without root
set -ex
export MYJAVAHOME=$JAVA_HOME
PREFIX=$HOME/usr
TMPDIR=$HOME/tmp
mkdir -p $TMPDIR
mkdir -p $PREFIX
pushd $TMPDIR
@macournoyer
macournoyer / .gitconfig
Last active September 30, 2015 23:18
Git shortcuts
[alias]
st = status
s = status
co = checkout
c = commit -v
ci = commit -a -v
b = branch
d = diff
p = pull
a = add -A .
@dysinger
dysinger / jenkins.sh
Created October 16, 2012 17:45
Chef/Jenkins Bootstrap
cd /var/tmp/knewton
# chef
wget -O- https://github.com/opscode-cookbooks/git/tarball/master | tar oxz
mv opscode-cookbooks-git-* cookbooks/git
chef-solo -c `pwd`/solo_generated.rb -j `pwd`/node-base.json -o recipe[git]
rm -rf cookbooks/git
git clone --depth=1 git://github.com/opscode-cookbooks/git.git cookbooks/git
git clone --depth=1 git://github.com/opscode-cookbooks/mercurial.git cookbooks/mercurial
git clone --depth=1 git://github.com/opscode-cookbooks/subversion.git cookbooks/subversion
git clone --depth=1 git://github.com/opscode-cookbooks/build-essential.git cookbooks/build-essential
@schof
schof / migrations.rb
Last active December 17, 2015 03:28
Basic logic for recurring subscriptions. NOTE: Uses older version of Spree so it needs some tweaks for Spree 2.0
class CreateSubscriptions < ActiveRecord::Migration
def self.up
create_table :subscriptions do |t|
t.date :start_date
t.date :end_date
t.integer :duration
t.string :interval
t.string :state
t.references :user
t.references :variant

These are notes for using the "Salt in 60 seconds" tutorial with DigitalOcean - http://www.saltstat.es/posts/quickstart.html

After creating a droplet via their web interface, login with you IP address and the password that is emailed to you.

export IP=your-ip
ssh root@$IP

Install saltstack

curl -L http://bootstrap.saltstack.org | sudo sh -s -- -M stable
package main
import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"net"