Skip to content

Instantly share code, notes, and snippets.

View arehmandev's full-sized avatar
🎯
Focusing

Abdul Rehman arehmandev

🎯
Focusing
  • Freelance
  • London, UK
View GitHub Profile
@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
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 02:40 — forked from josephspurrier/structs_interface.go
Golang - Understand Structs and Interfaces
// Also available at: https://play.golang.org/p/yTTpB5gB6C
package main
import (
"fmt"
)
// *****************************************************************************
// Example 1 - Struct vs Struct with Embedded Type
import hudson.model.*
def q = Jenkins.instance.queue
q.items.each {
if (it =~ /deploy-to/) {
q.cancel(it.task)
}
}
@arehmandev
arehmandev / clear_build_history.groovy
Last active July 8, 2019 14:00 — forked from realityforge/Delete historic hobs and some workspaces
Kill all queued jenkins jobs and cancel any running jobs
Jenkins.instance.getView('All').getBuilds().each { it.delete() }
@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.
@arehmandev
arehmandev / main.go
Created May 13, 2017 19:32 — forked from eduncan911/main.go
Go/Reading Console Inputs
package main
import (
"bufio"
"fmt"
"os"
"strings"
)
func main() {
@arehmandev
arehmandev / Jenkinsfile
Created April 12, 2017 10:10 — forked from chinshr/Jenkinsfile
Best of Jenkinsfile, a collection of useful workflow scripts ready to be copied into your Jenkinsfile on a per use basis.
#!groovy
# Best of Jenkinsfile
# `Jenkinsfile` is a groovy script DSL for defining CI/CD workflows for Jenkins
node {
}