Skip to content

Instantly share code, notes, and snippets.

View devsamuelv's full-sized avatar
🌊
Bit surfing

Samuel Villegas devsamuelv

🌊
Bit surfing
View GitHub Profile
@devsamuelv
devsamuelv / install.sh
Created February 12, 2024 16:13
docker install
#!/bin/bash
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
#!/bin/bash
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
from multiprocessing import Process
# A simple process manager to control a single daemon at a time.
class Orchestrator:
def __init__(self) -> None:
self._current_process = None
pass
def schedule(self, thread: Process) -> bool:
@devsamuelv
devsamuelv / orchestrator.py
Created December 3, 2023 21:57
A simple thread manager.
from threading import Thread
from threading import Thread
# A simple thread manager to control a single daemon at a time.
class Orchestrator:
def __init__(self) -> None:
self.current_thread = None
pass
@devsamuelv
devsamuelv / caesar_n1.py
Created September 25, 2023 14:00
Simple Caesar cipher with one rotation
import string
text = "Y29uZ3JhdHMgb24gc29sdmluZyB0aGlzIQ=="
new_t = ""
al = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
"m", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
def encode(char: str) -> str:
@devsamuelv
devsamuelv / wireguard.conf
Created February 5, 2023 07:59 — forked from nealfennimore/wireguard.conf
Wireguard VPN - Forward all traffic to server
# ------------------------------------------------
# Config files are located in /etc/wireguard/wg0
# ------------------------------------------------
# ---------- Server Config ----------
[Interface]
Address = 10.10.0.1/24 # IPV4 CIDR
Address = fd86:ea04:1111::1/64 # IPV6 CIDR
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE; ip6tables -A FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -A POSTROUTING -o eth0 -j MASQUERADE # Add forwarding when VPN is started
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE; ip6tables -D FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -D POSTROUTING -o eth0 -j MASQUERADE # Remove forwarding when VPN is shutdown
@devsamuelv
devsamuelv / automator.py
Created April 19, 2022 05:08
discord message automator
from time import sleep
from pynput import mouse, keyboard
m = mouse.Controller()
k = keyboard.Controller()
payload = input("message payload: ").split(" ")
print("you have five seconds.")
@devsamuelv
devsamuelv / iptables-reload.sh
Last active December 22, 2021 04:00 — forked from tehmoon/iptables-reload.sh
IPtables and docker reload!
#!/bin/sh
set -e
## SEE https://medium.com/@ebuschini/iptables-and-docker-95e2496f0b45
## You need to add rules in DOCKER-BLOCK AND INPUT for traffic that does not go to a container.
## You only need to add one rule if the traffic goes to the container
CWD=$(cd "$(dirname "${0}")"; pwd -P)
FILE="${CWD}/$(basename "${0}")"
@devsamuelv
devsamuelv / kickoff_counter.py
Created November 30, 2021 02:59
Time Until FRC Kickoff
import datetime
import dateutil.rrule
today = datetime.datetime.today()
kickoff = datetime.datetime(2022, 1, 8, 11, 30)
untill = kickoff - today
print(str(untill.days) + "." + str(untill.seconds))
@devsamuelv
devsamuelv / hello_world_cc.lua
Created July 18, 2021 03:32
Computer Craft Hello World
local global_init = true
local lastTorch = 0
local currentTorch = 0
local totalSlots = 16
local currentSlot = 1
function attack()
turtle.attack()
end