Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Abdul Rehman arehmandev

🎯
Focusing
  • 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 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
tryAddKnownHost('github.com')
@arehmandev
arehmandev / CheckSubnetisPublic.sh
Last active Jul 30, 2018
Check if aws subnet is public - checks if internet gateway is attached to a route on a routetable of a subnet.
View CheckSubnetisPublic.sh
#!/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
arehmandev / dynamicarray.go
Created Jun 22, 2018
Solution to hackerrank dynamic array
View dynamicarray.go
package main
import (
"bufio"
"fmt"
"io"
"os"
"strconv"
"strings"
)
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
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: https://play.golang.org/p/yTTpB5gB6C
package main
import (
"fmt"
)
// *****************************************************************************
// Example 1 - Struct vs Struct with Embedded Type
@arehmandev
arehmandev / generate.sh
Created May 10, 2018
Running Helm and Tillerwith ssl on minikube
View generate.sh
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
echo "Cleaning workspace"
ls -1 | grep -v generate.sh | 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()
man.getStudent()
println(man.name + " is " + man.ID)
@arehmandev
arehmandev / removeSliceElement.go
Created Apr 25, 2018
Iteratively remove elements from slice
View removeSliceElement.go
package main
import "fmt"
func main() {
slice := []string{"TEST1", "TEST2", "TEST3", "TEST4"}
fmt.Println("SLICE AT START", slice)
for i := len(slice) - 1; i >= 0; i-- {
View Cold Snack.json
{
"$schema": "vscode://schemas/color-theme",
"comment": "Cold Snack, created by Evan Rowe.",
"author": "Evan Rowe",
"name": "Cold Snack Theme",
"tokenColors": [{
"settings": {
"background": "#002B36",
"foreground": "#93A1A1"
}
@arehmandev
arehmandev / grapeconfig.xml
Last active Feb 12, 2018
One that actually works
View grapeconfig.xml
<?xml version="1.0" encoding="UTF-8"?>
<ivy-settings>
<settings defaultResolver="downloadGrapes" />
<resolvers>
<ibiblio name="ibiblio-maven2" m2compatible="true"/>
<ibiblio name="java-net-maven2" root="http://download.java.net/maven/2/" m2compatible="true" />
<ibiblio name="maven" root="http://mvnrepository.com/artifact/" m2compatible="true" />
<chain name="downloadGrapes">
<resolver ref="maven"/>
<resolver ref="ibiblio-maven2"/>
You can’t perform that action at this time.