Skip to content

Instantly share code, notes, and snippets.

View penguinpowernz's full-sized avatar

Robert penguinpowernz

  • Penguin Power
  • Auckland, New Zealand
View GitHub Profile

Keybase proof

I hereby claim:

  • I am penguinpowernz on github.
  • I am mcleodr (https://keybase.io/mcleodr) on keybase.
  • I have a public key ASA_0KLhZhVGNBqQsfHZbL5uviW4hekKGx9bYtw5yH0kKAo

To claim this, I am signing this object:

@penguinpowernz
penguinpowernz / jsonpp.go
Last active December 12, 2017 00:37
Pretty print JSON files faster than json_pp
// build by running go build ./jsonpp.go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"os"
@penguinpowernz
penguinpowernz / index.html
Created February 15, 2017 23:11
Camera streaming proxy so you can block your botnettable camera at the firewall and serve this through your own NGINX
<html>
<head>
<title>Safe Cam!</title>
<meta http-equiv="refresh" content="60"/>
</head>
<body style="padding: 0px; margin: 0px;">
<img id="MJPEG_streaming" src="http://<camip>/snapshot.cgi" align="CENTER">
<script type="text/javascript">
stretchImage = function() {
var image = document.getElementById("MJPEG_streaming");
@penguinpowernz
penguinpowernz / KaikouraQuake.kml
Created November 17, 2016 13:31
Kaikoura Quake photos located in Google Maps/Earth
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
<name>KairouraQuake.kml</name>
<Style id="s_ylw-pushpin">
<IconStyle>
<scale>1.1</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>
</Icon>
@penguinpowernz
penguinpowernz / wpa_supplicant.conf
Created October 28, 2016 00:06
WPA Supplicant config file explanations
##### Example wpa_supplicant configuration file ###############################
#
# This file describes configuration file format and lists all available option.
# Please also take a look at simpler configuration examples in 'examples'
# subdirectory.
#
# Empty lines and lines starting with # are ignored
# NOTE! This file may contain password information and should probably be made
# readable only by root user on multiuser systems.
@penguinpowernz
penguinpowernz / README.md
Last active March 21, 2024 15:46
WPA CLI commands
command args description
status [verbose] get current WPA/EAPOL/EAP status
ifname get current interface name
ping pings wpa_supplicant
relog re-open log-file (allow rolling logs)
note <text> add a note to wpa_supplicant debug log
mib get MIB variables (dot1x, dot11)
help [command] show usage help
interface [ifname] show interfaces/select interface
@penguinpowernz
penguinpowernz / servaphore.go
Last active October 19, 2016 11:43
Semaphore server
package main
import (
"log"
"net/http"
"time"
)
type empty struct{}
type semaphore chan empty
FROM node:argon
# change this to uncache and rebuilt the image
ENV DOCKERFILE_VERSION=0.0.1
RUN mkdir -p /usr/src/app
RUN npm install -g strongloop pm2
# install debian packages
RUN apt-get update
@penguinpowernz
penguinpowernz / extn_count.md
Last active July 4, 2016 22:17
Standard Strongloop API node modules contents

Count of Files by Extension

This command generated this:

$ ls -lR|grep -vP "^total"|grep -vP "^./|^$|^d"|awk '{print $9}'|awk -F. '{print $NF}'|sort|uniq -c

It is not completely accurate but gives an idea.

    219 (NO EXTENSION)
@penguinpowernz
penguinpowernz / README.md
Last active April 12, 2016 21:04
A ruby script to check if wifi AP authentication details are correct

Wifi Auth Test Script

This script will attempt to check the authentication details for an AP to see if they are correct. It should be called like so:

$ ruby wpa_auth_test.rb "FBISurveillanceVan4" "stingrays 4 eva"
I, [2000-01-02T02:36:27.925647 #14255]  INFO -- : Starting WPA Supplicant
I, [2000-01-02T02:36:28.097044 #14255]  INFO -- : Searching WPA log for authentication state
I, [2000-01-02T02:36:37.943307 #14255]  INFO -- : Found authentication state in 10.02 seconds
I, [2000-01-02T02:36:37.947201 #14255]  INFO -- : Killing WPA on PID 14268

E, [2000-01-02T02:36:37.961020 #14255] ERROR -- : Authentication failed