Skip to content

Instantly share code, notes, and snippets.

View theagoliveira's full-sized avatar

Thiago Cavalcante theagoliveira

View GitHub Profile
@theagoliveira
theagoliveira / pci.sh
Last active April 7, 2020 20:55
Bash script to get every result in a series of PCI Concursos searches and save to CSV files
#!/bin/bash
#
# Author: Thiago Cavalcante
# github.com/theagoliveira
for url in $(cat "./urls.txt")
do
src=$(curl -fsL "$url")
pages=$(echo "$src" | pup 'span[style="margin:0 30px 0 2px;"] text{}' | sed 's/Mostrando página 1 de //g')
institution_name="./${url/https\:\/\/www.pciconcursos.com.br\/provas\//}"
@theagoliveira
theagoliveira / ml_available.py
Created April 6, 2020 21:54
Get the number of available products on MercadoLivre, using the URL
#!/usr/bin/env python
"""
Get the number of available products on MercadoLivre, using the URL
"""
import re
import sys
import urllib.request as req
@theagoliveira
theagoliveira / ..switch-wishlist
Last active October 26, 2024 03:29
Script that checks eshop-prices.com using a Buku database of links and prints name/price/country/URL for every discounted game
We couldn’t find that file to show.
@theagoliveira
theagoliveira / .backup-and-list
Last active March 13, 2025 05:54
Script to backup files between drives using rsync and list them using tree
We couldn’t find that file to show.
@theagoliveira
theagoliveira / ml_price.py
Created October 17, 2019 03:03
Get the price of the first result from a MercadoLivre website search
#!/usr/bin/env python
"""
Get the price of the first result from a MercadoLivre website search.
"""
import argparse
import re
import urllib.request as req
@theagoliveira
theagoliveira / cm_price.py
Created October 17, 2019 03:03
Get the price of a product from Cissa Magazine website
#!/usr/bin/env python
"""
Get the price of a product from Cissa Magazine website.
"""
import argparse
import re
import urllib.request as req
@theagoliveira
theagoliveira / get_installed_programs.ps1
Created October 11, 2019 06:20
PowerShell one-liner to save a list of the installed programs in Windows
Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table -AutoSize > $pwd\installed_programs_$(Get-Date -Format "yyyy-MM-dd").txt
@theagoliveira
theagoliveira / rar_to_zip.sh
Created October 11, 2019 05:56
Extract every rar file inside a directory and compress as a zip file
#!/bin/bash
#
# Author: Thiago Cavalcante
# github.com/theagoliveira
find . -maxdepth 5 -mindepth 1 -name "*.rar" -type f -execdir unrar x -ad {} \; -exec bash -c 'f="{}"; f=${f::-4}; 7z a -tzip "$f.zip" "$f"; rm -rf "$f"' \; -exec rm -f {} \;
@theagoliveira
theagoliveira / download_pedro_medeiros_tutorials.sh
Created October 11, 2019 05:55
Download every tutorial from Pedro Medeiros (Towerfall, Celeste) -- outdated
#!/bin/bash
#
# Author: Thiago Cavalcante
# github.com/theagoliveira
#
# Pedro's patreon: https://www.patreon.com/saint11
imgur_url="https://i.imgur.com"
tumblr_url="https://66.media.tumblr.com"
@theagoliveira
theagoliveira / png_add_iend.py
Created October 11, 2019 04:59
Add a IEND chunk to a png file or to every png file in a directory
#!/usr/bin/env python
"""
TODO
"""
import argparse
import os
__author__ = 'Thiago Cavalcante'