Skip to content

Instantly share code, notes, and snippets.

Working from home

Mohan Balasundaram tuxfight3r

Working from home
View GitHub Profile
tuxfight3r /
Created Feb 24, 2021 — forked from mjuric/
Useful Kafka wrangling commands

Utilities you'll care about

All these are already installed on epyc.

  • kafkacat (conda install -c conda-forge kafkacat)

  • kt (grab it from

  • kafka-* (come with kafka, if you yum install if from Confluent's repo, or via Docker if you're so inclined). Warning -- JVM based and dreadfully slow.

  • jq (conda install -c conda-forge jq or use your favorite package manager)

View avro_tricks.txt
# get schema
java -jar ../avro-tools-1.10.1.jar getschema twitter.avro
# get meta
java -jar ../avro-tools-1.10.1.jar getmeta twitter.avro
#create avro
java -jar ../avro-tools-1.10.1.jar fromjson --schema-file twitter.avsc twitter.json > twitter.avro
tuxfight3r / git-gpg-sign.txt
Created Feb 24, 2021
signing git commits with GPG keys.
View git-gpg-sign.txt
# generate a key if you don't have one already
gpg --full-gen-key
# list the keys in long format and copy the key id after sec rsa4096/<KEY>
gpg --list-secret-keys --keyid-format LONG
# export the public key and post into your git profile (ui)
gpg --armor --export 127CAA89CEA6BE66
tuxfight3r /
Created Feb 4, 2021 — forked from subfuzion/
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

tuxfight3r /
Created Jan 26, 2021 — forked from soheilhy/
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for,, and on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

tuxfight3r / nginx.conf
Created Aug 19, 2020 — forked from nrollr/nginx.conf
NGINX config for SSL with Let's Encrypt certs
View nginx.conf
# UPDATED 17 February 2019
# Redirect all HTTP traffic to HTTPS
server {
listen 80;
listen [::]:80;
return 301 https://$host$request_uri;
# SSL configuration
tuxfight3r /
Created Jul 15, 2020 — forked from res0nat0r/
Enable MFA for s3 bucket
aws s3api put-bucket-versioning \
	--bucket bucket \
	--versioning-configuration '{"MFADelete":"Enabled","Status":"Enabled"}' \
	--mfa 'arn:aws:iam::aws_account_id:mfa/root-account-mfa-device passcode'
aws s3api get-bucket-versioning --bucket bucket
tuxfight3r /
Created Jul 11, 2020
ruby diff 2 yaml files and awesome print
ruby -rhashdiff -rawesome_print -ryaml \
-e "ap HashDiff.diff(*{|f| YAML.load_file(f)})" template.yaml processed.yml
tuxfight3r /
Last active Jun 30, 2020
install stress on amazon linux 2
sudo amazon-linux-extras install epel -y
sudo yum install stress -y
#Run stress for 5mins
sudo stress --cpu 1 --timeout 320
tuxfight3r /
Created Jun 29, 2020 — forked from radiofrequency/
Import lets encrypt cert to aws certificate manager in renew hook
#place in /etc/letsencrypt/renewal-hooks/post
#certs must be in us-east-1 to use with cloudfront
export AWS_DEFAULT_REGION=us-east-1
#run without --certificate-arn first time then specify arn for updates
aws acm import-certificate --certificate file:///etc/letsencrypt/live/ --private-key file:///etc/letsencrypt/live/ --certificate-chain file:///etc/letsencrypt/live/ --certificate-arn specifyarnforupdate