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
@arizvisa
arizvisa / mppc.py
Created October 6, 2021 00:30
RFC2118 (found in an old home directory)
import ptypes
from ptypes import *
from ptypes.bitmap import RBitmap, WBitmap
import six, array, math
class Encode(object):
@classmethod
def byte(cls, wb, by):
if by & 0x80:
@arizvisa
arizvisa / vincenthEE-DotEditor-v0.3.1.patch
Created November 5, 2020 02:33
vincenthEE/DotEditor/tree/v0.3.1
diff --git a/DEUtils.py b/DEUtils.py
index 90c781e..542ee32 100644
--- a/DEUtils.py
+++ b/DEUtils.py
@@ -280,7 +280,8 @@ def normalize_imglist(image_list):
pos_y = int((max_h-h)/2)
new_img = wx.EmptyImage(max_w, max_h)
- new_img.Clear(0xff)
+ #new_img.Clear(0xff)
@arizvisa
arizvisa / developer-console-extensions.js
Created September 23, 2020 18:23
Developer Console Extensions (greasemonkey)
// ==UserScript==
// @name Developer Console Extensions
// @description This adds a number of utilities to the developer console object
// @version 1
// @noframes
// @run-at document-end
// @grant none
// ==/UserScript==
/*
@arizvisa
arizvisa / dd_vcredist_x86_20200610171145.log
Created June 10, 2020 22:43
Salt-Minion-3001rc1-Py3-x86-Setup.exe.log
[0B04:0B0C][2020-06-10T17:11:45]i001: Burn v3.7.3424.0, Windows v6.3 (Build 9600: Service Pack 0), path: C:\Users\root\AppData\Local\Temp\nsr6DE.tmp\vcredist_x86_2013.exe, cmdline: '/install /quiet /norestart -burn.unelevated BurnPipe.{465D8657-5FD5-4436-9E60-3780B4270052} {4DB24AA4-92B3-45A3-984B-77F9450AF437} 2304'
[0B04:0B0C][2020-06-10T17:11:45]i000: Setting string variable 'WixBundleLog' to value 'C:\Users\root\AppData\Local\Temp\dd_vcredist_x86_20200610171145.log'
[0B04:0B0C][2020-06-10T17:11:45]i000: Setting string variable 'WixBundleOriginalSource' to value 'C:\Users\root\AppData\Local\Temp\nsr6DE.tmp\vcredist_x86_2013.exe'
[0B04:0B0C][2020-06-10T17:11:45]i000: Setting string variable 'WixBundleOriginalSourceFolder' to value 'C:\Users\root\AppData\Local\Temp\nsr6DE.tmp\'
[0B04:0B0C][2020-06-10T17:11:45]i000: Setting string variable 'WixBundleName' to value 'Microsoft Visual C++ 2013 Redistributable (x86) - 12.0.40664'
[0B04:0B0C][2020-06-10T17:11:45]i100: Detect begin, 2 packages
[0B04:0B0C][2020-06-1
This file has been truncated, but you can view the full file.
=== Logging started: 6/10/2020 17:09:01 ===
Action 17:09:01: INSTALL.
Action start 17:09:01: INSTALL.
Action 17:09:01: SystemFolder_x86_VC.41084701_5F61_3497_AC5D_D0A6D4A85536.
Action start 17:09:01: SystemFolder_x86_VC.41084701_5F61_3497_AC5D_D0A6D4A85536.
Action ended 17:09:01: SystemFolder_x86_VC.41084701_5F61_3497_AC5D_D0A6D4A85536. Return value 1.
Action 17:09:01: SystemFolder.41084701_5F61_3497_AC5D_D0A6D4A85536.
Action start 17:09:01: SystemFolder.41084701_5F61_3497_AC5D_D0A6D4A85536.
Action ended 17:09:01: SystemFolder.41084701_5F61_3497_AC5D_D0A6D4A85536. Return value 1.
Action 17:09:01: SystemFolder_x86_VC.194841A2_D0F2_3B96_9F71_05BA91BEA0FA.
@arizvisa
arizvisa / memoize.py
Last active May 4, 2020 20:38
python memoization decorator
'''
Example:
# Memoize result from `myfunction1` depending on the arg1 and arg3 parameters.
@memoize('arg1', 'arg3')
def myfunction1(arg1, arg2, arg3):
...
res = myfunction1('key1', 'meh', 7)
# Memoize result from `myfunction2` depending on 'prop' attribute from "argobject" parameter.
@arizvisa
arizvisa / subprocess-spawn.py
Last active May 4, 2020 20:19
Running a sub-process asynchronously and receiving a callback when any output is ready
########################################################################
# Wrappers if you want to use gevent for light-weight threading #
########################################################################
try:
if 'gevent' not in sys.modules:
raise ImportError
import gevent
# wrapper around greenlet since my instance of gevent.threading doesn't include a Thread class for some reason.
1000 exit
1001 cd work/salt/
1002 ls
1003 git branch
1004 git log
1005 git fetch
1006 git show 43f9a0
1007 cd requirements/
1008 ls
1009 l base.txt
@arizvisa
arizvisa / lamegraph.sh
Created March 28, 2019 16:58
Generate a dependency graph for a bunch of PE (*.dll and *.exe) files linking imports to dlls and exports
(
echo 'digraph lamegraph {'
find . -name '*.exe' -type f -o -name '*.dll' -type f | while read fn; do
sn=$( basename "$fn" )
python $SYRINGE/tools/pe.py -Olist -e "$fn" | tr -d $'\r' | cut -d: -f3 | while read e; do
printf '"%s" -> "%s!%s";\n' "$sn" "$sn" "$e"
break
done
python $SYRINGE/tools/pe.py -Olist -i "$fn" | while IFS=: read i module; do
wtf=`echo -n "$module" | tr -d $'\r'`
@arizvisa
arizvisa / user-prefs.js
Last active July 18, 2022 18:20
Firefox anti-networking/privacy/fuzzing preferences
// crash recovery
user_pref("toolkit.startup.recent_crashes", "");
user_pref("browser.sessionstore.resume_from_crash", false);
// browser settings
user_pref("browser.startup.homepage", "about:blank");
user_pref("browser.newtabpage.enabled", false);
// browser notifications
user_pref("general.warnOnAboutConfig", false);