Skip to content

Instantly share code, notes, and snippets.

Avatar

dasgoll

  • Amman, Jordan
View GitHub Profile
@dasgoll
dasgoll / alias
Created Aug 8, 2020 — forked from jamesls/alias
AWS CLI v2 upgrade aliases.
View alias
[toplevel]
# Put this in ~/.aws/cli/alias
# and you'll have an "aws upgrade"
# and an "aws check-upgrade" command.
#
# Only works on macOS and installs using
# the .pkg installer.
#
upgrade = !f() {
curl -s "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "/tmp/AWSCLIV2.pkg"
@dasgoll
dasgoll / gist:e88f3f0e15b749c170883414efe415f3
Created Jun 23, 2020
How to find out which Go version built your binary
View gist:e88f3f0e15b749c170883414efe415f3
% dlv exec $HOME/bin/godoc
Type 'help' for list of commands.
(dlv) b main.main
Breakpoint 1 set at 0x15596eb for main.main() ./golang.org/x/tools/cmd/godoc/main.go:156
(dlv) c
> main.main() ./golang.org/x/tools/cmd/godoc/main.go:156 (hits goroutine(1):1 total:1) (PC: 0x15596eb)
151: }
152: }
153: log.Fatalf("too many redirects")
154: }
View gist:e6e69b7a0ab253d18386d483263fbacb
git clone
cd dir
git config credential.helper cache
git credential-cache exit
or remove
.git-credential-cache/socket
View gist:4d5bc427f9db467c40c0351ceb69450b
mkdir /tmp/{stg,prod}
Choice Parameter
Name = Environment
Choices
stg
prod
File Parameter
@dasgoll
dasgoll / gist:43356a2d705ca6122cd05a7077daf52c
Created Apr 3, 2020
AWS RDS attach instance to cluster or instance as replica
View gist:43356a2d705ca6122cd05a7077daf52c
SourceDBInstanceIdentifier
determines whether a DB instance is a Read Replica
DBClusterIdentifier
The identifier of the DB cluster that the instance will belong to.
View 00_seq_loop.yml
---
- hosts: vm_dummy_group
gather_facts: no
tasks:
- name: Test loop
debug:
msg: "Spinning up VM number {{ item }}"
with_sequence: start={{ start }} end={{ end }}
View gist:06a74fc0e7e4525068d5fa0ee87a0621
{
"Id": "Policy1584719594659",
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1584719592995",
"Action": [
"s3:GetObject"
],
"Effect": "Allow",
View gist:5d778cb9da5ca6a4a3ffc8665132fa2d
# On Amazon Linux 2
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install -y python2-certbot-apache.noarch
certbot -i apache -a manual \
--preferred-challenges dns -d test.example.com
View gist:efdd4d409eeda3b318937b74115c5acc
sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
@dasgoll
dasgoll / install-k8s-ubuntu.sh
Created Mar 2, 2020 — forked from jogy/install-k8s-ubuntu.sh
Installing a single node Kubernetes on Ubuntu with kubeadm
View install-k8s-ubuntu.sh
# 1) Install Kubernetes on a Ubuntu machine
sudo -i
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
echo 'deb http://apt.kubernetes.io/ kubernetes-xenial main' >> /etc/apt/sources.list.d/kubernetes.list
apt update && apt install -y docker.io kubelet kubeadm kubectl
sudo systemctl enable docker.service
kubeadm init --pod-network-cidr=10.244.0.0/16 # Flannel pod network, see below
exit
# 2) Prepare kubectl
You can’t perform that action at this time.