Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Aaron Lichtman alichtman

🎯
Focusing
Block or report user

Report or block alichtman

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View pgp-public-key-0BF8C33B7606AA25154729F922368077DE9F9903.asc
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFpVkIoBEADWK+eqWDoK6zCyjQQrYrFqCxQgiccC6RKYkxabTWuD8MZOFYT7
qCyCZ6OHjUQb2FkXMr4WUc0n6nVrmGgu0jc4sGvR4kM06tTszg2lss8IIvHPeJu9
V8e+Xh+7EX0d9X/wqYArMMygSxgMVFiT61E2JFS07yHHP2DgNrPX91kdjSEcjr+A
PnLiuVMx6hHIFXtu3FgpOP8Plfme9WisPqE3YhUm/p3tPNBMqW5lBxPYCKk1t+r5
EWVNtEprDx7yCYFYr5HALHgT/1NiBOHZ8nlTlnfW4Qgs/q4z86Di0rbK/6a2gfIQ
FxCSw81m6iTiYLs6Kfx271MbBXNxft4rhE3kV2JTgZsQ162SaxhnKqyQClQZ25Hy
PohJ9NwCWgtnWxiK+yGwcxV+MYpkDZVQDfNjyoi7SOuXH5ypwflsruF4NK4zcyH/
yPq8P34zPMb/hydU3jGWOqIhrpZkAoLI9dj2omN8qwNZ1w8y0Ry3EzUNaSll8UBN
View repro-empty-encrypted-file-bug.js
/**
* BUG: When encrypting certain types of files, an empty (0B) file is created.
* I can reproduce it with PDFs and JPGs, however, this works with text
* files and some executables, so it's not a "plaintext-only" issue.
**/
const fs = require("fs");
const crypto = require("crypto");
/**
View LING490-LS3-grade-calc.py
# LING490-LS3 Grade Calculator
# Written by: Aaron Lichtman
# Adjustment for dropped homework. Replace the weight you choose to drop with 0.
adj = REMOVED_WEIGHT_HERE / 6
weight = {
"ch03" : .03 + adj,
"hw01" : .08 + adj,
"hw02" : .10 + adj,
@alichtman
alichtman / Sample Stage 2
Last active Apr 25, 2019
Sample Stage 2
View Sample Stage 2
This is a sample second stage of an infection. This is part of https://github.com/alichtman/malware-techniques
As the great philosopher Drake once said: "If you're reading this, it's too late."
View logging.c
#define DEBUG 1
#if DEBUG == 1
#define LOG(...) fprintf(stderr, "\x1b[35m[%s:%d] \x1b[32m%s()\x1b[0m: ", __FILE__, __LINE__, __func__); fprintf(stderr, __VA_ARGS__)
#else
#define LOG(...)
#endif
int main(){
int some_param = 2;
@alichtman
alichtman / python-zip-unpack-in-js
Last active Oct 9, 2018
Javascript implementation of Python zip and unpack
View python-zip-unpack-in-js
/**
* Takes three arrays and zips them into a list of lists like this:
*
* [1,2,3]
* [a,b,c] -> [ [1,a,!], [2,b,@], [3,c,#] ]
* [!,@,#]
*/
function zipThreeArrays(a, b, c) {
let zipped = [];
for (var i = 0; i < a.length; i++) {
View Cool Terminal Commands
# Display top 10 terminal commands
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a; }' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10
View getUnpostedLogsFromLogFile.kt
/**
* Scrapes idea.log file for all Activity Logs generated by this plugin.
* Return a list of all activitySessionLogs that haven't been posted to the server yet.
*/
fun getUnpostedLogsFromLogFile(logFile: Path, lastDateScraped: Date): ArrayList<String> {
val logList = String(Files.readAllBytes(logFile)).split("\n")
// Reverse logList
var logListReversed = logList.subList(0, logList.size)
Collections.reverse(logListReversed)
@alichtman
alichtman / refined-github-disabled-features
Created May 7, 2018
Features disabled for sindresorhus/refined-github
View refined-github-disabled-features
https://github.com/sindresorhus/refined-github
more-dropdown hide-useless-newsfeed-events add-releases-tab hide-own-stars
You can’t perform that action at this time.