Skip to content

Instantly share code, notes, and snippets.

@0atman
0atman / configuration.nix
Last active November 15, 2024 13:06
A rebuild script that commits on a successful build
{
config,
pkgs,
options,
...
}: let
hostname = "oatman-pc"; # to alllow per-machine config
in {
networking.hostName = hostname;
export AWS_ORG_CONFIG_FILE_PREFIX=config-
export AWS_ORG_CREDENTIALS_FILE_PREFIX=credentials-
awsorg() {
local org=$1
if [[ -z "$org" ]]; then
unset AWS_ORG
unset AWS_CONFIG_FILE
unset AWS_SHARED_CREDENTIALS_FILE
@clarkezone
clarkezone / main.go
Last active September 11, 2020 03:05
Hello World for a SSH using Let's Encrypt in GoLang using nGrok and acme autocert
package main
import (
"crypto/tls"
"log"
"net/http"
"fmt"
"golang.org/x/crypto/acme/autocert"
)
@chrispruitt
chrispruitt / generate_atlantis_yaml.sh
Last active February 18, 2020 13:15
Auto generate atlantis.yaml file for terraform repository
#!/bin/bash
# Run this file at the root level of your terraform repo to generate your basic atlantis.yaml file
# This file is somewhat specific to my needs so it will probably need some tweaking for your own terraform setup
ATLANTIS_YAML="atlantis.yaml"
TERRAFORM_VERSION="v0.11.11"
WORKSPACES="dev tst stg prd"
touch ${ATLANTIS_YAML}
@phemmer
phemmer / defer.sh
Last active September 18, 2024 07:58
bash defer function - just like go's defer()
function _run_deferred() {
local _depth="$BASHPID.${#FUNCNAME[@]}"
[[ "$_depth" != "$_deferred_depth" ]] && return
local opt=$-
set +e
for (( i=${#_deferred[@]} - 1; i >= 0; i-- )); do
eval "${_deferred[i]}"
done
[[ "$opt" == *e* ]] && set -e
}
@prologic
prologic / SelfHosted.md
Last active October 3, 2024 22:16
Self-hosted Golang apps by James Mills / prologic

Self-Hosted Go (Golang) Web Apps

  • golinks - golinks is a web app that allows you to create smart bookmarks, commands and aliases by pointing your web browser's default search engine at a running instance. Similar to bunny1 or yubnub. (Demo) MIT Go
  • notes - notes is a self-hosted note taking web app that lets you keep track of your notes and search them in a easy and minimal way. (Demo) MIT Go
  • pastebin - pastebin is a simple pastebin service with convenient CLI. (Demo) MIT Go
  • shorturl - shorturl is a simple URL shortener with very tiny URL(s). (Demo) MIT Go
  • todo - todo is a simple todo manager. (Demo) MIT Go
  • [wiki](https://git.mills.io/prolog
@AfroThundr3007730
AfroThundr3007730 / 00-clamav-notes.sh
Last active February 5, 2022 05:54
My notes on getting ClamAV working on CentOS 7
# How to get ClamAV working on CentOS 7
yum -y install epel-release && yum -y update
yum -y install clamav clamav-data clamav-scanner clamav-scanner-systemd clamav-server clamav-server-systemd clamav-unofficial-sigs clamav-update
# Add /etc/clamd.d/freshclam.conf
# Add /usr/lib/systemd/system/clamav-freshclam.service
systemctl enable clamav-freshclam.service && systemctl start clamav-freshclam.service
@oinopion
oinopion / read-access.sql
Created October 5, 2016 13:00
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
@leonardofed
leonardofed / README.md
Last active November 14, 2024 13:37
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@karalabe
karalabe / main.go
Last active October 23, 2023 18:21
Access Google services through service accounts in Go
package main
import (
"code.google.com/p/goauth2/oauth/jwt"
"code.google.com/p/google-api-go-client/storage/v1beta2"
"fmt"
"log"
"regexp"
)