Skip to content

Instantly share code, notes, and snippets.

View vbatts's full-sized avatar
🧁

Vincent Batts vbatts

🧁
View GitHub Profile
@vbatts
vbatts / README.md
Last active January 27, 2018 16:12
🙏 📎 Emoji that checksum! 🎉 💩

emojisum

🙏 📎 Emoji that checksum! 🎉 💩

I attempted a curated list of 256 emojis that are not entirely similar. Using http://www.webpagefx.com/tools/emoji-cheat-sheet/ to compare them. I went with 256 as that is 8bit/1byte, and the hexadecimal output that is 2 hex characters.

So 1 emoji is 2 hex positions.

new home

@vbatts
vbatts / gzip_with_attributes.go
Created October 25, 2016 17:54
Use gzip comment field for added info
package main
import (
"compress/gzip"
"crypto/sha256"
"encoding/json"
"flag"
"fmt"
"io"
"log"
@vbatts
vbatts / generate_cert.go
Last active September 26, 2016 20:13
modification of the golang ./src/crypto/tls/generate_cert.go, but trying to play nice with google-chrome
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build ignore
// Generate a self-signed X.509 certificate for a TLS server. Outputs to
// 'cert.pem' and 'key.pem' and will overwrite existing files.
package main
@vbatts
vbatts / keyid.go
Last active September 27, 2016 16:39
get the digest of the public key per rfc5280 https://tools.ietf.org/html/rfc5280#section-4.2.1.2
package main
import (
"crypto/rsa"
"crypto/sha1"
"crypto/tls"
"encoding/asn1"
"fmt"
"log"
"os"
@vbatts
vbatts / stash_sha1.go
Created August 31, 2016 21:35
Study in writing SHA1 digest of content in the gzip header
package main
import (
"compress/gzip"
"crypto/rand"
"crypto/sha1"
"fmt"
"io/ioutil"
"log"
)

Clear Communications

To ensure that communications happen smoothly, openly and free from suspicion of malice, particular behaviors of involvement can be distracting.

Taking from the section on interference with organizations, the following points are NOT beneficial to making progress.

  1. Insist on doing everything through "channels." Never permit short-cuts to be taken in order to expedite decision.
package main
import (
"archive/tar"
"bytes"
"fmt"
"io"
"log"
"os"
"time"
vbatts@bananaboat ~ (master *) $ sha256sum x.combined.tar.gz x-1.combined.tar.gz
f283ba0d5fbc812dc27d26946e08d1ed9a49325c244b5dbfa51a37018030b327 x.combined.tar.gz
768ed169ddeccc1c8ccef6a8696c02a4cda1a135b05da47b205f074dcd9c4415 x-1.combined.tar.gz
vbatts@bananaboat ~ (master *) $ tar tvf x.combined.tar.gz
drwxr-xr-x vbatts/users 0 2016-05-10 06:33 ./
-rw-r--r-- vbatts/users 1024 2016-02-18 18:10 ./5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef.tar
-rw-r--r-- vbatts/users 88473600 2016-02-18 18:10 ./6ff50884daa3ba41e6780e06bf2af92650840c52029c5e80f22f4d1c1f1a38a4.tar
-rw-r--r-- vbatts/users 277 2016-05-10 06:31 ./manifest.json
-rw-r--r-- vbatts/users 1620 2016-02-18 18:10 ./eca00f1249b3daa555d2c6e88dfb6a15c06f2f80e92ecb20f6bb7d8843deec15.json
vbatts@bananaboat ~ (master *) $ tar tvf x-1.combined.tar.gz
@vbatts
vbatts / manifest-list.json
Last active April 12, 2016 18:27
Files for JSON schema validation testing
{
"schemaVersion": 2,
"mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
"manifests": [
{
"mediaType": "application/vnd.docker.image.manifest.v2+json",
"size": 7143,
"digest": "sha256:e692418e4cbaf90ca69d05a66403747baa33ee08806650b51fab815ad7fc331f",
"platform": {
"architecture": "ppc64le",
@vbatts
vbatts / lie-in.txt
Created February 15, 2016 21:24
fortune -a -m "bathroom light"
$ fortune -a -m "bathroom light"
%% (fortunes2)
Symptom: Everything has gone dark.
Fault: The Bar is closing.
Action Required: Panic.
Symptom: You awaken to find your bed hard, cold and wet.
You cannot see the bathroom light.
Fault: You have spent the night in the gutter.
Action Required: Check your watch to see if bars are open yet. If not,