Skip to content

Instantly share code, notes, and snippets.

View ShakataGaNai's full-sized avatar
🐍
Can Has Status! Working on the Pythons

Jon Davis ShakataGaNai

🐍
Can Has Status! Working on the Pythons
View GitHub Profile
@ShakataGaNai
ShakataGaNai / docker-compose.yml
Created February 27, 2019 01:47
Docker Compose for GitLab EE
gitlab:
image: 'gitlab/gitlab-ee:latest'
restart: always
hostname: 'gitlab.mycompany.tld'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'https://gitlab.mycompany.tld'
# https://docs.gitlab.com/omnibus/settings/ssl.html
letsencrypt['enable'] = true
letsencrypt['auto_renew'] = true
@ShakataGaNai
ShakataGaNai / list_gcp_iprange.py
Last active January 21, 2020 15:56 — forked from n0531m/list_gcp_iprange.sh
Google Cloud Platform : ip address range
#!/usr/local/bin/python3.6
import dns.resolver
import re
def main():
v4 = []
v6 = []
v4, v6 = que('_cloud-netblocks.googleusercontent.com')
for o4 in v4:
print(o4)
#!/usr/bin/python
from getpass import getpass
import hashlib
import requests
import sys
import re
passd = getpass('Gimme your password: ')
hash = hashlib.sha1(passd).hexdigest().upper()
res = requests.get('https://api.pwnedpasswords.com/range/'+hash[0:5])
@ShakataGaNai
ShakataGaNai / mp_wemos_blink.py
Created January 29, 2018 17:07
A hello world (blinking LED) for Micropython on the Wemos D1 Mini (ESP8266)
import boto3
import re
import datetime
import time
ec = boto3.client('ec2')
iam = boto3.client('iam')
def backupVols(e):
print("Looking for volumes to backup")
[storage]
engine = file_system
path = Development/MACHINENAME
directory = Mackup
[configuration_files]
@ShakataGaNai
ShakataGaNai / backup.sh
Created November 22, 2017 17:28
Mackup & Keybase powered CLI Backup
#!/bin/bash
DIR="$( cd "$( dirname "$0" )" && pwd )"
mackup backup -f
cd $DIR
git add --all
git commit -m "automated backup `date`"
git push
@ShakataGaNai
ShakataGaNai / strip-exif.py
Created November 1, 2017 00:36
Load every JPG file in the current directory and strip all the exif from it.
from PIL import Image
import re
from os import listdir
from os.path import isfile, join
def clean(f):
image_file = open(f)
image = Image.open(image_file)
data = list(image.getdata())

Keybase proof

I hereby claim:

  • I am shakataganai on github.
  • I am shakataganai (https://keybase.io/shakataganai) on keybase.
  • I have a public key ASBD1taS5cFXVX0sc9IOHeYf5LGNCaJPV4U4JoLpBUjz7wo

To claim this, I am signing this object:

@ShakataGaNai
ShakataGaNai / lambda-at-edge-headers.js
Last active September 19, 2017 22:06
A quick demonstration of using Lamba@Edge to inject extra HTTP Security/Cache Headers
'use strict';
exports.handler = (event, context, callback) => {
const response = event.Records[0].cf.response;
const headers = response.headers;
var hr = {
'Strict-Transport-Security': 'max-age=600;',
'Cache-Control': 'no-cache, no-store, max-age=0, must-revalidate',
'Pragma': 'no-cache',
'X-LambdaAtEdge': 'true'