Skip to content

Instantly share code, notes, and snippets.

View glens's full-sized avatar
🕴️
Just Johnny

Glen Scott glens

🕴️
Just Johnny
View GitHub Profile
@glens
glens / mime-ls.py
Created May 31, 2022 07:48
list folder contents and guess file mimetype
#!/usr/bin/env python
import mimetypes
import os
import sys
path = sys.argv[1]
for file in os.listdir(path):
file_mimetype = str(mimetypes.guess_type(file)[0])
print('{} {}'.format(file_mimetype, file))
@glens
glens / environment-name-generator.py
Last active May 11, 2022 06:49
Generator for common environment names
#!/usr/env python3
# environment name generator
# glen@glenscott.net
# @memoryresident
# github.com/glens
environment_types = [
"local",
@glens
glens / test.js
Created March 29, 2021 05:15
Simple script test
console.log('script test');
alert('script test');
prompt('script test');
window.location.href="https://google.com";
@glens
glens / pagelinks.js
Created April 8, 2020 01:48
javascript to extract all link urls in page for easy copy+paste
@glens
glens / vpn_firewall.sh
Created March 17, 2020 04:28
This script will firewall all outbound access to a single IP on TCP/443 & UDP/1194, parsed from a provided .ovpn config file. A rule is added to allow unrestricted access through the VPN connection (via tun0).
#!/bin/bash
if [ -z "$1" ];
then
cat << EOF
VPN iptables Firewall Rules Creator
author: Glen Scott (glen@glenscott.net)
This script will firewall all outbound access to a single IP on TCP/443 & UDP/1194, parsed from a provided .ovpn config file.

Keybase proof

I hereby claim:

To claim this, I am signing this object: