Skip to content

Instantly share code, notes, and snippets.

View indy-singh's full-sized avatar

Indy indy-singh

View GitHub Profile
$result = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Defender\Signature Updates" -Name "SignaturesLastUpdated";
$thing = [System.BitConverter]::ToInt64($result.SignaturesLastUpdated, 0);
[DateTime]::FromFileTime($thing);
curl.exe -LORJ https://haveibeenpwned.com/api/v3/breaches
jq.exe .[] breaches | jq.exe -r .Domain | sort.exe | uniq.exe | awk.exe 'NF' | awk.exe '$0=$0"/.well-known/security.txt"' > urls.txt
xargs -n 1 curl.exe --location --head --max-time 1 -w "%%{http_code} %%{content_type} %%{url}\n" -o NUL -s < urls.txt
from itertools import count
from tqdm import tqdm
import mmh3
from uuid import uuid4
try:
for _ in tqdm(count()):
val = str(uuid4())
h = mmh3.hash(val)
if h == 1228476406:
public static void Main(string[] args)
{
var murmurHash32 = new MurmurHash32();
var dict = new Dictionary<int, List<string>>();
while (true)
{
var s = Guid.NewGuid().ToString();
var bytes = Encoding.UTF8.GetBytes(s);
var computeHash = murmurHash32.ComputeHash(bytes);
d1a310a1-b6ae-414c-b491-54a8cb8e2387 0b4d09b4-0e99-4c50-84a6-2a988372c08f
fa4f2481-e956-4f12-8e94-8d2c567b7bb7 8827aa71-8ffd-404c-aebe-9b4324dfbdf0
4de08850-2dd5-47c7-af5c-58ca83998703 0e5e72da-466f-4240-971b-66f63e8d9936
4dc5f904-d544-471a-ba18-7d43e0ec9394 c265f38d-d01e-4c05-ba22-b0abe742b89c
a184a111-d610-4a30-9835-4959d912b0cc a9d5df32-b4d0-4fe3-b095-2b60107853eb
c58eb7c4-e40e-4265-b226-b6f5e0c77909 f68cf6ed-8e92-4e77-9933-fe98a8bb958f
5d9adcec-e3f4-4004-aec4-21ccad71c184 97601c50-c114-4829-87ea-224648495319
11ae5b18-ed02-4887-842c-73bdfba44f18 8cf2773b-12f1-490e-9514-0109eb8c5381
a2b715bb-7920-4a94-921a-65d15c4be527 c5410bb0-f5d6-43f2-ad7a-27e06266e82b
4450cc0a-1370-498f-a4b3-82fae5b1f14f 60a44549-5878-4582-94f2-30d81db41a71
var httpClient = new HttpClient();
var httpRequestMessage = new HttpRequestMessage(HttpMethod.Post, "grab free url from https://public.requestbin.com/r");
httpRequestMessage.Content = new StringContent("{ \"name\": \"Yoda\" }", Encoding.UTF8, "application/json");
var httpResponseMessage = httpClient.SendAsync(httpRequestMessage).Result;
@indy-singh
indy-singh / test2.sql
Created December 5, 2020 17:15
test2.sql
CREATE TABLE example.manufacturer (
id BIGSERIAL PRIMARY KEY,
name TEXT NOT NULL UNIQUE
);
CREATE TABLE example.telephone_model (
id BIGSERIAL PRIMARY KEY,
manufacturer_id BIGINT NOT NULL,
name TEXT NOT NULL UNIQUE,
is_in_production bool NOT NULL
@indy-singh
indy-singh / compress-pdf-with-gs.md
Created August 4, 2020 23:25 — forked from guifromrio/compress-pdf-with-gs.md
Compress PDF files with ghostscript

This can reduce files to ~15% of their size (2.3M to 345K, in one case) with no obvious degradation of quality.

ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

Other options for PDFSETTINGS:

  • /screen selects low-resolution output similar to the Acrobat Distiller "Screen Optimized" setting.
  • /ebook selects medium-resolution output similar to the Acrobat Distiller "eBook" setting.
  • /printer selects output similar to the Acrobat Distiller "Print Optimized" setting.
  • /prepress selects output similar to Acrobat Distiller "Prepress Optimized" setting.
@indy-singh
indy-singh / scanner.sh
Created August 4, 2020 23:21 — forked from andyrbell/scanner.sh
Make a pdf look scanned using ImageMagick
# use ImageMagick convert
# the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf
convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf