Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Minimum TODOs on a per job basis:
# 1. define name, application jar path, main class, queue and log4j-yarn.properties path
# 2. remove properties not applicable to your Spark version (Spark 1.x vs. Spark 2.x)
# 3. tweak num_executors, executor_memory (+ overhead), and backpressure settings
# the two most important settings:
num_executors=6
executor_memory=3g
@xman1980
xman1980 / gist:24f24e05db1903259e7c7c286e1e7aba
Created August 17, 2018 20:38
bash git pull multiple repos
#!/bin/bash
repos=(
"/c/projects/project-1"
"/c/projects/project-2"
"/c/projects/project-3"
)
echo ""
echo "Getting latest for" ${#repos[@]} "repositories using pull --rebase"
#!/bin/bash
################
# Uncomment if you want the script to always use the scripts
# directory as the folder to look through
#REPOSITORIES="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
REPOSITORIES=`pwd`
IFS=$'\n'
@xman1980
xman1980 / kafka-cheat-sheet.md
Created August 21, 2018 15:39 — forked from ursuad/kafka-cheat-sheet.md
Quick command reference for Apache Kafka

Kafka Topics

List existing topics

bin/kafka-topics.sh --zookeeper localhost:2181 --list

Describe a topic

bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic

Purge a topic

bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000

... wait a minute ...

sudo yum remove docker docker-common docker-selinux docker-engine
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce
rpm -ivh http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.42-1.gitad8f0f7.el7.noarch.rpm
version: "3.3"
services:
kong:
image: kong:latest
container_name: kong
networks:
- kong-net
ports:
- "8000:8000"
- "8443:8443"
@xman1980
xman1980 / iterm2.md
Created September 6, 2018 19:09 — forked from squarism/iterm2.md
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
Fullscreen + Enter
Previous Tab + Left Arrow
Next Tab + Right Arrow
Go to Tab + Number
Go to Window + Option + Number
Go to Split Pane by Direction + Option + Arrow
@xman1980
xman1980 / mongo_redhat_cent_7_install.sh
Created September 26, 2018 07:26 — forked from kennwhite/mongo_redhat_cent_7_install.sh
Install latest MongoDB on RedHat/CentOS 7
#!/bin/bash
# Simple install script for stock RedHat/CentOS 7.x
# Allows yum update to pull security & other fixes automatically from MongoDB.com's repos
# (versus ancient packages in Red Hat/Cent repos)
# To completely purge all remnants of Mongo (repo conf, rpms, yum cache, DB files, kernel tweaks:
# sudo service mongod stop ; sudo rm -rf /etc/yum.repos.d/mongo* ; sudo rm -rf /var/lib/mongo/* ; sudo sed -i.`date +%Y-%m-%d_%H-%M-%S`.bak '/^#.*$/!d' /etc/rc.d/rc.local ; sudo rm -rf /var/cach/yum ; sudo yum -y clean all ; sudo yum -y remove mongodb*
# Sanity check - are we on a RH family distro?
[ -f "/etc/redhat-release" ] || { echo -e "This script requires RedHat or CentOS. Quitting. \n"; exit 1 ;}
cat access.log | grep Site | awk '{ print $1 }' | sort | uniq -c | sort -n
@xman1980
xman1980 / cf_ban
Created October 28, 2018 22:03 — forked from pjv/cf_ban
Cloudflare v4 API ban and urban bash scripts
#!/bin/bash
# dependencies: curl
# example usage: cf_ban 192.168.0.1
# append cloudflare email address and API token:
USER=
TOKEN=