Skip to content

Instantly share code, notes, and snippets.

Ning Xie andyxning

Block or report user

Report or block andyxning

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ebenoist
ebenoist / consumer.go
Last active Feb 18, 2019
nsq consumer
View consumer.go
package main
import (
"errors"
"log"
"os"
"os/signal"
"syscall"
"github.com/nsqio/go-nsq"
View docker.dump
SIGABRT: abort
PC=0x5fb6c8
goroutine 308297 [syscall, 4433 minutes]:
syscall.Syscall6(0x3d, 0x10a0c, 0xc2084e3aec, 0x0, 0xc2084b86c0, 0x0, 0x0, 0xc208433400, 0x347, 0x3b7)
/usr/local/go/src/syscall/asm_linux_amd64.s:46 +0x5 fp=0xc2084e3a50 sp=0xc2084e3a48
syscall.wait4(0x10a0c, 0xc2084e3aec, 0x0, 0xc2084b86c0, 0x90, 0x0, 0x0)
/usr/local/go/src/syscall/zsyscall_linux_amd64.go:124 +0x79 fp=0xc2084e3ab0 sp=0xc2084e3a50
syscall.Wait4(0x10a0c, 0xc2084e3b34, 0x0, 0xc2084b86c0, 0x0, 0x0, 0x0)
/usr/local/go/src/syscall/syscall_linux.go:224 +0x60 fp=0xc2084e3af8 sp=0xc2084e3ab0
View Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
View docker-log-gist.md
@bketelsen
bketelsen / nsqadmin-service.json
Last active Jul 24, 2017
This gist represents all the manifests you'll need to run a redundant and fault-tolerant NSQ cluster on Kubernetes. NSQ Admin's http interface is available on port 14171 on any node. There's an issue with NSQ Admin if you're running more than one lookupd service, so I recommend running just one lookupd until I figure it out.
View nsqadmin-service.json
{
"id": "nsqadmin-http",
"kind": "Service",
"apiVersion": "v1beta1",
"port": 14171,
"protocol": "TCP",
"selector": { "name": "nsqadmin" }
}
View Golang decorator
package main
import (
"fmt"
)
func decorator(f func(s string)) func(s string) {
return func(s string) {
fmt.Println("Started")
@nuxlli
nuxlli / request.sh
Last active May 19, 2019
Examples of http request (in unix domain socket) with bash and [nc|socat]
View request.sh
#!/bin/bash
# References
# http://www.computerhope.com/unix/nc.htm#03
# https://github.com/daniloegea/netcat
# http://unix.stackexchange.com/questions/26715/how-can-i-communicate-with-a-unix-domain-socket-via-the-shell-on-debian-squeeze
# http://unix.stackexchange.com/questions/33924/write-inside-a-socket-open-by-another-process-in-linux/33982#33982
# http://www.linuxjournal.com/content/more-using-bashs-built-devtcp-file-tcpip
# http://www.dest-unreach.org/socat/
# http://stuff.mit.edu/afs/sipb/machine/penguin-lust/src/socat-1.7.1.2/EXAMPLES
@andrewrcollins
andrewrcollins / trim.awk
Created Jan 11, 2012
ltrim(), rtrim(), and trim() in awk
View trim.awk
function ltrim(s) { sub(/^[ \t\r\n]+/, "", s); return s }
function rtrim(s) { sub(/[ \t\r\n]+$/, "", s); return s }
function trim(s) { return rtrim(ltrim(s)); }
BEGIN {
# whatever
}
{
# whatever
}
END {
@fajrif
fajrif / gist:1265203
Created Oct 5, 2011
git clone specific tag
View gist:1265203
git clone <repo-address>
git tag -l
git checkout <tag-name>
git branch -D master
git checkout -b master
You can’t perform that action at this time.