Skip to content

Instantly share code, notes, and snippets.

Avatar

Paulo Matias thotypous

View GitHub Profile
@thotypous
thotypous / synth-cw.py
Last active Sep 5, 2021
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
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 Sep 5, 2020
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)
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 Apr 12, 2020
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 Dec 30, 2018
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 Dec 7, 2018
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
@thotypous
thotypous / eth_rawsock.py
Created Nov 20, 2018
Exemplo de envio e recebimento de pacotes em camada de enlace
View eth_rawsock.py
import socket
import asyncio
import struct
ETH_P_ALL = 0x0003
ETH_P_IP = 0x0800
ICMP = 0x01 # https://en.wikipedia.org/wiki/List_of_IP_protocol_numbers
@thotypous
thotypous / ip_rawsock.py
Last active Nov 6, 2018
Exemplo de envio e recebimento de pacotes em camada de rede (protocolo IPv4)
View ip_rawsock.py
import socket
import asyncio
import struct
ETH_P_IP = 0x0800
# Coloque aqui o endereço de destino para onde você quer mandar o ping
dest_addr = '186.219.82.1'