Skip to content

Instantly share code, notes, and snippets.

View vadirajks's full-sized avatar

Vadiraj K.S vadirajks

View GitHub Profile
@vadirajks
vadirajks / redshift_performance_tuning.sql
Created August 3, 2016 08:52 — forked from bobbydennett/redshift_performance_tuning.sql
Redshift performance tuning-related queries
--------------------
-- Incorrect column encoding
--------------------
SELECT database, schema || '.' || "table" AS "table", encoded, size
FROM svv_table_info
WHERE encoded='N'
ORDER BY 2;
SELECT trim(n.nspname || '.' || c.relname) AS "table",trim(a.attname) AS "column",format_type(a.atttypid, a.atttypmod) AS "type",
@vadirajks
vadirajks / ec2-ssh
Created August 9, 2016 10:07 — forked from mo-ya/ec2-ssh
#!/bin/sh
## EC2 automation login tool
#
# Original: http://m.igrs.jp/blog/2013/03/14/ec2-ssh/
# https://gist.github.com/migrs/5157665
# https://gist.github.com/MichinobuMaeda/5545875
#
# Changed by mo-ya (2013-07-06)
#
@vadirajks
vadirajks / debian-init.sh
Created October 28, 2017 11:05 — forked from andsens/debian-init.sh
This is a generic init-script, easily modifiable to suit your needs. It uses quite a lot of lsb init-functions and adheres to the lsb standards.
#!/bin/sh
### BEGIN INIT INFO
# Provides: generic-prog
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Generic Program
# Description: Generic Program is a generic program to do generic things with
### END INIT INFO
@vadirajks
vadirajks / kafka-cheat-sheet.md
Created July 6, 2018 13:04 — forked from sahilsk/kafka-cheat-sheet.md
Apache Kafka Cheat Sheet

Kafka Cheat Sheet

Display Topic Information

$ kafka-topics.sh --describe --zookeeper localhost:2181 --topic beacon
Topic:beacon	PartitionCount:6	ReplicationFactor:1	Configs:
	Topic: beacon	Partition: 0	Leader: 1	Replicas: 1	Isr: 1
	Topic: beacon	Partition: 1	Leader: 1	Replicas: 1	Isr: 1
@vadirajks
vadirajks / aws_autoscaling_multi_ssh.sh
Created May 4, 2019 11:00 — forked from Ahmadposten/aws_autoscaling_multi_ssh.sh
Use tmux to ssh to all instances of an AWS autoscaling group and execute commands simultaneously.
#!/bin/bash
#
# _ _ _
# ____ | | | | | |
# / __ \ __ _| |__ _ __ ___ __ _ __| |_ __ ___ ___| |_ ___ _ __
# / / _` |/ _` | '_ \| '_ ` _ \ / _` |/ _` | '_ \ / _ \/ __| __/ _ \ '_ \
# | | (_| | (_| | | | | | | | | | (_| | (_| | |_) | (_) \__ \ || __/ | | |
# \ \__,_|\__,_|_| |_|_| |_| |_|\__,_|\__,_| .__/ \___/|___/\__\___|_| |_|
# \____/ | |
# |_|
@vadirajks
vadirajks / linux-cheatsheet.rtf
Created July 13, 2019 07:07 — forked from 101t/linux-cheatsheet.rtf
Comprehensive Linux Cheatsheet
```
____ _ _
/ ___|___ _ __ ___ _ __ _ __ ___| |__ ___ _ __ ___(_)_ _____
| | / _ \| '_ ` _ \| '_ \| '__/ _ \ '_ \ / _ \ '_ \/ __| \ \ / / _ \
| |__| (_) | | | | | | |_) | | | __/ | | | __/ | | \__ \ |\ V / __/
\____\___/|_| |_| |_| .__/|_| \___|_| |_|\___|_| |_|___/_| \_/ \___|
|_|
_ _ ____ _ _ _ _
| | (_)_ __ _ ___ __ / ___| |__ ___ __ _| |_ ___| |__ ___ ___| |_
| | | | '_ \| | | \ \/ / | | | '_ \ / _ \/ _` | __/ __| '_ \ / _ \/ _ \ __|
@vadirajks
vadirajks / sed cheatsheet
Created August 12, 2019 09:29 — forked from un33k/sed cheatsheet
magic of sed -- find and replace "text" in a string or a file
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
$ aws pricing describe-services \
  --region us-east-1 \
| jq -r '.Services[] | select (.ServiceCode=="AmazonEC2") | .AttributeNames[]' \
| sort
LeaseContractLength
OfferingClass
PurchaseOption
capacitystatus
clockSpeed
@vadirajks
vadirajks / postman-deb.sh
Created September 2, 2019 13:14 — forked from SanderTheDragon/postman-deb.sh
A shellscript to create a Postman .deb file, for simple installation on Debian-based Linux distro's. Also creates a .desktop file.
#!/bin/sh
ls Postman*.tar.gz > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo "Removing old Postman tarballs"
rm -f $(ls Postman*.tar.gz)
fi
echo "Downloading latest Postman tarball"
curlExists=$(command -v curl)
@vadirajks
vadirajks / install.log
Created October 21, 2019 05:06 — forked from crmaxx/install.log
Installing and configuring P4Merge for Git on Ubuntu
# based on http://blogs.pdmlab.com/alexander.zeitler/articles/installing-and-configuring-p4merge-for-git-on-ubuntu/
$ cd ~/Downloads
$ wget https://cdist2.perforce.com/perforce/r18.2/bin.linux26x86_64/p4v.tgz
$ tar zxvf p4v.tgz
$ sudo mkdir /opt/p4v