Skip to content

Instantly share code, notes, and snippets.

View aliakhtar's full-sized avatar

Ali Akhtar aliakhtar

View GitHub Profile
@aliakhtar
aliakhtar / scala-jdk-maven-git.sh
Last active February 22, 2019 19:41
Installs jdk 10, maven, scala, and sbt on fresh server
#!/bin/sh
sudo mkdir /usr/lib/jvm
curl -O -J -L -H "Cookie: oraclelicense=accept-securebackup-cookie" https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.2%2B9_openj9-0.12.1/OpenJDK11U-jre_x64_linux_openj9_11.0.2_9_openj9-0.12.1_openj9-0.12.1.tar.gz
sudo tar zxvf OpenJDK*.tar.gz -C /usr/lib/jvm
rm -f OpenJDK*.gz
@aliakhtar
aliakhtar / gitstats.sh
Created September 10, 2018 00:06 — forked from xeoncross/gitstats.sh
Git - calculate how many lines of code were added/changed by someone
# Run this in the project repo from the command-line
# http://stackoverflow.com/a/4593065/99923
git log --shortstat --author "Xeoncross" --since "2 weeks ago" --until "1 week ago" | grep "files changed" | awk '{files+=$1; inserted+=$4; deleted+=$6} END {print "files changed", files, "lines inserted:", inserted, "lines deleted:", deleted}'
#!/usr/bin/env bash
# Helper script to describe the specified pod. Usage: describe.sh <pod name>
kubectl describe po $1 -n <gig name here>
@aliakhtar
aliakhtar / ParseRSAKeys.java
Created January 22, 2018 14:47 — forked from destan/ParseRSAKeys.java
Parse RSA public and private key pair from string in Java
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;
@aliakhtar
aliakhtar / jdk.sh
Last active December 31, 2017 21:03
Installs jdk 8 & maven on fresh server
#!/bin/sh
sudo mkdir /usr/lib/jvm
curl -O -J -L -H "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.tar.gz
sudo tar zxvf jdk*.tar.gz -C /usr/lib/jvm
rm -f jdk*.gz
#!/usr/bin/env bash
# Creates Dashboard, Heapster (for visualizations) addons
# Kubernetes Dashboard
kubectl apply -f https://raw.githubusercontent.com/kubernetes/kops/master/addons/kubernetes-dashboard/v1.4.0.yaml
# Heapster - Needed for visualizations
kubectl apply -f https://raw.githubusercontent.com/kubernetes/heapster/master/deploy/kube-config/influxdb/grafana-service.yaml
#~/bin/bash
#Installs Cassandra. Instructions from https://gist.github.com/hengxin/8e5040d7a8b354b1c82e and http://www.datastax.com/documentation/cassandra/2.0/cassandra/install/installDeb_t.html
cd ~/
sudo mkdir /usr/lib/jvm
curl -O -J -L -H "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u40-b25/jdk-8u40-linux-x64.tar.gz
apiVersion: v1
kind: ReplicationController
metadata:
labels:
name: influxGrafana
name: influxdb-grafana
namespace: kube-system
spec:
replicas: 1
selector:
#!/bin/sh
#Installs ElasticSearch. Expects that jdk is not installed on the server.
#Before starting, make a directory in /mnt/es and sudo chmod 666 /mnt/es (r+w)
#See https://gist.github.com/aliakhtar/c74b4cb0c8dfa95ebf4a for jdk.sh
./jdk.sh
wget https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.2.0/elasticsearch-2.2.0.deb
@aliakhtar
aliakhtar / Penn Treebank II Tags.md
Created February 19, 2016 17:46 — forked from nlothian/Penn Treebank II Tags.md
Penn Treebank II Tags