Skip to content

Instantly share code, notes, and snippets.

View iahmad-khan's full-sized avatar
😎
Focusing

Ijaz ahmad iahmad-khan

😎
Focusing
View GitHub Profile
@iahmad-khan
iahmad-khan / log.scala
Created January 18, 2017 13:43 — forked from ceteri/log.scala
Intro to Apache Spark: code example for RDD animation
// load error messages from a log into memory
// then interactively search for various patterns
// base RDD
val lines = sc.textFile("log.txt")
// transformed RDDs
val errors = lines.filter(_.startsWith("ERROR"))
val messages = errors.map(_.split("\t")).map(r => r(1))
messages.cache()
@iahmad-khan
iahmad-khan / gist:7400fddecf95e1eec8d78d1a787f20b2
Created March 18, 2017 10:39 — forked from eglute/gist:7382c35de6985d45f831
OSCON OpenStack Workshop Commands
cat ~/credentials/user
source ~/credentials/user
keystone discover
keystone catalog
keystone endpoint-get --service volume
keystone token-get --wrap 50
nova list
nova flavor-list
nova boot --image cirros-qcow2 --flavor 1 MyFirstInstance
@iahmad-khan
iahmad-khan / gist:5b56728efa640d79ce847de4076241be
Created July 26, 2017 10:51 — forked from paulmaunders/gist:3e2cbe02c07b6393f7ef0781eed9f97b
Installing VirtualBox and Vagrant on CentOS 7
# Some notes from installing VirtualBox on CentOS 7.
# These exact steps haven't been tested, as I ran them in a different order when manually installing.
# Install dependencies
yum -y install gcc make patch dkms qt libgomp
yum -y install kernel-headers kernel-devel fontforge binutils glibc-headers glibc-devel
# Install VirtualBox
cd /etc/yum.repos.d
wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo
@iahmad-khan
iahmad-khan / tomcat.service
Created October 3, 2017 13:52 — forked from zengxs/tomcat.service
tomcat systemd service script
# Systemd unit file for tomcat
[Unit]
Description=Apache Tomcat Web Application Container
After=syslog.target network.target
[Service]
Type=forking
Environment=JAVA_HOME=/usr/lib/jvm/jre
Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
@iahmad-khan
iahmad-khan / reroute.py
Created May 18, 2018 19:33 — forked from shamil/reroute.py
An example python script to reroute unassigned shards to NODE_NAME node thus recovering from the red cluster status
# example python script
# pip install requests before using requests
import requests
import json
HOSTNAME="your.elasticsearch.host.com" # hostname
PORT=9200 # port number
NODE_NAME="node001" # node to reroute to
@iahmad-khan
iahmad-khan / reroute.py
Created May 18, 2018 19:33 — forked from shamil/reroute.py
An example python script to reroute unassigned shards to NODE_NAME node thus recovering from the red cluster status
# example python script
# pip install requests before using requests
import requests
import json
HOSTNAME="your.elasticsearch.host.com" # hostname
PORT=9200 # port number
NODE_NAME="node001" # node to reroute to
@iahmad-khan
iahmad-khan / reindex.sh
Created May 20, 2018 12:12 — forked from mynameiswhm/reindex.sh
Bulk reindexing elasticsearch to another cluster using jq
#/bin/bash
if [ $# -lt 3 ]
then
echo "Usage: reindex.sh source_url target_url index [query]"
echo "Example: reindex.sh http://source.com:9200 http://target.com:9200 products_v1 '{\"query\":{\"range\":{\"mod_date\":{\"from\":\"2015-12-03T20:00:00\"}}}}'"
exit 1
fi
SOURCE_URL=$1