Skip to content

Instantly share code, notes, and snippets.

View Kyu's full-sized avatar
😜
I like doing shit

Precious Kyu

😜
I like doing shit
View GitHub Profile
@Kyu
Kyu / group_talkative.sh
Created November 18, 2020 12:20
Gets most talkative users from whatsapp archive
#!/usr/bin/bash
cat _chat.txt | sed "s|[[0-9 / , :]*][[:space:]]||" | grep -o ".*:" | sed 's/:.*//g' | tr -cd '[:print:]\r\n\t' | grep -v "^\s*$" | sort | uniq -c | sort -bnr
# cat file | replace [date/date/date , , , ] with "" | get everything before ":" | GET EVERYTHING BEFORE FIRST ":" | filter out non printing chars | idk tbh something to do with the count | idk I should man this | sorting ?? idk i shsould man this
# prints out most talkative in chat, w some false pos
# https://unix.stackexchange.com/a/39044/427069 -- sort - Get text-file word occurrence count of all words & print output sorted
# https://stackoverflow.com/a/3540639/3875151 -- bash - Removing non-displaying characters from a file
java -cp java-decompiler.jar org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler -hdc=0 -dgs=1 -rsy=1 -rbr=1 -lit=1 -nls=1 -mpm=60 -lac=1 DragonBlockC-v1.4.72.jar decomp/; cd decomp; unzip -q DragonBlockC-v1.4.72.jar
import cv2
import numpy as np
import pyzbar.pyzbar as pyzbar
img_file = "qr.png"
image = cv2.imread(img_file)
decodedObjects = pyzbar.decode(image)
for obj in decodedObjects:
print("Type:", obj.type)
@Kyu
Kyu / search.ps
Created May 27, 2022 16:51
Search multiple files for text powershell
PS C:\Users\rocke\Downloads\tawau-master\tawau-master\tawau> ls -r | Select-String ghost | select Path, LineNumber, Line
Path LineNumber Line
---- ---------- ----
C:\Users\rocke\Downloads\tawau-master\tawau-master\tawau\amp.hbs 17 {{amp_ghost_head}}
C:\Users\rocke\Downloads\tawau-master\tawau-master\tawau\default.hbs 7 {{!-- Ghost outputs...
C:\Users\rocke\Downloads\tawau-master\tawau-master\tawau\default.hbs 8 {{ghost_head}}
C:\Users\rocke\Downloads\tawau-master\tawau-master\tawau\default.hbs 22 {{!-- Ghost Content...
C:\Users\rocke\Downloads\tawau-master\tawau-master\tawau\default.hbs 23 <script type="text/...
@Kyu
Kyu / BlocCr.py
Last active June 6, 2022 16:51
Async friendly version of BlocCrawl.py
from bs4 import BeautifulSoup
import aiohttp
import asyncio
import datetime
import csv
class Complete(KeyboardInterrupt):
pass
@Kyu
Kyu / BlocCrawl.py
Last active June 6, 2022 16:51
Crawls nations from http://www.blocgame.com
from bs4 import BeautifulSoup
from urllib.request import Request, urlopen
import datetime
import csv
start = datetime.datetime.now()
def get_countries(url):
try:
@Kyu
Kyu / qr.py
Created December 29, 2022 20:54
import numpy as np
import cv2
def read_camera_parameters():
cam_mtx = np.loadtxt("cam_mtx.dat")
dist_params = np.loadtxt("dist_params.dat")
# cmtx = camera matrix, dist = distortion parameters
return cam_mtx, dist_params
# Pretty print messages
# https://discord.com/developers/docs/topics/gateway#transport-compression
# https://github.com/Rapptz/discord.py/blob/8ba830eeb86a52e54c727e71436bfe0e9ea51526/discord/gateway.py#L491
import json, base64, pprint, zlib
buffer = bytearray()
zlib_obj = zlib.decompressobj()
printer = pprint.PrettyPrinter()
from flask import Flask, request
import pprint
class LoggingMiddleware:
def __init__(self, _app):
self._app = _app
def __call__(self, env, resp):
error_log = env['wsgi.errors']