Skip to content

Instantly share code, notes, and snippets.

View mzimmerman's full-sized avatar

Matthew Zimmerman mzimmerman

View GitHub Profile
@mzimmerman
mzimmerman / PKGBUILD
Created February 26, 2018 17:49
version bump for geoipupdate
# Maintainer: frank AT apsu DOT be
pkgname=geoipupdate
pkgver=2.5.0
pkgrel=1
pkgdesc="Automatic updates of MaxMind GeoIP2 and GeoIP Legacy binary databases"
license=('GPL2')
arch=(i686 x86_64)
url="http://dev.maxmind.com/geoip/geoipupdate/"
depends=(curl)
@mzimmerman
mzimmerman / iprange.go
Created November 29, 2017 04:05
ipv6 range conversion from CIDR in Go golang
package main
import (
"log"
"net"
)
func ipRange(str string) (net.IP, net.IP) {
_, mask, err := net.ParseCIDR(str)
if err != nil {
@mzimmerman
mzimmerman / makeGroup.sh
Created April 12, 2016 14:42
Show failure of go tool compiling large map literal
#!/bin/sh
for fname in $(seq 1 $1); do
echo "\"$fname\" : {"
echo "name : \"$fname\","
echo "Weight : 50,"
echo "Emails : []string {"
echo "},"
echo "},"
done
@mzimmerman
mzimmerman / PKGBUILD
Created December 17, 2014 14:24
Nessus 6.1.2 PKGBUILD
# Maintainer: Daniel Micay <danielmicay@gmail.com>
# Contributer: Pranay Kanwar <pranay.kanwar@gmail.com>
# Contributer: Matt Zimmerman <mzimmerman@gmail.com>
pkgname=nessus
pkgver=6.1.2
pkgrel=1
_bigver=Nessus-$pkgver-fc20.x86_64.rpm
pkgdesc="Vulnerability scanner"
arch=('x86_64')
package main
import (
"bufio"
"fmt"
"io"
"log"
"net"
"net/http"
"os"
@mzimmerman
mzimmerman / gist:8915639
Created February 10, 2014 13:08
checkLogs appengine function
func checkLogs(c appengine.Context, w http.ResponseWriter, r *http.Request) {
now := time.Now()
query := &log.Query{
StartTime: now.Add(-time.Hour),
EndTime: now,
Incomplete: true,
AppLogs: true,
ApplyMinLevel: true,
MinLevel: 3, // in linux syslog, 3 = error
}
@mzimmerman
mzimmerman / PKGBUILD
Created December 28, 2013 20:27
liteide PKGBUILD
# $Id$
# Maintainer: Alexander Rødseth <rodseth@gmail.com>
# Contributor: spambanane <happy.house@gmx.de>
# Contributor: Matteo <matteo.dek@gmail.com>
pkgname=liteide
@mzimmerman
mzimmerman / api_dev.go
Last active December 30, 2015 09:39
modifying api_dev.go to output what the raw data from stdin is
// Copyright 2011 Google Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
package appengine_internal
import (
"bytes"
"encoding/base64"
"fmt"
@mzimmerman
mzimmerman / gist:6795900
Last active December 24, 2015 12:09
Go Conversion
package main
type simple float64
func test(x float64) float64 {
return float64(simple(x))
}
func main() {
test(2.5)
@mzimmerman
mzimmerman / goauth2.patch
Created May 6, 2013 13:33
Patch for goauth2 to enable usage of a Simple API Key
diff -r 2d711318934b oauth/oauth.go
--- a/oauth/oauth.go Tue Apr 30 13:15:44 2013 -0400
+++ b/oauth/oauth.go Mon May 06 09:20:21 2013 -0400
@@ -144,6 +144,7 @@
type Transport struct {
*Config
*Token
+ APIKey string
// Transport is the HTTP transport to use when making requests.