Skip to content

Instantly share code, notes, and snippets.

@anzz1
anzz1 / GoldSrc_CVE-2023-35855_RCE_fix.txt
Last active January 1, 2024 22:58
GoldSrc_CVE-2023-35855_RCE_fix
// Half-Life / GoldSrc Engine
// RCE Fix (Buffer Overflow)
//
// CVE: CVE-2023-35855
//
// Module: hw.dll
// Build: Aug 3 2020 (8684)
//
// Original SHA1 : f0f7372692f285154c76be35fc50b89ed0ea2d18
// Fixed SHA1 : 51c2ecb1ab8241b6afeae535a6a66dbd73a00a65
@anzz1
anzz1 / idna.class.php
Created August 8, 2023 12:11
idna.class.php
<?php
class IDNA {
public static function encode($string) {
$parts = explode('.', $string);
foreach ($parts as &$part) {
$part = self::to_ascii($part);
if ($part === false) return false;
}
return implode('.', $parts);
@anzz1
anzz1 / whois.php
Last active October 17, 2024 13:07
whois.php
<?php
/* Simple PHP WHOIS (PHP >= 4.0) */
/* https://gist.github.com/anzz1 */
/* --------------------- CONFIGURATION --------------------- */
// Clean up comments ('#', '%') and empty lines from the response
$NO_COMMENTS = false;
@anzz1
anzz1 / download.cmd
Last active September 7, 2024 21:59
download.cmd
<# :
@setlocal disabledelayedexpansion enableextensions
@echo off
powershell -nol -noni -nop -ex bypass -c "&{[ScriptBlock]::Create((cat '%~f0') -join [Char[]]10).Invoke(@(&{$args}%*))}"
exit /b
#>
function filesize($length) {
if($length -gt 1073741824) {
"{0:n1} GB" -f ($length / 1073741824)
@anzz1
anzz1 / gh-short.sh
Created June 15, 2023 05:35
GitHub git shorthands
#!/bin/sh
ghcommit() {
git config user.name "**USERNAME**" && \
git config user.email "**EMAIL**" && \
echo git commit && \
git commit
}
ghclone-s() {
if [ ! -z "$1" ]; then
@anzz1
anzz1 / boot2docker.x86_64.Vagrantfile
Last active February 27, 2024 20:09
vagrant-boxes
# boot2docker v18.01.0-ce 03596f5 Linux 4.4.111-boot2docker x86_64
## config
BOX_CPU_COUNT = "2"
BOX_RAM_MB = "4096"
DOCKER_IMAGE = "anzz1/miyoomini-toolchain:latest"
DOCKER_RUN = "/bin/bash"
Vagrant.configure("2") do |config|
@anzz1
anzz1 / disable_vim_auto_visual_on_mouse.txt
Created May 30, 2023 18:06 — forked from u0d7i/disable_vim_auto_visual_on_mouse.txt
Disable vim automatic visual mode on mouse select
Disable vim automatic visual mode on mouse select
issue: :set mouse-=a
add to ~/.vimrc: set mouse-=a
my ~/.vimrc for preserving global defaults and only changing one option:
source $VIMRUNTIME/defaults.vim
set mouse-=a
@anzz1
anzz1 / buildconf.sh
Created May 24, 2023 22:40
buildconf.sh
#!/bin/sh
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
#
@anzz1
anzz1 / joaat.c
Created May 17, 2023 14:32
joaat
// joaat.c
#include <stdio.h>
unsigned long joaat_i(const unsigned char* s) {
unsigned long hash = 0;
while (*s) {
hash += ((*s>64&&*s<91)?((*s++)+32):*s++); // A-Z -> a-z
hash += (hash << 10);
hash ^= (hash >> 6);
@anzz1
anzz1 / gh-new-repo-101.md
Last active August 12, 2023 13:58
GitHub New Repo 101

GitHub New Repo 101

Main Page

https://github.com/USER/REPO/

Click the gear icon on the right sidebar next to "About".

Include in the home page

Uncheck everything you don't need to remove clutter.
When in doubt, uncheck. You can always recheck later.