Skip to content

Instantly share code, notes, and snippets.


Abdul Rehman arehmandev

  • Capgemini
  • London, UK
Block or report user

Report or block arehmandev

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
# Copyright (c) 2013 Nyr. Released under the MIT License.
# Copyright (c) 2019 Fabrice Triboix
set -eu
# Parse arguments #
arehmandev / .zshrc
Last active Aug 19, 2019
terraform aliases
View .zshrc
function tfinit () {
if [ -z "${1}" ]; then
terraform init
terraform init -backend-config=${1}
function tfplan () {
if [ -z "${1}" ]; then
arehmandev / Dockerfile
Created Jul 1, 2019
Quick docker in docker
View Dockerfile
FROM debian:stretch-slim
RUN apt-get update -y && apt install -y curl && \
curl -LO && apt install -f -y ./containerd.io_1.2.6-3_amd64.deb && \
curl -LO && apt install -f -y ./docker-ce-cli_18.09.7~3-0~debian-stretch_amd64.deb && \
curl -LO && apt install -f -y ./docker-ce_18.09.7~3-0~debian-stretch_amd64.deb && \
rm -rf *.deb
View gist:2c705ad22c1d16844b72ba9f5e579778
Hi if you're seeing this - you probably got stuck where I was:
The pipeline randomly fails at ssh-add?
Guess what the fix is - add a new line at the end of your ssh key stored in jenkins, absolutely stupid right.
Here's an example of pipeline:
def tagBuild(gitTag){
// Required for setup of jenkins slave ssh daemon
arehmandev /
Last active Aug 18, 2019
Check if aws subnet is public - checks if internet gateway is attached to a route on a routetable of a subnet.
#!/usr/bin/env python3
# Quick script to create a dict of subnetid -> isPublic (check if AWS VPC subnet is public or not)
import boto3
ec2 = boto3.client('ec2')
subnetDict = {}
apicall = ec2.describe_route_tables()
arehmandev / dynamicarray.go
Created Jun 22, 2018
Solution to hackerrank dynamic array
View dynamicarray.go
package main
import (
View cache.go
type Func func(key string) (interface{}, error)
type result struct {
value interface{}
err error
type entry struct {
res result
ready chan struct{}
arehmandev / structs_interface.go
Created May 24, 2018 — forked from josephspurrier/structs_interface.go
Golang - Understand Structs and Interfaces
View structs_interface.go
// Also available at:
package main
import (
// *****************************************************************************
// Example 1 - Struct vs Struct with Embedded Type
arehmandev /
Created May 10, 2018
Running Helm and Tillerwith ssl on minikube
set -euo pipefail
echo "Cleaning workspace"
ls -1 | grep -v | xargs rm -rf
echo "Generating CA"
openssl genrsa -out ./ca.key.pem 4096
openssl req -key ca.key.pem -new -x509 -days 7300 -sha256 -out ca.cert.pem
View example.groovy
class Example {
String name;
int ID;
static void main(String[] args) {
Example man = new Example()
println( + " is " + man.ID)
You can’t perform that action at this time.