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
View main.go
package main
import "fmt"
func main() {
intslice := [][]int{[]int{1}, []int{2}}
// Grow
for index, value := range intslice {
arehmandev /
Created Oct 21, 2019 — forked from Justasic/
This is a python script to generate client OpenVPN configuration files. This is based mostly on the easyrsa script and is much simpler to understand.
import os
import socket
from OpenSSL import crypto, SSL
# OpenVPN is fairly simple since it works on OpenSSL. The OpenVPN server contains
# a root certificate authority that can sign sub-certificates. The certificates
# have very little or no information on who they belong to besides a filename
# and any required information. Everything else is omitted or blank.
# The client certificate and private key are inserted into the .ovpn file
# which contains some settins as well and the entire thing is then ready for
arehmandev / nginx.conf
Created Oct 14, 2019
Nginx transparent proxy
View nginx.conf
events {
worker_connections 1024;
http {
# google's DNS server
resolver_timeout 5s;
server {
# proxy server port
# 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{}
You can’t perform that action at this time.