Skip to content

Instantly share code, notes, and snippets.

View wesinator's full-sized avatar

Wes wesinator

View GitHub Profile
@wesinator
wesinator / load_tui_grid.html
Created February 4, 2020 17:51
Load TUI grid from jsdelivr cdn
<!--TUI grid vue-->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/tui-grid.min.js" integrity="sha256-dnG2gatS89cYrQQsKOZ7pAAX8iz82SfOLW82Cm7/Q3A=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@toast-ui/[email protected]/dist/toastui-vue-grid.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tui-grid.min.css"></script>
Windows Registry Editor Version 5.00
; mitigates https://anothercybersecurityblog.wordpress.com/2020/01/22/a-microsoft-windows-patch-status-information-disclosure-with-a-lesson-for-software-and-system-designers-if-they-want-to-actually-build-secure-products/
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\AutoUpdate]
"UpdatesAvailableForInstallLogon"=dword:00000000
@wesinator
wesinator / twitter_block_sensitive_media.js
Created January 4, 2020 21:36
Prevent sensitive media from being opened on Twitter.
// ==UserScript==
// @name Twitter sensitive media blocker
// @version 1
// @grant none
// @match https://twitter.com/*
// @run-at document-idle
// ==/UserScript==
function blockTwitterSensitiveMedia() {
var blockedMedia = document.getElementsByClassName("Tombstone-action");
import "strings"
// return index of second to last occurrence of char in string
func SecondToLast(str string, char string) int {
return strings.LastIndex(str[0:strings.LastIndex(str, char)], char)
}
@wesinator
wesinator / docutils.conf
Last active December 18, 2019 15:33
Disable those pesky smart quotes in readthedocs. https://github.com/readthedocs/readthedocs.org/issues/2940
# https://github.com/readthedocs/readthedocs.org/issues/2940
[parsers]
smart_quotes: false
@wesinator
wesinator / install_docker_centos.sh
Last active December 7, 2019 03:48
Install scripts for CentOS
# install / setup docker from mainline stable repo
# https://www.hostinger.com/tutorials/how-to-install-docker-compose-centos-7/
DOCKER_COMPOSE_VER=1.25.0
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce
sudo usermod -a -G docker $USER
sudo systemctl start docker
@wesinator
wesinator / yara_to_dict.py
Last active June 14, 2020 20:59
Convert yara-python C interface objects to usable python dict data structure.
# reduces yara.Match object to dict
# work around yara.Match pickling issue with multiprocessing
# https://github.com/VirusTotal/yara-python/issues/84#issuecomment-562228512
# yara.Match also does not work with __dict__ or json, or else I would use that
def yaraMatchesToDict(yara_matches):
match_list = []
for item in yara_matches:
# reproduce structure in https://yara.readthedocs.io/en/latest/yarapython.html#yara.Match
# using accessible python dict data structure
@wesinator
wesinator / .vimrc
Created November 25, 2019 17:06
sane VI config
" https://vi.stackexchange.com/questions/7975/how-can-i-change-the-indent-size
set ts=4 sw=4
// https://www.us-cert.gov/sites/default/files/file_attach/ICS-ALERT-17-206-01.yara
// YARA 3.6.0 or higher is required to use this signature
import "pe"
private global rule coi_is_pe {
condition:
uint16(0) == 0x5a4d and uint32(uint32(0x3c)) == 0x00004550
}
# https://bugs.launchpad.net/ubuntu/+source/sendmail/+bug/1822866/comments/9
sudo rm -v /var/run/sendmail/mta/sendmail.pid