Skip to content

Instantly share code, notes, and snippets.

@lopes
lopes / cronometr.ino
Last active August 7, 2024 13:34
A stopwatch in Arduino Uno with DFRobot v1.1 board. #clang #arduino #prototype
/**
* cronometr.ino
* Implements a stopwatch in Arduino Uno with DFRobot v1.1 board.
* Author: José Lopes de Oliveira Jr. <jilo.cc>
* License: GPLv3+
*/
#include <LiquidCrystal.h>
@lopes
lopes / smbgate2squid.sh
Last active August 7, 2024 13:35
A deprecated script that merges smbgate and squid logs to better determine what an user accessed. #linux #shell #shellscript #exercise #squid #log
#!/bin/bash
# NAME
# smbgate2access.sh
#
# VERSION
# alpha 0.005
#
# DESCRIPTION
# Este script analisa o arquivo de log do squid (access.log) e o combina com
@lopes
lopes / Code.gs
Last active August 7, 2024 13:36
Retrieves a quote from YAHOO! Finance and puts into the spreadsheet's cell. #javascript #js #sheets #yahoo #finance
function get_quote() {
/* get_quote
* Retrieves a quote from YAHOO! Finance and puts into the spreadsheet's cell.
*
* It's a pretty simple script that access YAHOO! Finance and get the price of
* previous close price of symbol in the first column cell of actual row.
*
* Usage: Start a spreadsheet where the symbols are disposed in lines and are
* in the first column. Use only symbols without those ".SA"s in the end.
* Access Tools > Script editor... and replace the default code for this
@lopes
lopes / eb.py
Last active August 7, 2024 13:38
Lists the top 10 most used passwords in Exército Brasileiro's leak. #hack #python #password #entropy
#!/usr/bin/env python3
#eb.py
#
# Created this program to list the top 10 most used
# passwords in Exército Brasileiro's leak. More
# about this here:
# http://www.tecmundo.com.br/ataque-hacker/89110-in-seguranca-nacional-exercito-hackeado-tem-7-mil-contas-crackeadas.htm
# Passwords were dumped, each in a newline, like this: <CPF>:<Password>
#
# AUTHOR: José Lopes de Oliveira Jr. <[email protected]>
@lopes
lopes / stanford-cryptography-test-using-aes.py
Last active August 7, 2024 13:39
Just a test of AES usage I wrote while coursing Cryptography I on Stanford (via Coursera) #python #cryptography #exercise #aes
#!/usr/bin/python
from Crypto.Cipher import AES
from Crypto.Util import Counter
key = bytes.fromhex('36f18357be4dbd77f050515c73fcf9f2')
ciphertext = bytes.fromhex('69dda8455c7dd4254bf353b773304eec0ec7702330098ce7f7520d1cbbb20fc388d1b0adb5054dbd7370849dbf0b88d393f252e764f1f5f7ad97ef79d59ce29f5f51eeca32eabedd9afa9329')
iv = ciphertext[:16] #not needed for CTR, mult. of 16
cipher = ciphertext[16:]
@lopes
lopes / peneira.py
Last active August 7, 2024 13:40
Just a simple script to analyse a file system. #python #files #database #postgresql #hash
#!/usr/bin/python
#peneira.py
#
# Analyses a file system path, calculating the hash for each file
# and storing hash and the path for file. Errors will be recorded
# in errors table ---duh!
#
# Author: Jose' Lopes de Oliveira Jr. <[email protected]>
# License: GPLv3+
#
@lopes
lopes / aes-cbc.py
Last active November 6, 2024 08:12
Simple Python example of AES in CBC mode. #python #cryptography #aes #cbc #poc
#!/usr/bin/env python3
#
# This is a simple script to encrypt a message using AES
# with CBC mode in Python 3.
# Before running it, you must install pycryptodome:
#
# $ python -m pip install PyCryptodome
#
# Author.: José Lopes
# Date...: 2019-06-14
@lopes
lopes / aes-ecb.py
Last active August 7, 2024 13:42
Simple Python example of AES in ECB mode. #python #cryptography #aes #ecb #poc
from hashlib import md5
from base64 import b64decode
from base64 import b64encode
from Crypto.Cipher import AES
# Padding for the input string --not
# related to encryption itself.
BLOCK_SIZE = 16 # Bytes
pad = lambda s: s + (BLOCK_SIZE - len(s) % BLOCK_SIZE) * \
@lopes
lopes / xbox.py
Last active August 7, 2024 13:43
Show the Xbox's backward compatibility game library. #python #web #scrapper #xbox #game
#!/usr/bin/env python3
# Show the Xbox's backward compatibility game library.
# Still needs a lot of tests, its just a kind of alpha
# version.
# José Lopes <[email protected]>
# GPLv3+
##
from re import search
from difflib import context_diff
@lopes
lopes / pilsner.sh
Last active August 7, 2024 13:44
A backup script to be used with my external HDD. #shell #shellscript #backup #files #external #hdd
#!/usr/bin/env bash
#
# The MIT License (MIT)
# Copyright (c) 2016 José Lopes de Oliveira Jr.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the