Skip to content

Instantly share code, notes, and snippets.

View rafa-br34's full-sized avatar
🔴
Procrastinating...

rafa_br34 rafa-br34

🔴
Procrastinating...
View GitHub Profile
@rafa-br34
rafa-br34 / ReplicatingCommandBlocks.txt
Last active August 17, 2024 02:54
Self replicating command blocks.
clone ~-2 ~-1 ~-1 ~ ~1 ~1 ~1 ~-1 ~-1 replace // +x
clone ~2 ~-1 ~-1 ~ ~1 ~1 ~-3 ~-1 ~-1 replace // -x
clone ~-1 ~-2 ~-1 ~1 ~ ~1 ~-1 ~1 ~-1 replace // +y
clone ~-1 ~2 ~-1 ~1 ~ ~1 ~-1 ~-3 ~-1 replace // -y
clone ~-1 ~-1 ~-2 ~1 ~1 ~ ~-1 ~-1 ~1 replace // +z
clone ~-1 ~-1 ~2 ~1 ~1 ~ ~-1 ~-1 ~-3 replace // -z
summon falling_block ~ ~1 ~ {Time:1,BlockState:{Name:redstone_block},Passengers:[{id:armor_stand,Health:0,Passengers:[{id:falling_block,Time:1,BlockState:{Name:activator_rail},Passengers:[
{id:command_block_minecart,Command:"setblock ~1 ~4 ~ command_block{Command:'say +x',auto:1} replace"},
@rafa-br34
rafa-br34 / sudo.sh
Last active August 19, 2024 13:46
Bash script that fakes sudo
#!/bin/bash
# Bash hates CRLF, run 'sed -i -e "s/\r$//" script_name' to change from CRLF to LF
user=$(whoami)
sudo="/usr/bin/sudo"
stty -echoctl
if (( $# == 0 )); then
$sudo
@rafa-br34
rafa-br34 / Router.py
Created June 1, 2024 15:23
A simple class that can be used to interact with TOR
import requests
import stem.process
import stem.control
import stem
class Router:
control_port = 0
socket_port = 0
tor_process = None
@rafa-br34
rafa-br34 / Devices.py
Last active June 24, 2024 12:36
Interactive way of selecting which compute devices to use when background rendering with Blender
import cycles
import bpy
import sys
# blender -b file.blend -P Devices.py -o output_folder/frame_
# blender -b file.blend -P Devices.py -F PNG -x 1 -a -o output_folder/frame_
preferences = bpy.context.preferences
cycles_preferences = preferences.addons["cycles"].preferences
cycles_preferences.refresh_devices()
@rafa-br34
rafa-br34 / System32.ps1
Last active June 23, 2024 12:06
Removes useless files from System32
$CurrentUser = [Security.Principal.WindowsIdentity]::GetCurrent()
if (!(New-Object Security.Principal.WindowsPrincipal($CurrentUser)).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Host "Asking for privileges..."
Start-Process -FilePath "powershell" -ArgumentList ('-File', $MyInvocation.MyCommand.Source, $args | %{ $_ }) -Verb RunAs
exit
}
function KillProcess($Name) {
$Process = Get-Process $Name -ErrorAction SilentlyContinue
@rafa-br34
rafa-br34 / HostChecker.py
Created March 10, 2024 08:46
A simple python script to check if hosts are responding or not
import contextlib
import threading
import socket
import struct
from colorama import Fore, Back, Style
c_TargetsFile = "Targets.txt"
c_Timeout = 10
c_Threads = 200
@rafa-br34
rafa-br34 / CircuitMaker.js
Last active February 28, 2024 02:20
NodeJS save serializer for CM2
let CircuitMaker = {}
const Components = Object.freeze({
NOR: 0,
AND: 1,
OR: 2,
XOR: 3,
Button: 4,
FlipFlop: 5,
LED: 6,
@rafa-br34
rafa-br34 / Separate.py
Created January 22, 2024 07:25
Simple script to separate images acquired from Spector.js(https://github.com/BabylonJS/Spector.js/) into files.
import base64
import json
import sys
if len(sys.argv) < 3:
print("Expected 2 arguments, capture file, and output folder\n\tpython Separate.py Capture.json Frames/")
exit()
File = open(sys.argv[1], 'r')
@rafa-br34
rafa-br34 / Insecam.py
Created December 15, 2023 16:42
Insecam web scrapper with port checker built-in.
import latest_user_agents
import contextlib
import threading
import requests
import socket
import urllib
import time
from urllib3.exceptions import InsecureRequestWarning
from urllib.parse import urlparse
@rafa-br34
rafa-br34 / ImageToMindustry.py
Last active December 15, 2023 16:43
A somewhat WIP image to Mindustry logic converter.
import pyperclip
import math
from PIL import Image, ImageOps
c_MaxColorDifference = 4 # 4, 8, 16
c_TargetResolution = 176
c_SliceOperations = 998 # 998
c_DrawsPerFlush = 70
c_MaxCubeSize = 60