Skip to content

Instantly share code, notes, and snippets.

View keroloswilliam's full-sized avatar
🤓
embarked on a ridiculous and fun journey

kerolos william keroloswilliam

🤓
embarked on a ridiculous and fun journey
View GitHub Profile
@keroloswilliam
keroloswilliam / clean_orphaned_snapshots.py
Created March 26, 2020 09:42
this python script removes the orphaned aws snapshots that exits without AMI
#!/usr/bin/env python3.7
import argparse
import boto3
cli_parser = argparse.ArgumentParser(description="")
cli_parser.add_argument('--region_name', type=str, default="eu-west-1")
cli_parser.add_argument('--profile_name', type=str, default='default')
cmdargs = cli_parser.parse_args()
@keroloswilliam
keroloswilliam / openAwsSession.go
Created August 20, 2019 08:19
Go function that opens session to aws and returns it
package main
import (
"log"
"fmt"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/logrusorgru/aurora"
)
// this is used for colorizing the output
@keroloswilliam
keroloswilliam / lookPathExample.go
Created August 15, 2019 11:28
this is an example of using exec.LookPath with exec.Command in golang
package main
import (
"os/exec"
"fmt"
)
func main() {
if someBin, err := exec.LookPath("ls"); err != nil {
fmt.Println("couldn't find the ls bin in the path")
}else if err == nil {
actualBin := exec.Command(someBin, "-lah")
@keroloswilliam
keroloswilliam / docker-compose.jenkins.yml
Last active February 26, 2019 08:57
bitnami jenkins with nginx-letsencrypt-companion docker-compose file
version: '2'
services:
jenkins:
image: 'bitnami/jenkins:latest'
labels:
kompose.service.type: nodeport
ports:
- '8080'
- '8443'
- '50000'