Skip to content

Instantly share code, notes, and snippets.

View supr's full-sized avatar

supr

  • C|^_^|Ɔ
  • GU HQ, 21 Faro System.
View GitHub Profile
@supr
supr / gist:1166302
Created August 23, 2011 19:50
For golang http.Handler to serve static files on /foo mounted at /xyz/foo
package main
import (
"http"
)
func main() {
http.Handle("/foo/", http.StripPrefix("/foo", http.FileServer(http.Dir("/xyz/foo/"))))
http.ListenAndServe(":6543", nil)
}
@supr
supr / audit.log
Created January 20, 2014 01:30
Fedora 20 docker. After running docker run -i -t centos /bin/bash
type=ANOM_PROMISCUOUS msg=audit(1390181243.529:735): dev=vethDvSeyL prom=256 old_prom=0 auid=4294967295 uid=0 gid=0 ses=4294967295
type=SYSCALL msg=audit(1390181243.529:735): arch=c000003e syscall=16 success=yes exit=0 a0=a a1=89a2 a2=7fff4caa1640 a3=7fff4caa1460 items=0 ppid=1806 pid=1935 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=pts3 comm="lxc-start" exe="/usr/bin/lxc-start" subj=system_u:system_r:docker_t:s0 key=(null)
type=NETFILTER_CFG msg=audit(1390181243.530:736): table=filter family=2 entries=0
type=NETFILTER_CFG msg=audit(1390181243.530:736): table=raw family=2 entries=0
type=NETFILTER_CFG msg=audit(1390181243.530:736): table=security family=2 entries=0
type=NETFILTER_CFG msg=audit(1390181243.530:736): table=mangle family=2 entries=0
type=NETFILTER_CFG msg=audit(1390181243.530:736): table=nat family=2 entries=0
type=NETFILTER_CFG msg=audit(1390181243.530:736): table=filter family=10 entries=0
type=NETFILTER_CFG msg=audit(1390181243.530:736): table=raw
@supr
supr / bash.sh
Created January 7, 2014 03:11
rust compile error
cp: x86_64-unknown-linux-gnu/stage1/lib/libstd.so
/home/prudhvi/code/rust/src/libnative/lib.rs:1:0: 1:0 error: can't find crate for `std`
/home/prudhvi/code/rust/src/libnative/lib.rs:1 // Copyright 2013 The Rust Project Developers. See the COPYRIGHT
^
task 'rustc' failed at 'explicit failure', /home/rustbuild/src/rust-buildbot/slave/snap3-linux/build/src/libsyntax/diagnostic.rs:76
task '<main>' failed at 'explicit failure', /home/rustbuild/src/rust-buildbot/slave/snap3-linux/build/src/librustc/lib.rs:441
make: *** [x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libnative.so] Error 101
make: *** Waiting for unfinished jobs....
/home/prudhvi/code/rust/src/libgreen/lib.rs:1:0: 1:0 error: can't find crate for `std`
/home/prudhvi/code/rust/src/libgreen/lib.rs:1 // Copyright 2013 The Rust Project Developers. See the COPYRIGHT
@supr
supr / out.txt
Created November 15, 2013 22:53
[info] Updating {file:/home/prudhvi/code/Loki/}loki...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Compiling 24 Scala sources and 4 Java sources to /home/prudhvi/code/Loki/target/scala-2.10/classes...
[warn] /home/prudhvi/code/Loki/src/main/scala/com/memeo/loki/JavascriptAdapters.scala:19: imported `api' is permanently hidden by definition of package api in package loki
[warn] import com.memeo.loki.api
[warn] ^
[error] /home/prudhvi/code/Loki/src/main/scala/com/memeo/loki/MapReduceActor.scala:34: Cannot find an implicit ExecutionContext, either require one yourself or import ExecutionContext.Implicits.global
[error] context.system.scheduler.scheduleOnce(timeout) {
[error] ^
@supr
supr / build.sbt
Created November 15, 2013 22:07
Loki SBT
name := "Loki"
version := "0.0.1-SNAPSHOT"
scalaVersion := "2.10.0"
resolvers ++= Seq(
"Oracle Released Java Packages" at "http://download.oracle.com/maven",
"Sonatype Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"
)
@supr
supr / gist:7439630
Created November 12, 2013 22:06
Loki Build failure
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.246s
[INFO] Finished at: Tue Nov 12 14:06:04 PST 2013
[INFO] Final Memory: 9M/240M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project loki: Could not resolve dependencies for project com.memeo:loki:jar:0.0.1-SNAPSHOT: Could not find artifact org.mapdb:mapdb:jar:0.9.8-SNAPSHOT -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
@supr
supr / main.rs
Created December 23, 2015 06:48
use std::env;
use std::process;
use std::str;
use std::io::{Error, Read};
extern crate hyper;
use hyper::client::Client;
use hyper::header::UserAgent;
use hyper::method::Method;
# honnef.co/go/implements
../../.go/src/honnef.co/go/implements/main.go:134: scope.NumEntries undefined (type *types.Scope has no field or method NumEntries)
../../.go/src/honnef.co/go/implements/main.go:135: scope.At undefined (type *types.Scope has no field or method At)
@supr
supr / git_latest.sh
Created July 22, 2013 20:49
Extract latest git tag for the same commit
git log --decorate -1 | head -1 | grep -Po '(?<=tag: )[0-9.{4}]+' | head -1
@supr
supr / matrix_telugu.html
Created March 18, 2013 00:21
Matrix Telugu
<head>
<script>
<!--
var s,q,w,h,m,p,i;
function randomFromInterval(from, to) {
return Math.floor(m() * (to - from + 1) + from);
}