Skip to content

Instantly share code, notes, and snippets.

View andreztz's full-sized avatar
🔨
High tech, low life.

André P. Santos andreztz

🔨
High tech, low life.
View GitHub Profile
@andreztz
andreztz / server.py
Created November 1, 2024 03:50 — forked from mdonkers/server.py
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer

projeto de dispenser de cigarros utilizando um servo motor e um controle por tempo com Arduino e outros componentes eletrônicos básicos.

Componentes sugeridos:

  1. Arduino Uno ou qualquer outro modelo compatível.
  2. Servo motor (como o SG90 ou MG996R, dependendo da força necessária).
  3. RTC (Real-Time Clock), como o DS3231, para garantir precisão no intervalo de 1 hora.
  4. Sensores de fim de curso (opcional, para garantir que o cigarro tenha sido ejetado com sucesso).
  5. Bateria ou fonte de alimentação para o Arduino.
  6. Estrutura física (pode ser feita com madeira, impressa em 3D ou qualquer outro material disponível) para suportar os cigarros horizontalmente e permitir que a gravidade os posicione corretamente.
https://easylist-downloads.adblockplus.org/easylistportuguese.txt
https://easylist-downloads.adblockplus.org/antiadblockfilters.txt
https://secure.fanboy.co.nz/fanboy-cookiemonster.txt
https://easylist.to/easylist/easylist.txt
https://easylist.to/easylist/easyprivacy.txt
https://secure.fanboy.co.nz/fanboy-annoyance.txt
https://pgl.yoyo.org/adservers/serverlist.php?showintro=0;hostformat=hosts
https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/filters-mobile.txt
https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/annoyances-cookies.txt
https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/annoyances-others.txt
@andreztz
andreztz / archlinux_unbound.sh
Created September 16, 2024 11:26 — forked from arainho/archlinux_unbound.sh
Unbound setup on ArchLinux
# Unbound is a validating, recursive, and caching DNS resolver.
https://wiki.archlinux.org/index.php/Unbound
# install unbound, expat
sudo pacman -Syy --noconfirm unbound expat ldns bind-tools
# setup etckeeper
sudo pacman -Syy --noconfirm etckeeper
git config --global user.email "me@armory"
git config --global user.name "Me Myself and I"
server:
# If no logfile is specified, syslog is used
# logfile: "/var/log/unbound/unbound.log"
verbosity: 0
interface: 127.0.0.1
port: 5335
do-ip4: yes
do-udp: yes
do-tcp: yes

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@andreztz
andreztz / Email Server (Linux, Unix, Mac).md
Created August 24, 2024 08:33 — forked from raelgc/Email Server (Linux, Unix, Mac).md
Setup a Local Only SMTP Email Server (Linux, Unix, Mac)

Setup a Local Only SMTP Email Server (Linux, Unix, Mac)

1 - Point localhost.com to your machine

Most of programs will not accept an email using just @localhost as domain. So, edit /etc/hosts file to make the domain localhost.com point to your machine, including this content to the file:

127.0.0.1 localhost.com

2 - Install Postfix

@andreztz
andreztz / validate_mac.py
Created August 19, 2024 23:43 — forked from EONRaider/validate_mac.py
Validate a MAC address using REGEX in Python 3
#!/usr/bin/env python3
# https://gist.github.com/EONRaider/c34f6799b9cf2259e90fce54a39d693c
__author__ = 'EONRaider, keybase.io/eonraider'
import re
def validate_mac(mac_address: str) -> bool:
is_valid_mac = re.match(r'([0-9A-F]{2}[:]){5}[0-9A-F]{2}|'
@andreztz
andreztz / socat.py
Created July 18, 2024 22:29 — forked from andyneff/socat.py
Python script to emulate socat behavior, but uses a single executable instead of one per connection
#!/usr/bin/env python
import os
import sys
from subprocess import Popen, PIPE
from socket import *
import atexit
from select import select
from logging import getLogger, basicConfig
@andreztz
andreztz / pyforw.py
Created July 18, 2024 22:29 — forked from staaldraad/pyforw.py
Python script to create a Connect-Connect tunnel. For those times ncat/socat can't be put on the box and python is available..
#!/usr/bin/python
"""
Python script to create a Connect-Connect tunnel. For those times ncat/socat can't be put on the box and python is available..
Author: Etienne Stalmans <etienne@sensepost.com>
Version: 1.0 (22_01_2015)
Usage: python pyforw.py <targetIP> <targetPort> <jumpbox> <jumpboxPort>
python pyforw.py 10.1.1.1 3389 179.0.0.100 8081
"""
from socket import *