This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/bash | |
go_dir="/usr/local/go" | |
version=${1} | |
version_dir="#unset#" | |
dl_url="#unset#" | |
gos_dir="/usr/local/gos" | |
tar_file=".temp-go.tar.gz" | |
temp_dir=".temp" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"reflect" | |
) | |
type testStruct struct { | |
A int | |
B string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type T struct { | |
A int | |
B string | |
} | |
t := T{23, "skidoo"} | |
s := reflect.ValueOf(&t).Elem() | |
typeOfT := s.Type() | |
for i := 0; i < s.NumField(); i++ { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://jqplay.org/s/DljtxNX_72 | |
.ResourceRecordSets[] | select (.Type=="A") | |
.[] | select (.Name | contains( "mobile")) | |
aws route53 list-hosted-zones | jq '.HostedZones | .[] | select (.Name | contains( "cloud.bumble.cau"))' | |
aws ec2 describe-instances | jq '.Reservations[].Instances[] | select (.NetworkInterfaces[].PrivateIpAddress == "172.22.13.60")' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_ebs_volume" "elasticsearch_master" { | |
count = 3 | |
availability_zone = "${lookup(var.azs, count.index)}" | |
size = 8 | |
type = "gp2" | |
tags { | |
Name = "elasticsearch_master_az${count.index}.${var.env_name}" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSTANCE_ID=`curl http://169.254.169.254/latest/meta-data/instance-id` | |
# wait for ebs volume to be attached | |
while : | |
do | |
# self-attach ebs volume | |
aws --region us-east-1 ec2 attach-volume --volume-id ${volume_id} --instance-id $INSTANCE_ID --device ${device_name} | |
if lsblk | grep ${lsblk_name}; then | |
echo "attached" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while [ ! -e /dev/xvdf ]; do sleep 1; done | |
fstab_string='/dev/xvdf /data ext4 defaults,nofail,nobootwait 0 2' | |
if grep -q -F -v "$fstab_string" /etc/fstab; then | |
echo "$fstab_string" | sudo tee -a /etc/fstab | |
fi | |
sudo mkdir -p /data && sudo mount -t ext4 /dev/xvdf /data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://csharpindepth.com/Articles/General/Singleton.aspx#nested-cctor | |
public sealed class Singleton | |
{ | |
private Singleton() | |
{ | |
} | |
public static Singleton Instance { get { return Nested.instance; } } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://raw.githubusercontent.com/pixelb/ps_mem/master/ps_mem.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################################## | |
# To run: | |
# curl -sSL https://gist.githubusercontent.com/yakaas/c8ed85e6e5173e5b9852/raw/5945de1f91be09302f70280d6d00d3f5f8505a42/Install-Docker-on-Linux-Mint.sh | bash -x | |
########################################## | |
# Check that HTTPS transport is available to APT | |
if [ ! -e /usr/lib/apt/methods/https ]; then | |
sudo apt-get update | |
sudo apt-get install -y apt-transport-https | |
fi |