Skip to content

Instantly share code, notes, and snippets.

View craSH's full-sized avatar

Ian Gallagher craSH

View GitHub Profile

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@smx-smx
smx-smx / XZ Backdoor Analysis
Last active May 4, 2024 10:03
[WIP] XZ Backdoor Analysis and symbol mapping
XZ Backdoor symbol deobfuscation. Updated as i make progress
/* usbreset -- send a USB port reset to a USB device
*
* Compile using: gcc -o usbreset usbreset.c
*
*
* */
@pascalpoitras
pascalpoitras / config.md
Last active April 28, 2024 23:12
My WeeChat configuration

WeeChat Screenshot

Mouse


enable


@gene1wood
gene1wood / all_aws_lambda_modules_python.md
Last active April 25, 2024 03:06
AWS Lambda function to list all available Python modules for Python 2.7 3.6 and 3.7
@ssmereka
ssmereka / plexDatabaseBackupScript.sh
Last active April 16, 2024 16:42
Plex Media Server database backup script.
#!/bin/bash
# Backup a Plex database.
# Author Scott Smereka
# Version 1.0
# Script Tested on:
# Ubuntu 12.04 on 2/2/2014 [ OK ]
# Plex Database Location. The trailing slash is
@jeffbrl
jeffbrl / describe_instances.py
Created February 27, 2018 17:28
How to make datetime.datetime json serializable - boto3 ec2 describe_instances
# Adapted from https://stackoverflow.com/questions/35869985/datetime-datetime-is-not-json-serializable
import datetime
import json
import boto3
def datetime_handler(x):
if isinstance(x, datetime.datetime):
return x.isoformat()
"""
This file contains code that, when run on Python 2.7.5 or earlier, creates
a string that should not exist: u'\Udeadbeef'. That's a single "character"
that's illegal in Python because it's outside the valid Unicode range.
It then uses it to crash various things in the Python standard library and
corrupt a database.
On Python 3... well, this file is full of syntax errors on Python 3. But
if you were to change the print statements and byte literals and stuff:
import tweepy
import os
import json
def get_api(cfg):
auth = tweepy.OAuthHandler(cfg['consumer_key'], cfg['consumer_secret'])
auth.set_access_token(cfg['access_token'], cfg['access_token_secret'])
return tweepy.API(auth)
def main():
# Fill in the values noted in previous step here
@craSH
craSH / hashpromptshort.sh
Created April 24, 2010 07:02
color your prompt based roughly (1/8*2 hashing) on hostname -f output. Also strip vowels from hostname to give a shorter prompt.
if [ "$PS1" ]; then
if [ "$BASH" ]; then
shortname=${HOSTNAME%%.*}
shortname=${shortname//[aeiou]/}
hostname_crc=$(echo $HOSTNAME | tr 'A-Z' 'a-z' | cksum)
hostname_crc=${hostname_crc%% *}
hostcolor_a=$(( (0x${hostname_crc} + 1) % 2 ))
hostcolor_b=$(( 0x${hostname_crc} % 8 + 30 ))
PS1="\[\e[33;1m\]\u@\[\e[${hostcolor_a};${hostcolor_b}m\]${shortname}:\[\e[0m\]\w"'\$ '
PS2='\[\e[31;1m\]>\[\e[0m\]'