Skip to content

Instantly share code, notes, and snippets.

View flowchartsman's full-sized avatar
🏠
Working from home

Andy Walker flowchartsman

🏠
Working from home
View GitHub Profile
@flowchartsman
flowchartsman / main.go
Last active June 15, 2023 01:21
bubbletea multiprogress widget supporting new widgets, failure, reset, all controlled externally
package main
import (
"fmt"
"math/rand"
"os"
"strconv"
"time"
tea "github.com/charmbracelet/bubbletea"
@flowchartsman
flowchartsman / .github_dependabot.yml
Created March 16, 2023 22:02
Golang testing and github workflow w/ coverage, dependencies and badges
version: 2
updates:
- package-ecosystem: github-actions
directory: /
labels:
- dependencies
- actions
- Skip Changelog
schedule:
interval: weekly
@flowchartsman
flowchartsman / json_test.go
Created November 2, 2022 20:08 — forked from LOZORD/json_test.go
An example of using a native JSON-friendly Go struct as a type and input in a CEL program.
package test
import (
"bytes"
"encoding/json"
"testing"
"github.com/golang/protobuf/jsonpb"
structpb "github.com/golang/protobuf/ptypes/struct"
"github.com/google/cel-go/cel"
blueprint:
name: Frigate Notification (0.10.0) w/ ignoretime
description: |
## Frigate Mobile App Notification
This blueprint will send a notification to your device when a Frigate event for the selected camera is fired. The notification will initially include the thumbnail of the detection, but include an actionable notification allowing you to view the clip and snapshot.
With this blueprint, you may send the notification to multiple devices by leaving "Device" blank and instead use a [notification group][1].
### Software Version Requirements
@flowchartsman
flowchartsman / start.md
Last active July 19, 2022 13:51
Zero To Go

Intro

This is an experiment in self-teaching Go, starting from complete unfamiliarity with the language. The goal is to provide a step-by-step educational resource that you can follow at your own pace, where each phase effectively builds on that which came before it with as little unnecessary overlap as possible. It's very much a "living document" or work in progress, and will likely be under constant revision as I revisit advice, update sources, tweak ordering and learn more about how these resources interact to create a well-rounded knowledge of the language. Please feel free to issue feedback and make any suggestions you feel are pertinent.

Reading

  1. Go through the tour at https://tour.golang.org/list
  2. Promptly abandon all of those plans you have to use channels everywhere
  3. Read the language spec once over: https://golang.org/ref/spec
  4. https://dave.cheney.net/2017/04/26/understand-go-pointers-in-less-than-800-words-or-your-money-back
  5. Read Effective Go: https://golang.org/doc/effective_go.htm
v, ok := inter.(MyType)
if !ok {
return errors.New ("nope")
}
// becomes
switch v := inter.(type) {
case MyType:
// do MyType stuff with v
package main
import (
"net/http"
"github.com/gorilla/mux"
)
// example of a basic handler
func fooHandler(w http.ResponseWriter, r *http.Request) {
package main
import (
"net/http"
"github.com/gorilla/mux"
)
// example of a basic handler
func fooHandler(w http.ResponseWriter, r *http.Request) {
@flowchartsman
flowchartsman / kali_osx_persistence_wifi.md
Last active June 14, 2023 13:00 — forked from widdowquinn/kali_osx_persistence_wifi.md
Kali Linux Live USB with encrypted persistence and wireless on Macbook Pro/Air without networking.

Kali Linux Bootable USB with Persistence and Wireless on OSX

Tutorials for running live Kali on OSX often require you have networking on your laptop to apt install the drivers, but without an ethernet adapter you're not going to be able to do that, so this tutorial will cover a method of doing this manually, using another thumbdrive or external data source.

Download the appropriate Kali Linux .iso

I used a 64 bit .iso image, downloaded via HTTP.

@flowchartsman
flowchartsman / Gofromsource.md
Last active September 26, 2019 17:44
Building Go from source!

Installing Go

I like to install my Go from source so I can mess around and stay up to date. Here's how I do so.

I prefer an installation directory in $HOME/opt. I like putting it here so that it's completely within my home directory, but feel free to change it.

For the purposes of these instructions, I'm assuming OSX/*nix (Windows instructions shortly).

Required Software

MacOS: homebrew