Skip to content

Instantly share code, notes, and snippets.

View mindscratch's full-sized avatar

Craig Wickesser mindscratch

View GitHub Profile
@mindscratch
mindscratch / notes.md
Last active October 25, 2016 11:11
Setup server for VNC & VPN

Setting up a CentOS 7 server to run a VNC server and connect to a VPN.

The basic steps:

  • install and start vnc server
  • install openconnect
  • connect to vpn
  • create ssh tunnel from desktop to server
  • use vnc viewer to connect to vnc server

Setup VNC Server

@mindscratch
mindscratch / openconnect.md
Created November 13, 2015 21:37 — forked from moklett/openconnect.md
OpenConnect VPN on Mac OS X

Unfortunately, the Cisco AnyConnect client for Mac conflicts with Pow. And by "conflicts", I mean it causes a grey-screen-of-death kernel panic anytime you connect to the VPN and Pow is installed.

As an alternative, there is OpenConnect, a command-line client for Cisco's AnyConnect SSL VPN.

Here's how to get it set up on Mac OS X:

  1. OpenConnect can be installed via homebrew:

     brew update
    

brew install openconnect

@mindscratch
mindscratch / test.go
Created July 20, 2015 11:36
test code that uses julienschmidt/httprouter
import "github.com/julienschmidt/httprouter"
import "net/http"
func doRequest(method, uri string, body *bytes.Buffer, handle httprouter.Handle) (*httptest.ResponseRecorder, error) {
resp := httptest.NewRecorder()
req, err := http.NewRequest(method, uri, body)
if err != nil {
return nil, err
}
@mindscratch
mindscratch / foo_test.go
Last active August 29, 2015 14:16
golang integration test
package main
import "testing"
import "time"
import "fmt"
func TestBar(t *testing.T) {
fmt.Println("FOO sleeping")
time.Sleep(time.Second)
fmt.Println("FOO done")
@mindscratch
mindscratch / aurora.md
Last active May 19, 2017 15:35
Build Aurora 0.7.1-SNAPSHOT on CentOS 6.5

Build Aurora 0.7.1-SNAPSHOT on CentOS 6.5

I created a CentOS 6.5 Droplet on Digital Ocean with 8GB RAM (you'll need at least 4 for the Java portion of the build), feel free to use any other CentOS 6.5 environment that you can have root on.

Prepare the Environment

First, Mesos 0.21.0+ requires subversion 1.8+ devel package which is not available by default by yum. Add a repo that has subversion-devel 1.8 available, i.e:

Add new repo /etc/yum.repos.d/wandisco-svn.repo, with:

@mindscratch
mindscratch / chat.md
Last active August 29, 2015 14:12
kubernetes-rollingupdate-chat

mindscratch: now that some people are here, here's an earlier question: hen performing a rolling update (https://github.com/GoogleCloudPlatform/kubernet...) ...how does kubernetes know which image to update if a pod has multiple containers with different images 2:23 PM

jbeda: mindscratch: Right now, it is run client side and is kind of a little too simple. 2:24 PM It captures the list of pods and just kills them one by one. It assumes there is a replication controller that will 'heal' them with the new version 2:24 PM

jbeda: Ideally, the 'upgrader' would make sure that the new pods come up okay, do some health checking, etc.

@mindscratch
mindscratch / capture_stdout.go
Created December 29, 2014 16:41
capture stdout in golang
import (
"bytes"
"io"
"os"
)
// not thread safe
func captureStdout(f func()) string {
old := os.Stdout
r, w, _ := os.Pipe()
@mindscratch
mindscratch / bits.md
Last active August 29, 2015 14:11
optimizing nsq
package main
import (
"encoding/base64"
"net/http"
"strings"
)
type handler func(w http.ResponseWriter, r *http.Request)
@mindscratch
mindscratch / go.sh
Created November 27, 2014 02:28
Kubernetes on CentOS 6
docker run --rm -it centos:centos6 /bin/bash
yum install -y wget tar
wget https://github.com/GoogleCloudPlatform/kubernetes/releases/download/v0.5.4/kubernetes.tar.gz
wget https://github.com/coreos/etcd/releases/download/v0.4.6/etcd-v0.4.6-linux-amd64.tar.gz
# untar kubernetes and add binaries to path
tar -xf kubernetes.tar.gz
cd kubernetes/server
tar -xf kubernetes-server-linux-amd64.tar.gz
cd kubernetes/server/bin