Skip to content

Instantly share code, notes, and snippets.

View BigNerd95's full-sized avatar

Lorenzo Santina BigNerd95

View GitHub Profile
@BigNerd95
BigNerd95 / better_zip.sh
Created January 8, 2018 17:25
More compressed and more privacy in zip files
#!/bin/bash
usage(){
echo "Usage:"
echo "$0 FOLDER_TO_COMPRESS [-e] [-v]"
echo "-e: encrypt"
echo "-v: verbose"
}
compress(){
; compile with
; nasm -f elf32 test_main.asm && gcc -o test_main -m32 test_main.o && ./test_main
section .data
msg db 'Elevazione a potenza', 13, 10, 0
base_str db 'Base: %d ', 13, 10, 0
esp_str db 'Esponente: %d', 13, 10, 0
res_str db 'Risultato: %d', 13, 10, 0
base dd 5
@BigNerd95
BigNerd95 / tethering_enabler.txt
Created November 27, 2017 20:40
ADB shell commands to enable tethering on Android Nougat [root required]
echo "Android Nougat Tethering enabler by BigNerd95"
echo
echo "Backingup build.prop in /sdcard/build.prop.backup"
cp /system/build.prop /sdcard/build.prop.backup
cp /system/build.prop /sdcard/build.prop
echo "Editing build.prop"
echo net.tethering.noprovisioning=true >> /sdcard/build.prop
@BigNerd95
BigNerd95 / recv_fw.sh
Last active May 11, 2020 18:20
Fast update scripts for LEDE/OpenWRT
#!/bin/sh
# run this script on ROUTER
ipaddr=$1
# recv checksum
check=$(nc $ipaddr 1235)
echo "Received checksum: $check"
@BigNerd95
BigNerd95 / glddnsupdater.sh
Last active May 1, 2019 00:24
GL.iNet ddns update script [will associate your wan IP to puXXXXX.gl-inet.com where XXXXX are the latest 5 bytes of the mac address]
#!/bin/sh
# OpenWRT support libs
. /lib/functions.sh
. /lib/functions/network.sh
. /usr/share/libubox/jshn.sh
ip_regex="[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}"
ddns=
code=
@BigNerd95
BigNerd95 / 800-ath9k-bypass-eeprom-power.patch
Last active March 23, 2024 09:32
Atheros ART power limit bypass, linux regulatory will be applied (e.g.: iw phy phy0 set txpower fixed 3100)
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -5142,6 +5142,11 @@ static void ar9003_hw_set_power_per_rate
scaledPower = ath9k_hw_get_scaled_power(ah, powerLimit,
antenna_reduction);
+ minCtlPower = (u8) min(MAX_RATE_POWER, scaledPower);
+ for (i = 0; i < ar9300RateSize; i++)
+ pPwrArray[i] = (u8) minCtlPower;
+ return;
@BigNerd95
BigNerd95 / regd_diff.c
Last active March 1, 2023 09:05
Atheros Country Code ART bypass passing a custom Country Name when loading the driver (e.g.: insmod ath cn=AU)
char *user_country_name = ""; // [MOD]
module_param_named(cn, user_country_name, charp, S_IRUGO); // [MOD]
MODULE_PARM_DESC(cn, "Country Name"); // [MOD]
static int __ath_regd_init(struct ath_regulatory *reg)
{
struct country_code_to_enum_rd *country = NULL;
u16 regdmn;
if (!reg)
@BigNerd95
BigNerd95 / ar9003_eeprom_diff.c
Last active December 5, 2021 14:36
Atheros ART bypass reading the modified dump from /etc/config/my_eeprom (the file must contain only the struct ar9300_eeprom [1088 bytes])
// Add these lines after the Copyright
#include <linux/fs.h>
#include <asm/uaccess.h>
#include <asm/segment.h>
#include <linux/buffer_head.h>
// Copy these functions before ar9300_eeprom_restore_flash function
struct file *file_open(const char *path, int flags, int rights)
{
struct file *filp = NULL;
##### WiIvrea Authentication for OpenWRT ####
is_authenticated(){
local res=$(wget -q -O - http://172.172.172.1/login | grep "You are logged in" | wc -l)
if [ $res = "1" ]
then
return 0 # true
else
return 1 # false
fi
@BigNerd95
BigNerd95 / Tecnoalarm.py
Last active May 11, 2020 21:16
Protocol dumper and cipher for Tecnoalarm Security Systems
#!/usr/bin/env python3
from Crypto.Cipher import AES
class TACipher():
def __init__(self, key, iv):
self._key = key # bytes
self._iv = iv # bytes
self._tail = bytes()
self._padding = 0