Skip to content

Instantly share code, notes, and snippets.

@MicahParks
MicahParks / glint.sh
Last active December 6, 2022 03:14
Golang linting one liner
go install github.com/mgechev/revive@latest && go install honnef.co/go/tools/cmd/staticcheck@latest && go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest && echo 'Output for "go vet ./...":' && go vet ./... || true && echo 'Output for "staticcheck ./...":' && staticcheck ./... || true && echo 'Output for "revive ./...":' && revive ./... || true && echo 'Output for "golangci-lint run":' && golangci-lint run
@MicahParks
MicahParks / vault_login.go
Created June 9, 2021 23:21
Golang Vault login authentication using AWS
package vault
import (
"encoding/base64"
"encoding/json"
"fmt"
"io/ioutil"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/sts"
@MicahParks
MicahParks / go get private GitLab with group and subgroup (Golang modules).md
Last active January 12, 2024 05:43
go get private GitLab with group and subgroup (Golang modules)

Problem

The go command line tool needs to be able to fetch dependencies from your private GitLab, but authenticaiton is required.

This assumes your private GitLab is hosted at privategitlab.company.com.

Environment variables

The following environment variables are recommended:

export GO111MODULE=on
export GOPRIVATE=privategitlab.company.com
@MicahParks
MicahParks / cereal.py
Created December 1, 2020 02:09
Cereal generator
#!/usr/bin/env python
"""
Create successive serials based on a given character list. Optionally, provide a starting point for creating serials.
Use this when you need to generate unique serials for things (where variable length is acceptable).
"""
# Start standard library imports.
from string import ascii_lowercase, digits
from typing import Generator, List
# End standard library imports.