Skip to content

Instantly share code, notes, and snippets.

View mvrozanti's full-sized avatar

Marcelo mvrozanti

View GitHub Profile
@mvrozanti
mvrozanti / remove-reddit-attribution-banner.py
Last active January 13, 2024 03:51
Script to remove the reddit attribution banner using Pillow in python
#!/usr/bin/env python
import argparse
from PIL import Image
import os
def remove_reddit_banner(image_path, dry_run=False):
image = Image.open(image_path)
try:
has_banner = has_reddit_banner(image)
except:
@mvrozanti
mvrozanti / chess-com-downloader.js
Created September 6, 2023 15:48
Download chess.com games en masse
(async () => {
year=2023
username = 'hikaru'
for(var month=1; month<=12; month++) {
let url = `https://api.chess.com/pub/player/${username}/games/${year}/${month}/pgn`
response = await fetch(url)
const bodyText = await response.text();
const blob = new Blob([bodyText], { type: 'text/plain' });
const a = document.createElement('a');
a.style.display = 'none';
@mvrozanti
mvrozanti / lspkgdsk.sh
Created March 1, 2023 02:12
List installed packages sorted by size on disk
pacman -Qi | awk '/^Name/{name=$3} /^Installed Size/{print name " : " $4 $5}' | sort -h -k 3
@mvrozanti
mvrozanti / upwork-dark.css
Last active January 20, 2023 02:22
Upwork Dark Theme CSS
:root {
--body-bg: #1e1e1e !important;
--nav-tooltip-text: white !important;
--nav-text: white !important;
--up-black: white !important;
--tab-active-bg-color: white !important;
--bg-inverse: #1e1e1e !important;
--skill-bg: #1e1e1e !important;
--skill-color: white !important;
--nav-dropdown-link-text: black;
@mvrozanti
mvrozanti / autoscroll.js
Last active January 11, 2023 02:46
Automatically scroll a page using javascript
let stop = false
let amount = 5
let delay = 10
function pageScroll() {
window.scrollBy(0, amount);
if(!stop)
scrolldelay = setTimeout(pageScroll,delay);
}
@mvrozanti
mvrozanti / clear_screen.js
Created January 16, 2021 01:40
Globo TV nativefier
setTimeout(
function(){
var bad_banner;
do {
bad_banner = document.querySelector('#cookie-banner-lgpd')
}while(!bad_banner);
bad_banner.remove()
document.querySelector('#app > div > div > div > header').remove().remove()
}, 1000)
@mvrozanti
mvrozanti / gatekeeper.py
Last active December 30, 2019 05:55
RAT-via-Telegram shell edition (shellinabox)
#!/usr/bin/env python
from distutils.spawn import find_executable
import argparse
import os
import psutil
import requests
import signal
import subprocess
import sys
import telepot
@mvrozanti
mvrozanti / sinon.py
Last active October 24, 2021 00:41
Consulta de sinônimos e antônimos de uma palavra no português brasileiro
#!/usr/bin/env python
from bs4 import BeautifulSoup
import requests
SIN_URL = 'https://www.sinonimos.com.br/'
ANT_URL = 'https://www.antonimos.com.br/'
def main(palavra):
sess = requests.session()
@mvrozanti
mvrozanti / scraper-divisao-silabica-plp.py
Last active February 5, 2019 15:45
Scraper do site portaldalinguaportuguesa.org
#!/usr/bin/env python
from bs4 import BeautifulSoup
import requests
import string
import json
base_url = 'http://www.portaldalinguaportuguesa.org'
syllables = base_url + '/index.php?action=syllables&act=list&letter='
session = requests.session()
save_path = 'palavras-divisao-silabica.json'
@mvrozanti
mvrozanti / gist:0f0589b9006a37e1fe6f0be914d64426
Created January 5, 2019 04:35
Finding images in a binary file w/ python
#!/usr/bin/env python2
# original author: jason moiron
# http://jmoiron.net/blog/finding-images-binary-file-w-python/
chunk = 1048576 * 4
# http://www.obrador.com/essentialjpeg/headerinfo.htm
jfif_id = 'JFIF\x00'
diffie_quant_marker = '\xff\xdb'
diffie_huffman_marker = '\xff\xc4'
frame_marker = '\xff\xc0'