Skip to content

Instantly share code, notes, and snippets.

View arehmandev's full-sized avatar
🎯
Focusing

Abdul Rehman arehmandev

🎯
Focusing
  • Capgemini
  • London, UK
View GitHub Profile
@arehmandev
arehmandev / changed.yaml
Created September 20, 2017 18:36
Changing value in yaml file in go
Charts:
name: foo
repo: foo.com
tags: realtag
1. Setup a project
2. Add groovy SDK support:
https://www.bonusbits.com/wiki/HowTo:Add_Groovy_SDK_to_IntelliJ_IDEA
3. Download http://(yourjenkinsurl)/job/(yourpipelinejob)/pipeline-syntax/gdsl
- this will give you the .gdsl file - download this to the src folder of your project.
4. Finally follow this step - right click on the src folder -> Mark directory as -> Sources Root
@arehmandev
arehmandev / openvpn_gen.py
Created October 21, 2019 11:59 — forked from Justasic/openvpn_gen.py
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
# Pull in existing VPC
data "aws_vpc" "selected" {
id = var.vpc_id
}
# Subnet ids data source lookup allows multiple subnets to be provided
data "aws_subnet_ids" "private" {
vpc_id = data.aws_vpc.selected.id
filter {
@arehmandev
arehmandev / Terraform nested for loop
Last active May 26, 2023 20:29
Terraform nested for loop for_each
Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
Outputs:
map_output = {
"1-a-4-d" = {
"1" = "1"
"2" = "a"
"3" = "4"
"4" = "d"
}
@arehmandev
arehmandev / main.tf
Created August 12, 2021 06:45
Nested surfacing dict
locals {
input = {
"projects" : {
"another" : {
"accounts" : [
"one",
"two"
]
},
"test" : {
@arehmandev
arehmandev / nginx.conf
Created October 14, 2019 19:24
Nginx transparent proxy
events {
worker_connections 1024;
}
http {
# google's DNS server
resolver 8.8.8.8;
resolver_timeout 5s;
server {
# proxy server port
@arehmandev
arehmandev / groovy.json
Last active August 9, 2022 19:59
VSCode Jenkins groovy snippets
{
/*
//Please click VSCode -> Preferences -> User Snippets -> groovy
//Then copy and paste this into groovy.json
*/
/*
// Place your snippets for Groovy here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
@arehmandev
arehmandev / dynamicarray.go
Created June 22, 2018 23:32
Solution to hackerrank dynamic array
package main
import (
"bufio"
"fmt"
"io"
"os"
"strconv"
"strings"
)
@arehmandev
arehmandev / .drone.yml
Created January 28, 2018 12:09 — forked from d0x2f/.drone.yml
.drone.yml example
workspace:
base: /build
pipeline:
build-image:
image: docker
commands:
# Build development target, which includes xdebug.
# Tag with both api-build:<build_number> and api-build:latest.