Skip to content

Instantly share code, notes, and snippets.

@goo99x
goo99x / ResizeEnums.py
Created April 5, 2023 16:03
Ghidra script to recursively resize enums given a top-level data type to their minimal packed form.
# Recursively resize enums given a top-level data type to their minimal packed form.
#
# When enum types are imported into Ghidra, they are assumed to be 4-bytes in width.
# This script will adjust the size of the imported enums to their packed bitwidth,
# which is the smallest bitwidth that can accurately represent all possible enumerator values.
#
#@author goo99x
#@category Data Types
import math
@anvk
anvk / psql_useful_stat_queries.sql
Last active April 16, 2024 22:45
List of some useful Stat Queries for PSQL
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB.
------------
-- Basics --
------------
-- Get indexes of tables
@MawKKe
MawKKe / cryptsetup-with-luks2-and-integrity-demo.sh
Last active April 16, 2024 22:44
dm-crypt + dm-integrity + dm-raid = awesome!
#!/usr/bin/env bash
#
# Author: Markus (MawKKe) ekkwam@gmail.com
# Date: 2018-03-19
#
#
# What?
#
# Linux dm-crypt + dm-integrity + dm-raid (RAID1)
#
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active April 16, 2024 22:44
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@c22dev
c22dev / DEPSteps.md
Last active April 16, 2024 22:43
Remove MDM & DEP from an Apple Sillicon Mac (Sonoma)

How to make an MDM Mac shine like it's brand new ?

Works, as of 14/04/2024, on macOS 14.4.1 and lower (prob higher but idk)

This was made for Apple Sillicon Macs.

Restore Process

You need another Mac for this.

If you don't have one and have recovery locked, it's not possible.

@mvrpl
mvrpl / AnnotatedSentences.txt
Last active April 16, 2024 22:43
Trainamento e uso e modelo NER com OpenNLP
Nome: <START:nome> Marcos Lima <END> - Funcao: <START:funcao> Engenheiro Big Data <END> , Empresa: <START:empresa> Tokenizer <END>
Empresa: <START:empresa> Block 11 Solucoes <END> - Nome: <START:nome> Jose Vinicius <END> - Funcao: <START:funcao> Engenheiro Big Data <END>
Funcao: <START:funcao> Programador Front <END> Nome: <START:nome> Alberto Junior <END> Empresa: <START:empresa> E-Carmelo <END>
@gbaman
gbaman / HowToOTG.md
Last active April 16, 2024 22:39
Simple guide for setting up OTG modes on the Raspberry Pi Zero

Raspberry Pi Zero OTG Mode

Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).

The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int

@Razer6
Razer6 / modelsim_installation.md
Last active April 16, 2024 22:39 — forked from robodhruv/modelsim_installation.md
Installing ModelSim on Ubuntu

ModelSim Installation on Ubuntu

Installation requirements

The free version of Modelsim is a 32-bit binary and therefore requires certain 32-bit libraries in order to work correctly. For Ubunutu, install the following packages

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32ncurses6 libxft2 libxft2:i386 libxext6 libxext6:i386 
@LeeKahSeng
LeeKahSeng / KeychainHelper.swift
Last active April 16, 2024 22:37
Swift simple keychain helper class for iOS and macOs
// MIT License
//
// Copyright (c) 2023 Lee Kah Seng
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions: