Skip to content

Instantly share code, notes, and snippets.

@Nilpo
Nilpo / BIND for the Small LAN.md
Last active February 26, 2025 02:42
How to configure BIND 9 to act as a caching nameserver or as the nameserver for a local domain.
@clstokes
clstokes / assume-role-policy.json
Last active September 1, 2022 20:15
Example: Terraform IAM Role
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "sts:AssumeRole",
"Principal": {
"Service": "ec2.amazonaws.com"
},
"Effect": "Allow",
"Sid": ""
@alces
alces / ansible_local_playbooks.md
Last active February 18, 2025 04:19
How to run an Ansible playbook locally
  • using Ansible command line:
ansible-playbook --connection=local 127.0.0.1 playbook.yml
  • using inventory:
127.0.0.1 ansible_connection=local
@lucijafrkovic
lucijafrkovic / git_retag
Created April 28, 2016 14:02
Retagging on git
1. list all remote tags
git ls-remote --tags
2. delete local tag
git tag -d V_1_0_1
3. push tag deletion to remote
git push origin :refs/tags/V_1_0_1
4. tag local branch again
@simonluijk
simonluijk / otp_to_qrcode.py
Created February 21, 2016 18:29
Simple command to create a QR code from an OTP secret
#!/usr/bin/env python
import argparse
import qrcode
def main():
parser = argparse.ArgumentParser(description='Generate QR code for OTP.')
parser.add_argument('user', nargs=1)
parser.add_argument('key', nargs=1)
parser.add_argument('issuer', nargs=1)
@wavded
wavded / go-ci-build.sh
Last active March 1, 2023 23:30
Go Jenkins CI Script - golang
#!/bin/bash
# Go build script that runs cloc, cpd, lint, vet, test and coverage for Jenkins
#
# Outside tools include:
# gocov: go get github.com/axw/gocov
# gocov-xml: go get github.com/t-yuki/gocov-xml
# go2xunit: go get bitbucket.org/tebeka/go2xunit
# jscpd: npm i jscpd -g
# cloc: npm i cloc -g
@iamralch
iamralch / ssh_client.go
Last active August 21, 2024 05:26
SSH client in GO
package main
import (
"fmt"
"io"
"io/ioutil"
"net"
"os"
"strings"
@denji
denji / golang-tls.md
Last active March 29, 2025 16:46 — forked from spikebike/client.go
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@joemiller
joemiller / pantheon-check-ping-endpionts.rb
Created June 18, 2013 15:56
a meta-check for sensu that creates many other checks
#!/usr/bin/env ruby
#
# this is a special meta-check. It runs ping checks against all hosts in
# the /endpoints API and sends individual results directly to sensu-client via
# the udp/3030 client socket. this is different from the normal sensu check model
# where individual scripts run and their exit status and output is used to create
# a single event.
#
# the reason for this check is to be able to dynamically ping a list of hosts
# without the race conditions and timing issues involved with creating individual
@scarolan
scarolan / movein.sh
Created June 12, 2013 14:25
movein.sh - Nice little "move in" script from O'Reilly's excellent Linux Server Hacks book.
#!/bin/sh
# movein.sh - shamelessly stolen from O'Reilly's excellend "Linux Server Hacks"
# http://oreilly.com/pub/h/72
# Version 0.2 - Added some comments and error checking
if [ -z "$1" ]; then
echo "Usage: `basename $0` hostname"
exit
fi