Skip to content

Instantly share code, notes, and snippets.

--set static ip
DEVICE=eth0
HWADDR=00:0C:29:2D:08:6D
TYPE=Ethernet
UUID=551f9054-0ded-4ff0-a77a-387effe5924b
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=10.1.12.81
NETMASK=255.255.255.0
@wedtm
wedtm / run-mesos-cluster.sh
Created July 15, 2015 18:52
Simple Mesos Cluster
#! /usr/bin/env bash
HOST_IP_1="10.0.10.10"
HOST_IP_2="10.0.20.10"
HOST_IP_3="10.0.30.10"
###### DO NOT TOUCH BELOW HERE ########
SCRIPT=`basename "$0"`
@igaln
igaln / bytearray to rmagick to s3
Created April 19, 2011 16:37
saving a bitmap shot from Flash AS3 with RMagick to Sinatra to Heroku to Amazon s3
post "/newtest/:filename/:title" do
image = Magick::Image.from_blob(request.body.read).first
puts image.inspect
@title = params[:title]
@filename = params[:filename]
n = VideoThread.new
n.title = @title
n.created_at = Time.now
n.updated_at = Time.now
n.save
@solar
solar / haproxy.conf
Created November 6, 2012 15:33
install haproxy-dev with supervisord
# Configurations for haproxy
global
maxconn 4096
chroot /var/haproxy
user haproxy
group haproxy
log 127.0.0.1 local0 alert
heat_template_version: 2014-10-16
description: Deploy a CoreOS cluster
parameters:
count:
description: Number of CoreOS machines to deploy
type: number
default: 3
constraints:
@caglar10ur
caglar10ur / martini.go
Created December 1, 2013 06:00
martini with pprof
package main
import (
"github.com/codegangsta/martini"
"net/http/pprof"
)
func main() {
m := martini.Classic()
package main
import (
"os"
"fmt"
"code.google.com/p/go.crypto/ssh"
)
type password string
@rasmuseeg
rasmuseeg / Cryptography.cs
Last active August 30, 2016 14:28
Generic Cryptograpy in C#
using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;
namespace YourProject.Security
{
public static class Cryptography<E>
where E : Encoding, new()
{
@icub3d
icub3d / main.go
Last active October 11, 2016 14:59
An example of using doozer to keep track of your groupcache instances. If you want to run it yourself, you'll want to: go get github.com/golang/groupcache go get github.com/ha/doozer
package main
import (
"bufio"
"bytes"
"flag"
"fmt"
"github.com/golang/groupcache"
"github.com/ha/doozer"
"io"
@srid
srid / subcommand.go
Created October 24, 2012 22:52
golang simple subcommand parser
// A simple sub command parser based on the flag package
package subcommand
import (
"flag"
"fmt"
"os"
)
type subCommand interface {