Skip to content

Instantly share code, notes, and snippets.

View fuzzy's full-sized avatar

Mike 'Fuzzy' Partin fuzzy

  • A Place For Mom
  • Seattle, WA
View GitHub Profile
var remote = new XMLHttpRequest();
remote.onreadystatechange == function() {
console.log(this.responseText);
postMessage(this.responseText);
};
remote.open("GET", "/salt/events", true);
remote.setRequestHeader("X-Auth-Token", "{{salt_api_token}}");
remote.send();
// Warning (TypedefDecl): %!s(int=333): function pointers are not supported
// Warning (TypedefDecl): %!s(int=341): function pointers are not supported
// Warning (TypedefDecl): %!s(int=350): function pointers are not supported
// Warning (TypedefDecl): %!s(int=353): function pointers are not supported
// Warning (VarDecl): %!s(int=27): probably an incorrect type translation 2
// Warning (TypedefDecl): %!s(int=266): function pointers are not supported
// Warning (TypedefDecl): %!s(int=269): function pointers are not supported
// Warning (CallExpr): %!s(int=406): unknown function: delay_ms
// Warning (MemberExpr): %!s(int=429): cannot determine type for LHS 'const struct bme280_dev *', will use 'void *' for all fields
// Warning (CallExpr): %!s(int=432): unknown function: read
if test -f ${HOME}/.sshenv; then
. ${HOME}/.sshenv
proc_info=$(ps aux|grep ${SSH_AGENT_PID}|grep -v grep)
test -z "${proc_info}" && rm -f ${HOME}/.sshenv
fi
LOCAL_BASE=${HOME}/.local
test ! -d ${LOCAL_BASE} && mkdir -p ${LOCAL_BASE}
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
#######################
### Ssh-agent setup ###
#######################
refresh_ssh_agent_env() {
#!/usr/bin/env python2
import os
import sys
import time
import random
import socket
import argparse
parser = argparse.ArgumentParser()
# Uncomment this for debugging output
#set -x
test ! -z "$(which clang 2>/dev/null)" && CC=clang || CC=gcc
GOOS=$(uname -s)
GOARCH=$(uname -m)
GOBASE=${HOME}/.goroot/${GOOS}/${GOARCH}
GOVERS_BSTRAP=1.4.3
GOFILE_BSTRAP=${HOME}/.goroot/go${GOVERS_BSTRAP}.src.tar.gz
GOURL_BSTRAP=https://storage.googleapis.com/golang/go${GOVERS_BSTRAP}.src.tar.gz
@fuzzy
fuzzy / host.go.patch
Created February 4, 2017 07:05
patch to github.com/zstyblik/go-facter/lib/host/host.go
--- host.orig.go 2017-02-03 23:03:06.070727000 -0800
+++ host.go 2017-02-03 23:03:22.349835000 -0800
@@ -53,6 +53,19 @@
return strings.TrimRight(string(b), "\x00")
}
+// uint8ToString converts [65]uint8 in syscall.Utsname to string
+func uint8ToString(bs [65]uint8) string {
+ b := make([]byte, len(bs))
+ for i, v := range bs {
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
package main
import (
"fmt"
"net"
"time"
)
func main() {
ts := time.Now().Unix()
#!/usr/bin/env python2
import time
import socket
if __name__ == '__main__':
st = int(time.time())
while 1:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(('relay-vip.phl.corp.theplatform.com', 2003))