Skip to content

Instantly share code, notes, and snippets.

@koshatul
koshatul / README.md
Last active November 18, 2020 06:55
Testing errorlint

Error wrapping test

$ golangci-lint --version
golangci-lint has version 1.32.2 built from 52d26a3 on 2020-11-03T01:15:38Z
$ golangci-lint run --enable-all ./...
main.go:33:45: non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
@koshatul
koshatul / README.md
Last active April 29, 2024 17:13
use Apple Keychain to store GPG Passphrases

gpg-agent setup

Need to setup gpg-agent first, on OSX I use keychain (it also does ssh-agent)

$ brew info keychain
keychain: stable 2.8.5
User-friendly front-end to ssh-agent(1)
https://www.funtoo.org/Keychain
/usr/local/Cellar/keychain/2.8.5 (7 files, 108.5KB) *
@koshatul
koshatul / sslCertSplit.sh
Created July 16, 2018 03:07
SSL CA bundle split and openssl on each certificate
#!/bin/bash
set +e
CA_BUNDLE="${1}"
shift
if [ ! -s "${CA_BUNDLE}" ]; then
echo "usage: ${0} <ca bundle file> [openssl commands]"
echo "example: ${0} ca-bundle.pem -noout -subject -issuer"
@koshatul
koshatul / tell-application-password.applescript
Created July 9, 2018 22:50
Applescript OSX method of typing password into apps that block copy/paste
tell application "Franz"
activate
end tell
tell application "System Events"
keystroke "my-really-long-password-from-1password"
end tell
@koshatul
koshatul / pdagent-install.sh
Created May 21, 2018 04:25
Install Pagerduty Agent on Ubuntu
#!/bin/bash
set -ex
## Install Pagerduty Agent on Ubuntu 16.04 (and probably future versions)
## curl -sSL 'https://gist.githubusercontent.com/koshatul/2aac09cc47447cea8722af34d853f17e/raw/pdagent-install.sh' | /bin/bash /dev/stdin --
sudo apt-get install -qy --no-install-recommends \
apt-transport-https \
ca-certificates \
curl
@koshatul
koshatul / uninstall-portworx.sh
Last active March 30, 2021 05:29
Uninstall script for portworx.
#!/bin/bash
set -ex
## Uninstall portworx on Ubuntu 16.04 (and probably future versions)
## curl -sSL 'https://gist.githubusercontent.com/koshatul/407c09b2aeff92d2bd59533c4ccec983/raw/uninstall-portworx.sh' | /bin/bash /dev/stdin --
set +ex
sudo systemctl stop portworx
sudo systemctl disable portworx
@koshatul
koshatul / ucaresystem-install.sh
Last active September 12, 2021 17:54
Install ucaresystem-core on Ubuntu 16.04 and potentially above
#!/bin/bash
## Install uCareSystem on Ubuntu 16.04 (and probably future versions)
## curl -sSL 'https://gist.githubusercontent.com/Koshatul/d70e5a658a034facd05de7ff1a526b62/raw/ucaresystem-install.sh' | /bin/bash
sudo apt-get install -y apt-transport-https software-properties-common
sudo add-apt-repository -y ppa:utappia/stable
sudo apt-get update
sudo apt-get -y install ucaresystem-core
@koshatul
koshatul / powerdns-ubuntu-install.sh
Last active May 1, 2019 01:28
PowerDNS 4.x Repo installer for Ubuntu
#!/bin/bash
curl -fsSL https://repo.powerdns.com/CBC8B383-pub.asc | sudo apt-key add -
curl -fsSL https://repo.powerdns.com/FD380FBB-pub.asc | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] http://repo.powerdns.com/ubuntu $(lsb_release -cs)-auth-40 main"
sudo add-apt-repository "deb [arch=amd64] http://repo.powerdns.com/ubuntu $(lsb_release -cs)-rec-40 main"
echo "Package: pdns-*
Pin: origin repo.powerdns.com
@koshatul
koshatul / docker-install.sh
Last active May 4, 2018 05:43
Updated docker-install for bionic (when docker releases it)
#!/bin/bash
set -ex
## Install Docker on Ubuntu 16.04 (and probably future versions)
## curl -sSL 'https://gist.githubusercontent.com/koshatul/fa7d71fc38037dbd3094be400f77bf74/raw/docker-install.sh' | /bin/bash /dev/stdin --
sudo apt-get install -qy --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \

Keybase proof

I hereby claim:

  • I am koshatul on github.
  • I am kosh (https://keybase.io/kosh) on keybase.
  • I have a public key ASASVFvb8Yngslnj7PAa1Od5urSVKJN9MpUVYK_U36lr2wo

To claim this, I am signing this object: