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

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 *
@andreztz
andreztz / ffmpeg.md
Created June 22, 2024 21:44 — forked from liangfu/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

@andreztz
andreztz / httpsrv.py
Created May 2, 2024 20:42 — forked from darkr4y/httpsrv.py
python simple http server with upload & download
#!/usr/bin/env python
"""Extend Python's built in HTTP server to save files
curl or wget can be used to send files with options similar to the following
curl -X PUT --upload-file somefile.txt http://localhost:8000
wget -O- --method=PUT --body-file=somefile.txt http://localhost:8000/somefile.txt
__Note__: curl automatically appends the filename onto the end of the URL so
@andreztz
andreztz / delete-likes-from-twitter.md
Created April 19, 2024 18:04 — forked from aymericbeaumet/delete-likes-from-twitter.md
[Recipe] Delete all your likes/favorites from Twitter

Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.

  1. Go to: https://twitter.com/{username}/likes
  2. Open the console and run the following JavaScript code:
setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
    d.click()
 }
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andreztz
andreztz / gpu-passthrough.md
Created December 2, 2023 01:26 — forked from MaxXor/gpu-passthrough.md
Arch GPU Passthrough Summary

Arch Linux GPU-Passthrough

A quick guide on how to setup a GPU-Passthorugh. Below are some of my Resources

The Arch Wiki is the goto place for additional information and performance tweaks like CPU-Pinning.

Requirements

  • IGPU or second dedicated GPU for Host system (unless you want to go the hard way and use one GPU for HOST and GUEST)