Skip to content

Instantly share code, notes, and snippets.

View kudosqujo's full-sized avatar

qujo kudosqujo

View GitHub Profile
@kudosqujo
kudosqujo / aws_vpc-routing_and_ACLs.sh
Created September 22, 2022 00:13
[AWS CLI Routing & ACLs] #aws #vpc #acl #tutorial
# Create internet gateways, route tables, and corresponding ACLs in AWS VPC to secure our network.
# create internet gateway
aws ec2 create-internet-gateway
# attach internet gateway to a vpc
aws ec2 attach-internet-gateway --internet-gateway-id igw-06604b3e --vpc-id vpc-ad6bd2f7
# create a route table
aws ec2 create-route-table --vpc-id vpc-ad6bd2f7
@kudosqujo
kudosqujo / howto-install_a_binary_package.bash
Created February 9, 2021 02:18
[HOWTO: Install a Binary] #cli #howto
# example: installation of `kops` utility
curl -Lo kops https://github.com/kubernetes/kops/releases/download/$(curl -s https://api.github.com/repos/kubernetes/kops/releases/latest | grep tag_name | cut -d '"' -f 4)/kops-darwin-amd64
chmod +x kops
sudo mv kops /usr/local/bin/kops
@kudosqujo
kudosqujo / howto-download_a_file.md
Last active February 9, 2021 02:17
[HOWTO: Download a file from the Command Line] #cli #howto

HOWTO: Download a File from the Command Line

Using Curl

Download a file off of Github

NOTE: You can view the raw contents of a file by clicking on the Raw button that appears above the file view.

curl -Lo  https://raw.githubusercontent.com/path/to/file
@kudosqujo
kudosqujo / install.on_linux.sh
Created December 2, 2020 23:56
[HOWTO: Install PIP] #howto #tips #python #pip #linux
apt update && apt upgrade # update apt utility and upgrade already installed packages
apt install python-pip # install tool
# tip: if unable to install older version of pip, run this:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py; python get-pip.py
@kudosqujo
kudosqujo / file_system.sh
Created December 2, 2020 23:54
[Linux Tips] #linux #cheatsheet #tips
cat /proc/meminfo # print memory info about the machine
sudo /etc/init.d/<app> start # start an app/service
sudo /etc/init.d/<app> stop # stop an app/service
@kudosqujo
kudosqujo / cli.sh
Last active June 4, 2021 17:23
[kubectl Cheatsheet] #kubectl #cheatsheet
kubectl rollout restart deploy <release> # bounce a release
kubectl delete ns <name> # destroy a namespace
@kudosqujo
kudosqujo / basics.sh
Created November 30, 2020 02:01
[Vagrant CLI] #vagrant #cheatsheet #virtualbox
vagrant --version
vagrant box add bento/ubuntu-14.04 # install Ubuntu image
vagrant init bento/ubuntu-14.04 # initialize image
vagrant up # run image
vagrant ssh # ssh into running container
# addition vagrant commands
vagrant status # check status of the VM
vagrant suspend # suspend the VM
@kudosqujo
kudosqujo / basics.sh
Created November 30, 2020 01:58
[Chef CLI] #chef #cheatsheet #vagrant
sudo chef-client --local-mode --runlist 'recipe[chef-workstation]'
sudo chef-client --help
# /etc/chef/client.rb => manages the execution of the chef client run
@kudosqujo
kudosqujo / benchmark.rb
Created November 30, 2020 01:41
[Ruby Benchmark]
# Copy this into an irb session for easy benchmark testing
require 'benchmark'
# @param labels_and_procs [Hash{String=>Proc}]
def bm_test(labels_and_procs, n = 1000, label_width = 7)
puts "running #{n} times"
::Benchmark.bm(label_width) do |x|
labels_and_procs.each do |label, proc|
x.report("#{label}:") { n.times { proc.call } }
@kudosqujo
kudosqujo / basics.sh
Last active September 22, 2021 00:25
[AWS CLI] #aws #cheatsheet #ec2 #s3 #eks
### Walkthrough #1: Create our first virtual machine in the cloud
# get list of commands useful for EC2
aws ec2 help | grep "\sdescribe"
# create an SSH keypair for AWS
aws ec2 create-key-pair --key-name MyKeyPair --query 'KeyMaterial' --output text > MyKeyPair.pem
# verify that AWS knows about our newly created key
aws ec2 describe-key-pairs --key-name MyKeyPair