This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
#Required: | |
Install-Module -Name LoopbackAdapter -MinimumVersion 1.2.0.0 | |
#run in admin terminal | |
#you do NOT need to disable/remove SMB 1.0/CIFS | |
#Troubleshooting: | |
#You can check [attempted] forwardings and [successful] listeners here, respectively | |
netsh interface portproxy show v4tov4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#accepts all arguments for ssh except command, -N and -f | |
#command can be piped in | |
Filter ssh-f { | |
$N = $False | |
if (!$_) { | |
#the same as -N | |
$_ = 'read' | |
$N = $True | |
} | |
$_ = 'echo SUCCESS;' + $_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://gist.github.com/Hashbrown777/a5a02e2fd3eeed4485d4ba073ef3b143 | |
. "$PSScriptRoot/async.ps1" | |
. "$PSScriptRoot/files.ps1" | |
. "$PSScriptRoot/style.ps1" | |
#default switches of $True emulate grep/ag behaviour, use `-flag:$False` to disable | |
Function Grep { [CmdletBinding(PositionalBinding=$False)]Param([Parameter(ValueFromPipeline)]$Input, | |
#display params | |
[switch]$OnlyMatching, [switch]$Files, $Max=-1, | |
#async params |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat /dev/urandom \ | |
| tr -dc '[:upper:][:digit:]' \ | |
| fold -w ${1:-8} \ | |
| head -1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pdfimages -all big.pdf . #poppler-utils | |
rename -v 's/^[^0-9]*//' .*.jpg | |
convert '*.jpg' -resize 50% %03d.jpeg #imagemagick | |
convert '*.jpeg' small.pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(async () => { | |
const output = open().document; | |
//generate a script to run over your deluge state file | |
output.write( | |
`<pre>#!/bin/bash | |
mkdir _ | |
cd _ | |
#split up the file and name them correctly, disregard the byte-counts | |
awk \\ | |
'BEGIN { RS="[de]40:"; ORS=FS=":" } { if ($1 != "") { for (i = 2; i <= NF; i++) print $i > substr($1, 0, 40) } }' \\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
&{ Param($hostname, $port) | |
try { | |
$tmp = [Net.Sockets.TcpClient]::new($hostname, $port) | |
$tmp.Connected | |
$tmp.close() | |
return | |
} | |
catch [System.Net.Sockets.SocketException] { | |
$Error[0].Exception | Out-Host | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sort(array, radix, getDigit) { | |
const counts = new Uint32Array(radix); | |
const jobs = [{start:0, end:array.length, offset:0}]; | |
while (jobs.length) { | |
const {start, end, offset} = jobs.pop(); | |
counts.fill(0); | |
counts[null] = start; | |
const sorting = array.slice(start, end); | |
for (let index = 0; index < sorting.length; ++index) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(async () => { | |
const ignore = /^http:\/\/waltercosand.com\/CosandScores\/Composers%20[^/]+\//; | |
const urls = [ | |
'http://waltercosand.com/CosandScores/Composers%20A-D/', | |
'http://waltercosand.com/CosandScores/Composers%20E-K/', | |
'http://waltercosand.com/CosandScores/Composers%20L-P/', | |
'http://waltercosand.com/CosandScores/Composers%20Q-Z/' | |
].reverse(); | |
const skip = [ | |
'http://waltercosand.com/CosandScores/Composers%20L-P/Mozart,%20W.%20A/Mozart%20-%20Complete%20Works%20for%20Piano/' |