Skip to content

Instantly share code, notes, and snippets.

View scottjbarr's full-sized avatar

Scott Barr scottjbarr

View GitHub Profile
@scottjbarr
scottjbarr / Makefile
Created March 19, 2023 13:02 — forked from ryu1kn/Makefile
Encrypt/decrypt with AWS KMS using AWS cli
# How to encrypt/decrypt your text/blob secret with AWS KMS with AWS cli
KEY_ID=alias/my-key
SECRET_BLOB_PATH=fileb://my-secret-blob
SECRET_TEXT="my secret text"
ENCRYPTED_SECRET_AS_BLOB=encrypted_secret_blob
DECRYPTED_SECRET_AS_BLOB=decrypted_secret_blob # Result of decrypt-blob target
encrypt-text:
@scottjbarr
scottjbarr / journalctl.md
Created January 9, 2021 23:32 — forked from tyagiakhilesh/journalctl.md
Using JournalCtl to view system logs
// To display utc timestamp in logs
journalctl --utc

// Displaying Logs from the Current Boot
journalctl -b

// Listing boots
journalctl --list-boots
@scottjbarr
scottjbarr / text_adv-part-1.go
Last active October 26, 2019 17:41 — forked from p4tin/text_adv-part-1.go
Writing a Text Adventure Game in Go - Part 1 (uses a *Location for Game.CurrentLocation)
package main
import (
"fmt"
"math/rand"
"time"
)
type Game struct {
Welcome string
@scottjbarr
scottjbarr / jwt_golang_example.go
Last active April 10, 2016 23:34 — forked from thealexcons/jwt_golang_example.go
JSON Web Token example
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"strings"
"time"
@scottjbarr
scottjbarr / gist.go
Created March 7, 2016 01:40 — forked from minikomi/gist.go
Golang script for creating anonymous gists with github API
package main
import (
"bytes"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"