Skip to content

Instantly share code, notes, and snippets.

@maddyblue
maddyblue / gitconfig
Created June 14, 2011 01:34
gitconfig
[user]
name = Matt Jibson
email = matt.jibson@gmail.com
[color]
diff = auto
status = auto
branch = auto
@maddyblue
maddyblue / Extractor.cs
Last active August 22, 2019 04:49
Roslyn- and UglifyJS-based extractors for translation. All files subject to the attached license.
using System.Collections.Generic;
using System.Linq;
using Roslyn.Compilers.CSharp;
using Roslyn.Compilers.Common;
namespace LocalizationExtractor
{
class InvocationExtractor : SyntaxWalker
{
public readonly List<StringInfo> Strings = new List<StringInfo>();
package collectors
import (
"fmt"
ole "github.com/mattn/go-ole"
"github.com/mattn/go-ole/oleutil"
)
func wmiQuery(query string) ([]map[string]string, error) {
tsdbHost = ny-devtsdb04.ds.stackexchange.com:4242
smtpHost = ny-mail03.ds.stackexchange.com:25
[template.cpu]
body = `Alert definition:
Name: {{.Alert.Name}}
Crit: {{.Alert.Crit}}
Tags:{{range $k, $v := .Tags}}
{{$k}}: {{$v}}{{end}}
notification default {
print = true
}
notification nc1 {
print = true
}
notification nc2 {
print = true
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
)
#!/bin/bash
set -e
base=bosun.org
gopath=$GOPATH/src
bdir=$gopath/$base
rm -rf $bdir
git init $bdir
git remote add origin git@github.com:mjibson/bosun.org.git
@maddyblue
maddyblue / docker.sh
Last active August 3, 2022 02:45
c# event log watcher
#!/bin/sh
docker run --rm -e \
LOGSTASH_CONFIG_URL=https://gist.githubusercontent.com/mjibson/cdf2e423329ae06e37d0/raw/logstash.conf \
-p 9292:9292 \
-p 9200:9200 \
-p 5123:5123 \
pblittle/docker-logstash
/*
Command er-release prints the PRs merged since the last release
These should be added to CHANGELOG.md with an appropriate version.
*/
package main
import (
"flag"
"fmt"
@maddyblue
maddyblue / gist:aa5951b09a08cc6e4570
Created September 24, 2015 21:37
kubernetes init failure
$ docker run --net=host --rm -it -v /var/run/docker.sock:/var/run/docker.sock gcr.io/google_containers/hyperkube:v1.0.6 /hyperkube kubelet --api_servers=http://localhost:8080 --v=2 --address=0.0.0.0 --enable_server --hostname_override=127.0.0.1 --config=/etc/kubernetes/manifests
WARNING: Your kernel does not support memory swappiness capabilities, memory swappiness discarded.
W0924 21:36:28.920738 1 server.go:261] failed to set oom_score_adj to -900: write /proc/self/oom_score_adj: permission denied
W0924 21:36:28.920875 1 server.go:474] Could not load kubeconfig file /var/lib/kubelet/kubeconfig: stat /var/lib/kubelet/kubeconfig: no such file or directory. Trying auth path instead.
W0924 21:36:28.920896 1 server.go:436] Could not load kubernetes auth path /var/lib/kubelet/kubernetes_auth: stat /var/lib/kubelet/kubernetes_auth: no such file or directory. Continuing with defaults.
I0924 21:36:28.920937 1 server.go:273] Using root directory: /var/lib/kubelet
I0924 21:36:28.920952 1