Skip to content

Instantly share code, notes, and snippets.

View arizvisa's full-sized avatar
🖕

Ali Rizvi-Santiago arizvisa

🖕
  • Everything here is BSD Licensed unless specified otherwise.
View GitHub Profile
9.0 bd1c5927f0ad44048fcd9cc42a9a743504e6c7a0
8.4 ae62cd4df534f18c8c3dc47bd159d50c9822d82d
8.3 e6841a95a3ded187a9447c94c14aa9fd5fe2fbdd
8.2SP1 27fa71c5ac6404268db8d59c8fedd760855a9de0
8.2 425d9e585e0acfbb5e8dcc6de1c0c7ae34e1b3da
8.1 29512d9c486e5485d6c5236b355b0579a23e8da7
8.0 023c5ba53ca91c730d39539c2c50778ac8e5cd87
7.7 3ce5b7f06dfdba36eb84d679c08248734a12036a
7.6SP1 e8e2a7bb8cf7f79c6bb254d6fd824881965d0dfc
7.6 c22e07185389adaef1698314071f2c6cd31dd08b
@arizvisa
arizvisa / bugs.python.org.lst
Last active November 30, 2024 08:44
references to old bugs.python.org reports that weren't migrated.
https://bugs.python.org/issue35172 -> https://github.com/python/cpython/issues/79353
https://bugs.python.org/issue35173 -> https://github.com/python/cpython/issues/79354
https://www.plurk.com/p/3g89qh2j4f
@arizvisa
arizvisa / weggli.dc73a25ec28ca42d65517042988fc95076d851e7.patch
Created July 18, 2024 18:16
Patch to weggli-rs/weggli@dc73a25 to add support for spans and bounds to the python module.
From b322ecac9992c8bd8c3dfeaf2579a0b2b4b81336 Mon Sep 17 00:00:00 2001
From: Ali Rizvi-Santiago <arizvisa@gmail.com>
Date: Sat, 28 May 2022 11:49:00 -0500
Subject: [PATCH 1/2] saving my game prior to modifying the tree-sitter-c
grammar
100.0% src/
diff --git a/src/builder.rs b/src/builder.rs
index 13908b0..f600032 100644
@arizvisa
arizvisa / ∕usr∕local∕etc
Last active June 1, 2024 22:17
/usr/local/etc/
$ fuck gh's sorting algorithm and their decision of using the first filename as the gist uri...
@arizvisa
arizvisa / ss-telefrag.py
Created June 21, 2023 19:57
random python code
if __name__ == 'TELEFRAG':
import math, random, ptypes, office.storage
from ptypes import *
source = ptypes.provider.file(rp, 'rw')
source = ptypes.setsource(source)
state = random.Random()
## file
store = office.storage.File()
@arizvisa
arizvisa / internal.interface.py
Created March 5, 2023 07:15
internal.name.typeref for temporary renaming unparsable type declaration.
diff --git a/misc/interface.py b/misc/interface.py
index 4a9504fe5..94b77514b 100644
--- a/misc/interface.py
+++ b/misc/interface.py
@@ -6107,3 +6107,42 @@ class name(object):
logging.fatal(u"{:s}.netnode({:#x}{:s}) : Unable to restore the original name (\"{:s}\") for the netnode at {:#x} which is currently named \"{:s}\".".format('.'.join([__name__, cls.__name__]), identifier, '' if name is None else ", name=\"{:s}\"".format(name), internal.utils.string.escape(original, '"'), identifier, internal.utils.string.escape(temporary, '"')))
logging.info(u"{:s}.netnode({:#x}{:s}) : The original name (\"{:s}\") is currently associated with the netnode at {:#x}.".format('.'.join([__name__, cls.__name__]), identifier, '' if name is None else ", name=\"{:s}\"".format(name), internal.utils.string.escape(original, '"'), internal.netnode.get(original)))
return
+
+ @classmethod
@arizvisa
arizvisa / vcenter-authentication-policies.patch
Last active March 3, 2023 02:20
remove all stupid authentication-related polices from vcenter
--- /dev/null 2023-02-27 00:26:22.135999836 +0000
+++ /etc/pam.d/system-account- 2022-11-08 08:17:09.000000000 +0000
@@ -0,0 +1,7 @@
+# Begin /etc/pam.d/system-account
+# Updated by Ansible - 2022-11-08T08:17:09.196506
+
+account required pam_unix.so
+account required pam_tally2.so deny=3 onerr=fail audit even_deny_root unlock_time=900 root_unlock_time=300
+
+# End /etc/pam.d/system-account
@arizvisa
arizvisa / nested.py
Created February 21, 2023 02:14
modification of nested characters or tokens
def indices(string, characters):
'''Return a generator that yields each index of the given `characters` found in `string`.'''
iterable = (string.find(character) for character in characters)
current, index = 0, min([index for index in iterable if 0 <= index] or [-1])
while 0 <= index:
yield current + index
current, string = current + 1 + index, string[1 + index:]
iterable = [string.find(character) for character in characters]
index = min([index for index in iterable if 0 <= index] or [-1])
return
@arizvisa
arizvisa / blabla.py
Last active February 9, 2024 19:16
shirtz
# gen_key returns privkey as bytes and pem
# load_key will read a key from some bytes (decrypting if a pass is provided), asking user for input, returning privkey as bytes and pem
# gen_certificate takes your private key as bytes and some keywords, returning a cert and pubkey
# load_certificate takes private key and cert as bytes, returning a cert and pubkey
# setup_ssl is just example code how to use those things
def gen_key(e=65537, bits=1024):
import cryptography.hazmat.primitives.asymmetric.rsa as chpar
import cryptography.hazmat.primitives.serialization as chps
import cryptography.hazmat.backends as chb
@arizvisa
arizvisa / multicase.py
Last active December 26, 2022 21:43
constraints with some fixes and some better scoring for performance testing
class multicase(object):
"""
A lot of magic is in this class which allows one to define multiple cases
for a single function.
"""
CO_OPTIMIZED = 0x00001
CO_NEWLOCALS = 0x00002
CO_VARARGS = 0x00004
CO_VARKEYWORDS = 0x00008
CO_NESTED = 0x00010