View randomalphanumeric.sh
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 |
View _hashes
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
# |
View resize scanned pdf.sh
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 |
View baka_deluge.js
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) } }' \\ |
View checkport.ps1
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
&{ | |
try { | |
$tmp = [Net.Sockets.TcpClient]::new('google.com', 443) | |
$tmp.Connected | |
$tmp.close() | |
return | |
} | |
catch [System.Net.Sockets.SocketException] { | |
$Error[0].Exception | Out-Host | |
} |
View 1_sort.js
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) { |
View opendirectory.js
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/' |
View bytesTransfer.js
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 transferBytes(inputBuffer, inputLength, inputWordSize, wordSize, create) { | |
inputWordSize |= 0; | |
const inputBytes = inputLength * inputWordSize; | |
const inputBitsize = inputWordSize << 3; | |
wordSize |= 0; | |
const bytes = (inputBytes - 1 & -wordSize) + wordSize; | |
const bitsize = wordSize << 3; | |
const buffer = create(bytes, bytes / wordSize); |
View combinePNGs.sh
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
pnmcat -jleft -tb \ | |
<(pngtopnm image139.png) \ | |
<(pngtopnm image73.png) \ | |
| pnmtopng \ | |
-alpha <(pnmcat -black -jleft -tb \ | |
<(pngtopnm -alpha image139.png) \ | |
<(pngtopnm -alpha image73.png) \ | |
) \ | |
>test.png |
View gitify_script_functions.ps1
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
gci ` | |
| %{ | |
("`n", $_.Name, @($_ | gci -File).Length) -join "`t" | |
$_ ` | |
| gci -File ` | |
| %{ | |
( | |
$_.CreationTime.ToString('yyyy-MM-dd'), | |
$_.Length, | |
$_.Name |
NewerOlder