Skip to content

Instantly share code, notes, and snippets.

View stephenbradshaw's full-sized avatar
:octocat:
Working from home

Stephen Bradshaw stephenbradshaw

:octocat:
Working from home
View GitHub Profile
@stephenbradshaw
stephenbradshaw / python3_https_server.py
Created November 5, 2020 01:26
Python 3 Simple HTTPS server
#!/usr/bin/env python3
# python3 update of https://gist.github.com/dergachev/7028596
# Create a basic certificate using openssl:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# Or to set CN, SAN and/or create a cert signed by your own root CA: https://thegreycorner.com/pentesting_stuff/writeups/selfsignedcert.html
import http.server
import ssl
httpd = http.server.HTTPServer(('127.0.0.1', 443), http.server.SimpleHTTPRequestHandler)
@stephenbradshaw
stephenbradshaw / stephenbradshaw.zsh-theme
Created December 21, 2020 02:04
My Oh My Zsh theme
local user='%{$fg[cyan]%}%n%{$reset_color%}@%{$fg[green]%}%m%{$reset_color%}'
local pwd='%B%{$fg[blue]%}%~%{$reset_color%}'
local rvm=''
if which rvm-prompt &> /dev/null; then
rvm='%{$fg[green]%}‹$(rvm-prompt i v g)›%{$reset_color%}'
else
if which rbenv &> /dev/null; then
rvm='%{$fg[green]%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}'
fi
fi
@stephenbradshaw
stephenbradshaw / extractor.cs
Created April 29, 2022 09:43
C# code for extracting resources from .Net assemblies to auto named files in pwd on disk - handles costura compressed files
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Reflection;
using System.Text;
using System;
// Compile with: csc extractor.cs
@stephenbradshaw
stephenbradshaw / executer.cs
Created March 10, 2023 08:13
Simple example of web fetching in memory .Net assembly executer
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Linq;
using System.Net;
using System.Reflection;
// Compile with:
// Windows: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe /out:executer.exe /platform:x64 executer.cs