Skip to content

Instantly share code, notes, and snippets.

View mediaupstream's full-sized avatar
🍉

Derek Anderson mediaupstream

🍉
View GitHub Profile
@mediaupstream
mediaupstream / make_certs.sh
Last active April 5, 2024 19:22
extract ca-certs, key, and crt from a pfx file
#!/bin/bash
#
# Usage:
# ./make_certs.sh test.example.com
#
# The required input to make_certs.sh is the path to your pfx file without the .pfx prefix
#
# test.example.com.key
# test.example.com.crt (includes ca-certs)
@mediaupstream
mediaupstream / eval-corn.js
Last active July 26, 2022 15:01
Eval CORNIFICATION
eval(String.fromCharCode(118,97,114,32,115,61,100,111,99,117,109,101,110,116,46,
99,114,101,97,116,101,69,108,101,109,101,110,116,40,39,115,99,114,105,112,116,39,
41,59,32,115,46,115,114,99,61,39,104,116,116,112,58,47,47,119,119,119,46,99,
111,114,110,105,102,121,46,99,111,109,47,106,115,47,99,111,114,110,105,102,121,46,
106,115,39,59,100,111,99,117,109,101,110,116,46,103,101,116,69,108,101,109,101,110,
116,115,66,121,84,97,103,78,97,109,101,40,39,104,101,97,100,39,41,91,48,93,46,97,112,
112,101,110,100,67,104,105,108,100,40,115,41,59,32,115,101,116,84,105,109,101,111,117,
116,40,102,117,110,99,116,105,111,110,40,41,123,32,99,111,114,110,105,102,121,95,97,
100,100,40,41,32,125,44,32,49,48,48,48,41,59))
@mediaupstream
mediaupstream / bitmask-crud.js
Last active November 8, 2021 12:34
Store CRUD settings in 2 bytes with bitmasks
const CREATE = 0
const READ = 1
const UPDATE = 2
const DELETE = 3
const add = (a, b) => a |= (1 << b)
const remove = (a, b) => a &= ~(1 << b)
const has = (a, b) => ((a & (1 << b)) > 0)
const bin = (a) => (s).toString(2)
@mediaupstream
mediaupstream / json2xml.js
Created December 19, 2011 06:57
json2xml - Convert an xml2js JSON object back to XML
/**
* json2xml - Convert an xml2js JSON object back to XML
*
* @author Derek Anderson
* @copyright 2011 Media Upstream
* @license MIT License
*
* Usage:
*
* json2xml({"Foo": "@": { "baz": "bar", "production":"true" }}, "Test", function(xml){
@mediaupstream
mediaupstream / jekyll-deploy.sh
Created November 19, 2015 10:34
Jekyll website deploy script, using scp
#!/bin/bash
user="username"
host="example.com"
port=22
site_folder="_site"
remote_folder="/var/www/example.com/"
scp -P $port -r ${site_folder}/* ${user}@${host}:${remote_folder}
@mediaupstream
mediaupstream / ltc-mining.sh
Last active October 12, 2020 11:49
Litecoin CPU Mining setup on Ubuntu Server
#!/bin/bash
#
# Litecoin CPU Mining setup on Ubuntu Server
#
sudo apt-get update;
# install prerequisit software/libs
sudo apt-get -y install make automake build-essential libcurl4-openssl-dev htop
const isDeliverable = async address => {
if (disableEcommerce) {
return false
}
const api = Api.init()
const { deliverable } = await api.post(
'/location?delivery_type=all',
{
...address,
tentative: undefined
@mediaupstream
mediaupstream / example.js
Created October 3, 2011 21:29
Load Images from JSON into AnythingSlider
/**
* file: images.json
*/
{
"images": [
{"title": "Image One", "url": "image1.jpg", "rating": "3.5"},
{"title": "Image Two", "url": "image2.jpg", "rating": "1"},
{"title": "Image Three", "url": "image3.jpg", "rating": "5"}
]
}
@mediaupstream
mediaupstream / force.py
Created March 1, 2012 05:25
Stripe CTF level06 - Python FTW!
#!/usr/bin/python
import sys
import subprocess
from operator import itemgetter
import time
dic = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' # a-zA-Z0-9
cmd = './level06' # replace this with the path to level06 executable
pwd = './.password' # replace this with the path to the .password file you want to crack
@mediaupstream
mediaupstream / gist:3857647
Created October 9, 2012 09:33
Simple Markdown XSS
# Markdown XSS
![uh](http://example.com"onerror="javascript:alert\('hello, xss'\))