Skip to content

Instantly share code, notes, and snippets.

@a-h
a-h / default.md
Created January 31, 2019 16:29
Security vulnerability tracking

What you wanted to do

Check that my program is free from known security vulnerabilities.

For example, if a package I'm using has a security vulnerability in it, I want to be notified to upgrade or warned.

What you actually did

Checked the https://nvd.nist.gov/vuln/search for Go related issues, but found that only core packages were listed. I noticed that some packages had vulnerabilities listed (e.g. https://nvd.nist.gov/vuln/detail/CVE-2018-1002207) but couldn't work out how to find them programatically. I wrote a program to scan the NIST database for Go language related vulnerabilities and to let me know anyway - https://github.com/a-h/nvdnotifier

@a-h
a-h / main.go
Created December 21, 2018 15:21
Circle CI AWS Credentials Cycling
package main
import (
"bytes"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
@a-h
a-h / 01_nodemcu.ino
Last active November 11, 2018 21:48
Updated door sensor
#include <WiFiServerSecure.h>
#include <WiFiClientSecure.h>
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
#include <WiFiUdp.h>
#include <ESP8266WiFiType.h>
#include <ESP8266WiFiAP.h>
#include <WiFiClient.h>
#include <WiFiServer.h>
#include <ESP8266WiFiScan.h>
@a-h
a-h / Dockerfile
Created November 2, 2018 11:06
Running AWS Scout in a Docker container
FROM python:3.7-alpine3.7
RUN pip install awsscout2
VOLUME ["/report"]
CMD /usr/local/bin/Scout2 --report-dir /report
#include <WiFiServerSecure.h>
#include <WiFiClientSecure.h>
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
#include <WiFiUdp.h>
#include <ESP8266WiFiType.h>
#include <ESP8266WiFiAP.h>
#include <WiFiClient.h>
#include <WiFiServer.h>
#include <ESP8266WiFiScan.h>
@a-h
a-h / main.go
Created May 24, 2018 14:40
Webhook Receiver
package main
import (
"fmt"
"net/http"
"net/http/httputil"
)
func main() {
h := handler{}
@a-h
a-h / buildspec.yml
Last active November 3, 2022 08:31
Build Go with private dependencies on AWS CodeBuild
version: 0.2
env:
parameter-store:
build_ssh_key: "build_ssh_key"
phases:
install:
commands:
- mkdir -p ~/.ssh
@a-h
a-h / main.go
Last active April 29, 2018 12:35
Find implementations of a function type
package main
import (
"fmt"
"go/ast"
"go/importer"
"go/parser"
"go/token"
"go/types"
"log"
@a-h
a-h / main.go
Created April 23, 2018 20:32
XOR Training
package main
import (
"fmt"
"os"
"os/signal"
"time"
"github.com/a-h/ml/distance"
@a-h
a-h / main.go
Created April 2, 2018 14:29
KMeans on random 2D data
package main
import (
"fmt"
"math/rand"
"os"
"strconv"
"time"
"github.com/a-h/ml/clustering"