Skip to content

Instantly share code, notes, and snippets.

@adrienne
adrienne / mullenweg-wpe.md
Last active January 15, 2025 03:36
The Mullenweg/WPE Thing
@nstarke
nstarke / 01-reversing-cisco-ios-raw-binary-firmware-images-with-ghidra.md
Last active January 15, 2025 03:35
Reversing Cisco IOS Raw Binary Firmware Images with Ghidra

Reversing Raw Binary Firmware Files in Ghidra

This brief tutorial will show you how to go about analyzing a raw binary firmware image in Ghidra.

Prep work in Binwalk

I was recently interested in reversing some older Cisco IOS images. Those images come in the form of a single binary blob, without any sort of ELF, Mach-o, or PE header to describe the binary.

While I am using Cisco IOS Images in this example, the same process should apply to other Raw Binary Firmware Images.

@johndpope
johndpope / install.sh
Created October 14, 2021 04:49 — forked from aaabramov/install.sh
Installing zsh + oh-my-zsh on Amazon EC2 Amazon Linux 2 AMI
sudo yum update
# Installing ZSH
sudo yum -y install zsh
# Check ZSH has been installed
zsh --version
# Install "util-linux-user" because "chsh" is not available by default
# See https://superuser.com/a/1389273/599050
@wojteklu
wojteklu / clean_code.md
Last active January 15, 2025 03:30
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@ruvnet
ruvnet / MoE.py
Last active January 15, 2025 03:29
A PyTorch implementation of a Mixture of Experts (MoE) model resembling the Mixtral 8x7B architecture, with detailed inline comments. This model combines transformer layers with an MoE layer consisting of 8 experts, aiming for high efficiency by activating only 2 experts per token. It's configured with dimensions reflecting the operational effic…
"""
This model integrates the MoE concept within a Transformer architecture. Each token's
representation is processed by a subset of experts, determined by the gating mechanism.
This architecture allows for efficient and specialized handling of different aspects of the
data, aiming for the adaptability and efficiency noted in the Mixtral 8x7B model's design
philosophy. The model activates only a fraction of the available experts for each token,
significantly reducing the computational resources needed compared to activating all experts
for all tokens.
"""
@capfsb
capfsb / fpsMeter.js
Created April 17, 2017 23:41 — forked from medynski/fpsMeter.js
JavaScript FPS meter - Calculating frames per second
fpsMeter() {
let prevTime = Date.now(),
frames = 0;
requestAnimationFrame(function loop() {
const time = Date.now();
frames++;
if (time > prevTime + 1000) {
let fps = Math.round( ( frames * 1000 ) / ( time - prevTime ) );
prevTime = time;
@0xdevalias
0xdevalias / reverse-engineering-macos.md
Last active January 15, 2025 03:22
Some notes, tools, and techniques for reverse engineering macOS binaries
@hansheng0512
hansheng0512 / crypto.ts
Created September 20, 2024 03:14
Encrypt and Decrypt string using Typescript
import * as crypto from 'crypto';
// Secret key generation (should be stored securely and not hardcoded)
const secretKey = crypto.createHash('sha256').update(String('your-secret-key')).digest('base64').substr(0, 32);
function encrypt(text: string): string {
const iv = crypto.randomBytes(16); // Initialization vector
const cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(secretKey), iv);
const encrypted = Buffer.concat([cipher.update(text, 'utf8'), cipher.final()]);
// Return the IV and encrypted data as a combined string
@0xdevalias
0xdevalias / reverse-engineering-webpack-apps.md
Last active January 15, 2025 03:22
Some notes and techniques for reverse engineering Webpack (and a little bit about React/Vue/Angular) apps