Skip to content

Instantly share code, notes, and snippets.

View StevenACoffman's full-sized avatar

Steve Coffman StevenACoffman

View GitHub Profile
@StevenACoffman
StevenACoffman / GPG_and_GIT.md
Last active March 9, 2024 22:10 — forked from JamesOBenson/Generating a secure SSH Key and commands
SSH Generation and commands for GIT and GPG

GPG and GIT and SSH ... OH MY!

ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C [email protected] -N ''
  • Then you won't be prompted for a passphrase. However, if you did have a passphrase:
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C [email protected] -N 'Really do not use this passphrase'
  • Then you will be prompted to type your passphrase every time you interact with git remote (pull, push, fetch, etc.) This is intolerable.
@StevenACoffman
StevenACoffman / git-auto-sign-commits.sh
Last active March 22, 2025 19:38 — forked from mort3za/git-auto-sign-commits.sh
Auto sign your git commits
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C [email protected] -N ''
# -o : Save the private-key using the new OpenSSH format rather than the PEM format. Actually, this option is implied when you specify the key type as ed25519.
# -a: It’s the numbers of KDF (Key Derivation Function) rounds. Higher numbers result in slower passphrase verification, increasing the resistance to brute-force password cracking should the private-key be stolen.
# -t: Specifies the type of key to create, in our case the Ed25519.
# -f: Specify the filename of the generated key file. If you want it to be discovered automatically by the SSH agent, it must be stored in the default `.ssh` directory within your home directory.
# -C: An option to specify a comment. It’s purely informational and can be anything. But it’s usually filled with <login>@<hostname> who generated the key.
# -N: Provides the new passphrase.
eval "$(ssh-agent -s)"
ssh-add -K ~/.ssh/id_ed25519
@StevenACoffman
StevenACoffman / checkWorktreeIsClean.go
Created August 20, 2019 23:33
Check if git working directory is clean
///usr/bin/env go run "$0" "$@" ; exit "$?"
package main
import (
"fmt"
"gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/config"
"gopkg.in/src-d/go-git.v4/plumbing"
"gopkg.in/src-d/go-git.v4/plumbing/format/gitignore"
"io/ioutil"
@StevenACoffman
StevenACoffman / checkIsHeadPushed.go
Created August 20, 2019 19:01
Check if git HEAD pushed to origin/master?
///usr/bin/env go run "$0" "$@" ; exit "$?"
package main
import (
"fmt"
"os"
"gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/plumbing"
)
@StevenACoffman
StevenACoffman / WhyGo.md
Last active February 6, 2020 22:37
Why Golang?
@StevenACoffman
StevenACoffman / GolangSeparatingUnitTestsAndIntegrationTests.md
Last active November 6, 2019 17:50
Separating unit tests and integration tests in Go

From this stackoverflow answer:

@Ainar-G suggests several great patterns to separate tests.

[This set of Go practices from SoundCloud][1] recommends using build tags ([described in the "Build Constraints" section of the build package][2]) to select which tests to run:

Write an integration_test.go, and give it a build tag of integration. Define (global) flags for things like service addresses and connect strings, and use them in your tests.

// +build integration

>

@StevenACoffman
StevenACoffman / Dockerfile
Created August 1, 2019 20:53 — forked from pgilad/Dockerfile
Minimal Spring Boot 2 on Docker Alpine with Java 11 (Using Jigsaw modules)
FROM alpine:3.8 AS builder
WORKDIR /opt
ARG JDK_TAR=openjdk-11+28_linux-x64-musl_bin.tar.gz
ARG JDK_DOWNLOAD_PREFIX=https://download.java.net/java/early_access/alpine/28/binaries
RUN wget -q "$JDK_DOWNLOAD_PREFIX/$JDK_TAR" && \
wget -q "$JDK_DOWNLOAD_PREFIX/$JDK_TAR.sha256"
RUN cat $JDK_TAR.sha256 | xargs -I{} echo "{} $JDK_TAR" | sha256sum -c - && \
@StevenACoffman
StevenACoffman / deploy-create-react-app-with-nginx.md
Created June 14, 2019 17:52 — forked from huangzhuolin/deploy-create-react-app-with-nginx.md
[Deploy create-react-app(react-router) with nginx] #react #nginx

Create-react-app

Create React apps with no build configuration.

Thanks to create-react-app. It's saves a lot of my time. I remember several months ago I had to setup a lot just for a react app, webpack, babel, test environment and so on... Fortunately, everything becomes easy now. Though you have many choices of start boiler plate, you worth trying this.

React router

If you are build a SPA with react, you probably use react-router.