Skip to content

Instantly share code, notes, and snippets.

@dcaughill
dcaughill / es_cheatsheet.sh
Created June 19, 2020 12:30
Eventstore cheatsheet
// cluster http call to json
http://<url>:2113/gossip?format=json
@dcaughill
dcaughill / manage-tf-versions-tfenv.txt
Last active June 16, 2020 16:50
Managing Terraform versions/environments with tfenv
// Install tfenv
homebrew install tfenv
//Browse Terraform versions
$ tfenv list-remote
0.12.0
0.12.0-rc1
0.12.0-beta2
0.12.0-beta1
#sample secret yaml with plain text stringData mechanism
apiVersion: v1
stringData:
someCredentialName: someSuperSecretCredential
kind: Secret
metadata:
name: someSecretName
namespace: someNamespace
type: Opaque
@dcaughill
dcaughill / redis_cheatsheet.txt
Created October 15, 2019 19:16
Redis cheatsheet
//Install redis cli for connectivity testing from containers
apt-get update
apt-get install redis-tools
//Ping test
redis-cli -c -h redis-cluster-name.xxxxxx.clustercfg.use1.cache.amazonaws.com -p 6379 ping
//Monitor incoming writes
redis-cli -c -h redis-cluster-name.xxxxxxxxxxx.clustercfg.use1.cache.amazonaws.com -p 6379 monitor
@dcaughill
dcaughill / postgresql-cheatsheet.txt
Created April 11, 2019 13:42
PostgreSQL Cheatsheet
////Install and connect to PostgreSQL via CLI////
//Install the psql cli tool
yum install psql
//Then connect via the utility with the following flags
psql \
--host=some-path.cluster-abcdefghijklmnop.us-east-1.rds.amazonaws.com \
--port=5432 \
--username=your_username \
@dcaughill
dcaughill / networking-cheatsheet.sh
Last active September 27, 2020 13:42
Networking Cheatsheet
// Find your hostname and IP
hostname -i //ip
hostname -f //long host name (FQDN)
TODO:
netstat
ifconfig
dig
@dcaughill
dcaughill / kube-cheatsheet.sh
Last active September 27, 2020 13:43
kube-cheatsheet.sh
kubectl create namespace <mynamespace>
kubectl get namespaces
kubectl get pods
kubectl config view
kubectl cluster-info dump
#exec into a shell within a running pod
kubectl exec -it <pod_name> -n <namespace> -- /bin/bash
@dcaughill
dcaughill / aws-cli-cheatsheet.txt
Last active June 18, 2019 18:53
AWS CLI Cheatsheet
//Find EC2 Instnaces by AMI
aws ec2 describe-instances --query 'Reservations[*].Instances[*].[Placement.AvailabilityZone, State.Name, ImageId, InstanceId]' --filters "Name=image-id, Values=ami-xxxxxx" --output=text
//// Find EC2 Instances by tag ////
//Instnaces missing the `name` tag
aws ec2 describe-instances \
--output text \
--query 'Reservations[].Instances[?!not_null(Tags[?Key == `Name`].Value)] | [].[InstanceId]'
@dcaughill
dcaughill / kafka-cheatsheet.md
Last active June 3, 2019 21:50
kafka cheatsheet

Start Zookeeper

bin/zookeeper-server-start.sh config/zookeeper.properties

Start Kafka

bin/kafka-server-start.sh config/server.properties

@dcaughill
dcaughill / install_kafka.md
Last active January 17, 2019 21:16 — forked from sam95/install_kafka.md
Installation and Getting started with Apache-Kafka for OSX

Apache Kafka is a highly-scalable publish-subscribe messaging system that can serve as the data backbone in distributed applications. With Kafka’s Producer-Consumer model it becomes easy to implement multiple data consumers that do live monitoring as well persistent data storage for later analysis. You can assume that RabbitMQ is similar to Kafka, You do get an option for message-sending or Broadcasting. The installation process for OSX is as below.

  1. The best way to install the latest version of the Kafka server on OS X and to keep it up to date is via Homebrew.

     brew search kafka
     brew install kafka 
    
  2. The above commands will install a dependency called zookeeper which is required to run kafka. Start the zookeeper service.

zkserver start