Skip to content

Instantly share code, notes, and snippets.

View hourback's full-sized avatar

Ali Jonathan Nabavi hourback

View GitHub Profile
@hourback
hourback / The instructions
Last active August 29, 2015 14:01
From the JUGGLING ASYNC lesson on http://nodeschool.io/#learn-you-node
LEARN YOU THE NODE.JS FOR MUCH WIN!
─────────────────────────────────────
JUGGLING ASYNC
Exercise 9 of 13
This problem is the same as the previous problem (HTTP COLLECT) in that you need to use http.get(). However, this time you will be provided with three URLs as the first three command-line arguments.
You must collect the complete content provided to you by each of the URLs and print it to the console (stdout). You don't need to print out the length, just the data as a String; one line per URL. The catch is that you must print them out in the same order as the URLs are provided to you as command-line arguments.
-------------------------------------------------------------------------------
@hourback
hourback / logstash.conf
Last active August 29, 2015 14:06
logstash.conf for pblittle/docker-logstash
input {
stdin {
type => "stdin-type"
}
file {
type => "syslog"
path => [ "/var/log/*.log", "/var/log/messages", "/var/log/syslog" ]
start_position => "beginning"
}
@hourback
hourback / start_samba.sh
Last active August 29, 2015 14:06
This is what I'm using on boot2docker to share a data volume container via Samba
docker run --rm -v /usr/local/bin/docker:/docker -v /var/run/docker.sock:/docker.sock svendowideit/samba my-data
@hourback
hourback / create_data_volume_container.sh
Created September 4, 2014 19:39
This creates a data volume container
docker run -v /data --name my-data busybox true
@hourback
hourback / run_docker-ember.sh
Last active August 29, 2015 14:06
I am using this to start docker-ember.js container and link with my data volume container. I am running as user "guest" but not until the container launches due to permissions issues on the volume container.
docker run -t -i --rm -p 9000:9000 --volumes-from my-data hourback/docker-ember.js
@hourback
hourback / bootlocal.sh
Last active August 29, 2015 14:06
I run this when I start up boot2docker. (It's supposed to run automatically, but there must be a bug in boot2docker that keeps this from doing so.)
#!/bin/bash
# Set up SSH keys for Github
source set-up-ssh.sh
ln -s /var/lib/boot2docker/.gitconfig ~/.gitconfig
docker start my-data
docker run --rm -v /usr/local/bin/docker:/docker -v /var/run/docker.sock:/docker.sock svendowideit/samba my-data
@hourback
hourback / start_docker-ember.js-and-go.sh
Last active August 29, 2015 14:06
Starting Ember.js + Go environment
#!/bin/sh
docker run -t -i --rm -p 8001:8001 -p 8080:8080 -p 4200:4200 -p 3000:3000 -p 8000:8000 -p 9000:9000 -p 35729:35729 --volumes-from my-data hourback/docker-ember.js-and-go
@hourback
hourback / server.go
Created September 30, 2014 21:24
Returns: "guest@0e1ba540edf0:/data/docker-ember.js/fanotification/go-restful$ go build . && ./go-restful # _/data/docker-ember.js/fanotification/go-restful ./server.go:140: syntax error: unexpected :, expecting := or = or comma ./server.go:144: non-declaration statement outside function body ./server.go:147: non-declaration statement outside fun…
package main
import (
"log"
"net/http"
"strconv"
"os"
"github.com/emicklei/go-restful"
"github.com/emicklei/go-restful/swagger"
package main
import (
"fmt"
"log"
"net/http"
"strconv"
"os"
"github.com/emicklei/go-restful"
@hourback
hourback / server.go
Created October 1, 2014 19:19
Trying to create fixture data on line 31-32, but getting . . . "2014/10/01 19:16:02 Creating records panic: runtime error: index out of range goroutine 1 [running]: runtime.panic(0x6186e0, 0x8c48f7) /usr/lib/go/src/pkg/runtime/panic.c:266 +0xb6 main.main() /data/docker-ember.js/fanotification/go-net-http/server.go:32 +0x4f9"
package main
import (
_ "github.com/lib/pq"
//"database/sql"
//"github.com/jmoiron/sqlx"
"log"
"io"
"net/http"