Skip to content

Instantly share code, notes, and snippets.

View patmigliaccio's full-sized avatar
🎧
jammin

Pat Migliaccio patmigliaccio

🎧
jammin
View GitHub Profile
@patmigliaccio
patmigliaccio / purge-css-cloudflare.sh
Last active September 3, 2025 08:48
Executes cURL to purge the cache on Cloudflare for a specified set or all files (requires config)
#!/bin/sh
# Author: Pat Migliaccio <[email protected]>
# License: MIT
EMAIL="<Acct_Email>"
ZONE="<Zone_ID>"
API_KEY="<API_Key>"
DATA="{ \"files\": [\"https://example.com/css/style.css\"] }"
@patmigliaccio
patmigliaccio / keybase.md
Last active May 12, 2018 23:04
confirmation proof for keybase.io

Keybase proof

I hereby claim:

  • I am patmigliaccio on github.
  • I am patmigliaccio (https://keybase.io/patmigliaccio) on keybase.
  • I have a public key ASCBxsyiCy5TXXNF83e18qN1B-1Ya9YD6ow6XsOVnGxcIgo

To claim this, I am signing this object:

@patmigliaccio
patmigliaccio / concurrent_http.go
Last active March 5, 2018 03:03
A quick Go script, testing the performance of using concurrent channels for HTTP requests.
/**
* A quick Go script, testing the performance of using
* concurrent channels for HTTP requests.
*
* Example:
* $ go run concurrent_http.go https://google.com https://facebook.com
*
* -- Consecutive --
* GET: https://google.com
* 0.61 elapsed with response length: 10711 https://google.com
@patmigliaccio
patmigliaccio / rdp-azure.sh
Last active September 27, 2022 11:58
bash script to rdp into azure vm / windows server with freerdp
#!/bin/sh
# RDP into Azure VM / Windows machine using `xfreerdp`
#
# Reference: https://github.com/FreeRDP/FreeRDP/issues/2128#issuecomment-213505787
#
# Required dependency: http://www.freerdp.com/
#
# Preferred over `rdesktop` due to: https://github.com/rdesktop/rdesktop/issues/71
@patmigliaccio
patmigliaccio / prettier-git-config.sh
Last active September 22, 2020 20:41
updates entire git repo history with prettier based on .prettierrc
#!/bin/sh
# Reference: https://medium.com/millennial-falcon-technology/reformatting-your-code-base-using-prettier-or-eslint-without-destroying-git-history-35052f3d853e
git filter-branch --tree-filter 'prettier --config ../../.prettierrc --write "src/{app,environments,assets}/**/*{.ts,.js,.json,.css,.scss}" || echo "formatting error"' -- --all
@patmigliaccio
patmigliaccio / rdp.sh
Created December 30, 2017 17:04
bash script to rdp into windows server with rdesktop
#!/bin/sh
# Reference: https://stackoverflow.com/a/38860/5199198
SERVER=SERVER_NAME
USER=USER_NAME
DOMAIN=DOMAIN_NAME
/usr/bin/rdesktop -g 1152x864 \
-a 16 \
@patmigliaccio
patmigliaccio / gistList.js
Last active December 16, 2017 17:40
pulls and builds an html list of gists
(function (window, document, undefined) {
'use strict';
/**
* Configuration for Gist List
*/
const gistPage = 'stash',
username = 'patmigliaccio',
gistCount = 5,
excludeIfDescriptionContains = 'patmigliaccio.com',
@patmigliaccio
patmigliaccio / client-side-security-svg.js
Created September 2, 2017 01:55
patmigliaccio.com/client-side-security 7/27/17
function requestGeneratedSVG(){
return xhr('/assets/css/svg/generate')
.then(response => {
let content = parseSVGResponse(response.data);
// Decoded sensitive data would be handled here.
return JSON.parse(atob(content));
});
}
@patmigliaccio
patmigliaccio / client-side-security-svg-deobfuscated.js
Created September 2, 2017 01:40
patmigliaccio.com/client-side-security 7/27/17
var a = ["data", "parse", "then", "/assets/css/svg/generate", "", "split", "trim", "pop", "unshift", "forEach", "join"];
function requestGeneratedSVG() {
return xhr('/assets/css/svg/generate')['then'](function(b) {
let c = parseSVGResponse(b['data']);
return JSON['parse'](atob(c))
})
}
function parseSVGResponse(d) {
@patmigliaccio
patmigliaccio / client-side-security-reverse-obfuscation.js
Created September 2, 2017 01:38
patmigliaccio.com/client-side-security 7/27/17
/**
* Reverses basic obfuscation techniques used by the JavaScript Obfuscator.
*
* Reference: https://javascriptobfuscator.com/
*
* @param {string} data String representation of a JavaScript file
* @returns {string}
*/
function reverseObfuscation(data) {
return replaceArrayReferences(replaceHexArrayValues(replaceHexVariables(data)));