Skip to content

Instantly share code, notes, and snippets.

View thotypous's full-sized avatar

Paulo Matias thotypous

View GitHub Profile
@thotypous
thotypous / rede_de_dormir.py
Last active April 18, 2023 21:15
Cálculo do comprimento ideal de uma rede de dormir
View rede_de_dormir.py
#!/usr/bin/env python
from sympy import sinh, acosh, sqrt, nsolve, Symbol, Float
def calcular_rede(altura_rede, altura_ganchos, distancia_ganchos):
H = distancia_ganchos
h = altura_ganchos - altura_rede
a = Symbol('a')
L = Symbol('L')
@thotypous
thotypous / plot.py
Last active February 27, 2023 13:13
Medição de latência e velocidade de download e upload para diversos servidores
View plot.py
import re
import math
import itertools
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import numpy as np
from datetime import datetime
from collections import defaultdict
@thotypous
thotypous / synth-cw.py
Last active September 5, 2021 16:34
morse CW keyer using jack
View synth-cw.py
#!/usr/bin/env python3
import jack
import curses
import queue
from math import sin, pi
f = 700 # Hz
#duration = 0.240 # seconds
duration = 0.080 # seconds
latency = 0.020 # seconds
@thotypous
thotypous / gerar_certificados_aciepe.py
Last active May 9, 2021 10:34
Gera automaticamente certificados para uma ACIEPE no SEI da UFSCar
View gerar_certificados_aciepe.py
#!/usr/bin/env python3
import xml.etree.ElementTree as ET
from urllib.parse import urlencode
from html import unescape
import argparse
import requests
import locale
import time
import csv
import os
@thotypous
thotypous / check_trustees.py
Created September 5, 2020 22:09
Check if combined public key was correcly computed
View check_trustees.py
#!/usr/bin/env python3
import requests
import sys
import os
import re
election_uuid = sys.argv[1]
base_url = 'https://votacao.ufscar.br'
login_url = '{}/auth/ldap/login'.format(base_url)
@thotypous
thotypous / reeval_pr.py
Created May 29, 2020 21:07
For NIZKCTF
View reeval_pr.py
#!/usr/bin/env python3
from nizkctf.team import Team
from nizkctf.acceptedsubmissions import AcceptedSubmissions
from nizkctf.settings import Settings
from nizkctf.proof import proof_open
import os
import sys
import requests
import datetime
import pytz
@thotypous
thotypous / PKGBUILD
Last active April 12, 2020 13:57
bluespec-git PKGBUILD
View PKGBUILD
# Maintainer: Jiuyang Liu <liujiuyang1994@gmail.com>
# Maintainer: Paulo Matias <matias@ufscar.br>
pkgname=bluespec-git
pkgver=r285.9dfe8f5
pkgrel=1
pkgdesc='Bluespec Compiler (BSC)'
arch=('x86_64')
url='https://github.com/B-Lang-org/bsc'
license=('BSD')
View sync_accepted.py
#!/usr/bin/python3
from nizkctf.team import Team, SUBMISSIONS_FILE
from nizkctf.acceptedsubmissions import AcceptedSubmissions
from nizkctf.subrepo import SubRepo
from nizkctf.settings import Settings
import os
import subprocess
import requests
import datetime
import pytz
@thotypous
thotypous / juggle.xml
Created December 30, 2018 17:06
35C3 Juggle challenge solution
View juggle.xml
<?xml version="1.0" encoding="UTF-8"?>
<meal>
<course> <!-- #0 -->
<!-- jump if there are iterations to do -->
<plate><paella>5</paella></plate> <!-- course number -->
<plate><paella>1</paella></plate>
<plate><불고기/></plate>
<plate><æblegrød/></plate>
<!-- otherwise print flag and exit -->
@thotypous
thotypous / unisolate.sh
Created December 7, 2018 12:13
Contorna o isolamento entre diferentes computadores na rede eduroam da UFSCar
View unisolate.sh
#!/bin/bash
gw="$(ip route | grep -Po '^default via \K\d+\.\d+\.\d+\.\d+')"
iface="$(ip route | grep -Po '^default via \d+\.\d+\.\d+\.\d+ dev \K[^ ]+')"
local_subnet_forwarding_rule="$(ip route | grep -P "^\d+\.\d+\.\d+\.\d+/\d+ dev $iface .*? link src")"
gw_forwarding_rule="$gw $(echo "$local_subnet_forwarding_rule" | grep -Po '^\d+\.\d+\.\d+\.\d+/\d+ \K.+')"
if [[ ! -z "$local_subnet_forwarding_rule" ]]; then
set -xe