Skip to content

Instantly share code, notes, and snippets.

View fakuivan's full-sized avatar

fakuivan

  • Posadas, Misiones, Argentina
  • 03:23 (UTC -03:00)
View GitHub Profile
@fakuivan
fakuivan / ui_common.inc
Created November 28, 2016 19:06
A function that greatly simplifies the use of a target filter on sourcemod
#if defined _ui_common_included
#endinput
#endif
#define _ui_common_included
typedef ActOnTarget = function void (int i_admin, int i_target, any a_data);
stock int Simplified_ProcessTargets(int i_admin, char[] s_target, ActOnTarget f_action, char[] s_format, char[] s_ml_phrase, char[] s_phrase, a_data, int i_flags = 0)
{
char s_target_name[MAX_TARGET_LENGTH];
@fakuivan
fakuivan / empty_folder_remover.py
Created December 19, 2016 21:49
A simple script that deletes all of those annoing empty folders on your backups
#Empty folder deleter: A simple script that deletes all of those annoing empty folders on your backups
import os
from pathlib import Path
import argparse
def delete_empty_folders(path):
no_empty_dirs = True
for root, dirs, files in os.walk(str(path), topdown=False):
if os.listdir(root) == []:
#pragma semicolon 1
#pragma newdecls required
#include <sourcemod>
#include <sdktools>
#include <events>
#define PLUGIN_VERSION "0.7"
public Plugin myinfo =
@fakuivan
fakuivan / updater_script_gen.py
Last active February 11, 2017 06:04
A python3.4 script for creating a update manifest for @GoD-Tony's plugin updater
import vdf
import os
import argparse
from pathlib import Path, PurePosixPath
class RemoteToPathFormatter:
def __init__(self, local_root, remote_root):
"""
local_root This Path or string should be replaced by your local root directory.
remote_root This PurePosixPath or string should be put instead of the local root.
@fakuivan
fakuivan / 21-netmount
Last active May 7, 2022 17:26
A hotplug script for OpenWRT systems to mount and unmount a remote CIFS partition
#!/bin/sh
# Place this file on /etc/hotplug.d/iface. Example entry (on /etc/config/fstab):
#------------------------------------------------------------
#config netmount
# option target '/mnt'
# option src '//ADDRESS/RESOURCE'
# option fstype 'cifs' #or nfs
## don't use qoutes inside the string, else the qoutes, they will not be removed
# option options 'user=USER,password=PASSWORD'
@fakuivan
fakuivan / sourcemod-buildenv.Dockerfile
Last active May 23, 2017 22:00
A complete (but w/o mysql and only the tf2 sdk) docker build environment for compiling sourcemod (1.8-dev branch) and its extensions, controlled by SSH.
FROM ubuntu
RUN apt update && apt upgrade -y && \
apt install -y git \
lib32stdc++6 \
lib32z1-dev \
libc6-dev-i386 \
linux-libc-dev \
lib32gcc-5-dev \
libgcc-5-dev \
@fakuivan
fakuivan / msysgit2unix-socket.py
Last active May 8, 2018 13:10 — forked from kevinvalk/msysgit2unix-socket.py
Set interpreter to ``/usr/bin/python2`` for compatiblility
#!/usr/bin/python2
"""
msysGit to Unix socket proxy
============================
This small script is intended to help use msysGit sockets with the new Windows Linux Subsystem (aka Bash for Windows).
It was specifically designed to pass SSH keys from the KeeAgent module of KeePass secret management application to the
ssh utility running in the WSL (it only works with Linux sockets). However, my guess is that it will have uses for other
@fakuivan
fakuivan / maincra_casita_finder.py
Last active February 25, 2020 14:22
Script for determining the block_id/chunk density for a specific minecraft world
#!/usr/bin/env python3
from nbt.nbt import NBTFile
from nbt.chunk import McRegionChunk
from nbt.world import WorldFolder, AnvilWorldFolder, McRegionWorldFolder
from pathlib import Path
from pprint import pprint
from typing import List, Dict, Tuple, Optional, Generator, Iterable, Union, NamedTuple, DefaultDict, Any
from collections import defaultdict
from io import TextIOWrapper
import json
@fakuivan
fakuivan / spot-on-bitrate.md
Last active June 14, 2023 15:00
Set Spotify quality to the maximum possible on desktop

Modify Spotify quality settings

Open Spotify's local storage directory, I'm using the appx version. Run this command in PowerShell

explorer `
  "$([System.IO.Path]::combine("$env:LOCALAPPDATA", `
                               "Packages", `
                               "$((Get-AppxPackage -Name "SpotifyAB.SpotifyMusic").PackageFamilyName)", `
                               "LocalState", `
 "Spotify", `
@fakuivan
fakuivan / struct_tree_walker.lua
Last active January 9, 2019 06:38
Use Cheat Engine's LUA engine to walk a struct to find offsets that match a given value and recursively walk potential structure pointers found within
function scanTree(address, maxOffset, comparator, structValidator, maxDepth)
local offsetTree = {}
address = getAddress(address)
for currentOffset = 0, maxOffset, 1 do
local currentAddress = address + currentOffset
if comparator(currentAddress) then
offsetTree[currentOffset] = true
end
if maxDepth > 0 then
local nextNode = readPointer(currentAddress)