Insidethe.com

Insidethe.com

Random Life and Technology Bits

GIST – Using HashIDs

Add-Type -Path "C:\Temp\Hashids.net.1.0.0\lib\net40\Hashids.net.dll"
$orgids = New-Object HashidsNet.Hashids("orgkey",3, "abcdefghjkmnpqrstuvwxyz23456789")
$userids = New-Object HashidsNet.Hashids("accountkey",6, "abcdefghjkmnpqrstuvwxyz23456789")
$orgids.Encode(1);
$userids.Encode(1);

GIST – GREP

 

# Search recursive case insensitive and show line before and after
grep -iR -B 1 -A 1 "searchterm" ./

# Search recursive case insensitive but show file name instead of matching line
grep -liR "searchterm" ./