Skip to content

Instantly share code, notes, and snippets.

@gustavorv86
gustavorv86 / tp-link-tl-wn821n-rtl8192eu-install.sh
Created November 8, 2023 09:45
Install Tp-Link wn821n rtl8192eu driver on GNU/Linux
@gustavorv86
gustavorv86 / README.md
Last active November 25, 2023 21:13
Reading an infrared (IR) receiver with Python on GNU/Linux

Reading an infrared (IR) receiver with Python on GNU/Linux

Many development boards incorporate an infrared receiver, such as Orange PI, Bananapi, Libre computer, Pine64, etc.

This manual explains how to configure the infrared receiver in Linux and shows an example of how to read the infrared codes emitted by a remote control.

Configuration

Show all input devices:

@gustavorv86
gustavorv86 / reverse-shell.py
Last active July 16, 2023 19:18
Linux Reverse Shell on Python.
#!/usr/bin/env python3
import argparse
import socket
import os
import pty
import sys
import time
WAIT_CONNECTION = 10
@gustavorv86
gustavorv86 / samba-server-for-xiaomi-cameras.md
Last active July 11, 2023 08:17
How to configure a low-cost NAS server for a Xiaomi MI Home Security Camera

Samba Server configuration for Xiaomi MI Home Security Camera

This manual explains how to set up a low-cost NAS server to store videos from a Xiaomi camera, model MI Security Camera.

You can use a development board Linux based such as Raspberry PI or similar, an old PC, Barebone etc.

NAS Server Configuration

Install samba.

@gustavorv86
gustavorv86 / debian-12-bookworm-sources.list
Last active July 11, 2023 08:16
Debian 12 Bookworm full repositories
deb http://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmware
deb-src http://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmware
deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
deb-src http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
deb http://deb.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
deb-src http://deb.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
deb http://deb.debian.org/debian/ bookworm-updates main contrib non-free non-free-firmware
@gustavorv86
gustavorv86 / tcp-file-transfer.py
Last active February 4, 2024 19:13
Python send and reveive files via TCP connection.
#!/usr/bin/env python3
import argparse
import logging
import os
import socket
import sys
BUFFER_SIZE = 1200
@gustavorv86
gustavorv86 / linux-bridge.md
Last active July 11, 2023 08:17
How to create a network bridge in Linux

How to create a network bridge in Linux

Requirements

Check if iproute2 is installed.

dpkg -s iproute2
@gustavorv86
gustavorv86 / attributes.py
Created April 16, 2022 10:37
Difference between Class Attributes and Instance Attributes in Python.
#!/usr/bin/env python3
class MyPersonClass:
# Class attributes
count_instances = 0
def __init__(self, name: str, surname: str, years: int):
MyPersonClass.count_instances += 1
@gustavorv86
gustavorv86 / signal-receiver.py
Last active April 16, 2022 10:23
Handling Linux process signals in Python
#!/usr/bin/env python3
import os
import signal
import sys
import time
PROCESS_PID_FILE = "process.pid"
_finish = False
@gustavorv86
gustavorv86 / dd-wrapper.sh
Last active June 23, 2023 15:18
dd (disk dump) wrapper. Prevents you from mistakenly writing to your computer's devices. Allows you to write only to the last removable connected device.
#!/bin/bash
BLACKLIST_DEVICES="/dev/sda /dev/sdb /dev/sdc /dev/sdd"
DD_BIN="/usr/bin/dd"
main() {
for arg in $@; do
for dev in $BLACKLIST_DEVICES; do
if [[ "$arg" == *"$dev"* ]]; then