Skip to content

Instantly share code, notes, and snippets.

View aliakhtar's full-sized avatar

Ali Akhtar aliakhtar

View GitHub Profile
@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 / 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
#!/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
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
@aliakhtar
aliakhtar / capybara cheat sheet
Created January 16, 2016 20:28 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@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