Skip to content

Instantly share code, notes, and snippets.

View socram8888's full-sized avatar
🐲
Unprofessional lizardman

Marcos Del Sol Vives socram8888

🐲
Unprofessional lizardman
View GitHub Profile
@socram8888
socram8888 / FastHex.java
Last active December 23, 2015 06:09
Fastest byte-to-hex function I could program
// Marcos Vives Del Sol - 17/IX/2013
// License: WTFPL
import java.lang.reflect.Constructor;
public class FastHex {
private static Constructor<String> STRING_CONSTRUCTOR = null;
private static final char[] HEX_CHAR = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
public static final String hex(byte[] data) {
// Cache to reduce field access
public class BlockAreaSet implements Set<Block> {
private final World world;
private final int baseX;
private final int baseY;
private final int baseZ;
private final int sizeX;
private final int sizeY;
@socram8888
socram8888 / firmunpack.sh
Created July 13, 2015 15:05
3DS NATIVE_FIRM unpacker
#!/bin/bash -e
odbin() {
od --output-duplicates --address=none --endian=little $*
}
rdu32() {
odbin --format d4 --skip-bytes "$2" --read-bytes 4 "$1" | tr -c -d [:digit:]
}
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import urllib.request
import urllib.parse
import json
import re
import time
import threading
#!/bin/bash
RTFM="
PLEASE READ THE FUCKING MANUAL
NO, REALLY,
███████▄▄ ██████████ ██████████ ██▄▄ ▄▄██
██ ▀▀█▄ ██ ██ ██▀██▄ ▄██▀██
██ ██ ██ ██ ██ ▀██▄██▀ ██
██ ▄██▀ ██ ██ ██ ▀█▀ ██
#!/bin/bash
# Fail on error
set -e
cd "$(dirname "$0")"
Version=buster
BootPart=/home/marcos/rpibuild/fat.bin
RootPart=/dev/sdb1
#define RW_PIN 7
#define PHI_PIN 8
#define RST_PIN 9
#define SYNC_PIN 6
int DATA_PINS[] = { 10, 11, 12, 13, A0, A1, A2, A3 };
void ph8(uint8_t x) {
if (x < 0x10) {
@socram8888
socram8888 / epc3825ip.py
Created March 1, 2019 10:20
Cisco EPC3825 retriever for ddclient
#!/usr/bin/env python3
import argparse
import requests
import sys
from lxml import html
parser = argparse.ArgumentParser(description='Retrieves IP from EPC3825 routers.')
parser.add_argument('--base', help='Base router prefix', default='http://192.168.0.1')
parser.add_argument('username', help='Administration user name')
#!/bin/bash -e
if [ $# -ne 1 ]; then
echo "Usage: $0 device"
exit 1
fi
SectorCount=$(( `blockdev --getsize "$1"` - 1 ))
echo -n "Password: "
@socram8888
socram8888 / dns-tor.sh
Last active December 11, 2021 19:10
DNS over Tor sysvinit script using stunnel
#!/bin/sh
### BEGIN INIT INFO
# Provides: dns-tor
# Required-Start: $remote_fs $network tor
# Required-Stop: $remote_fs $network tor
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: DNS over Tor
# Description: Domain Name Resolution over Tor