Skip to content

Instantly share code, notes, and snippets.

View RC1140's full-sized avatar
🎿
NOP Sledding

Jameel RC1140

🎿
NOP Sledding
View GitHub Profile
@jpetitcolas
jpetitcolas / parsing-binary-file.go
Last active July 27, 2020 12:40
How to parse a binary file in Go? Snippet based on MoPaQ SC2 replay parsing. Related blog post: http://www.jonathan-petitcolas.com/2014/09/25/parsing-binary-files-in-go.html
package main
import (
"bytes"
"encoding/binary"
"fmt"
"log"
"os"
)
@Rurik
Rurik / asm_find_math.py
Last active September 16, 2023 17:17
Detect subroutines that may have encryption/encoding routines by finding XOR and shift routines.
# Automatically find XOR/SHL/SHR routines from an executable
# Uses IDAW (text IDA)
# @bbaskin - brian @ thebaskins.com
# While other, more powerful scripts like FindCrypt find known
# algorithms this is used to find custom encoding or modified
# encryption routines
"""
Script results:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
@aktau
aktau / sclg4.c
Last active July 30, 2021 02:29
A simple WinAPI GetAsyncKeyState()-based keylogger, written a very long time ago. I dug it out of the archives because of a Hacker News post (https://news.ycombinator.com/item?id=7607082). For educational purposes only, of course.
/**
* Copyright (c) 2006, Nicolas Hillegeer
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@mickaelandrieu
mickaelandrieu / webservice.js
Created October 11, 2013 20:45
Use casperJs as a Webservice
/* from http://stackoverflow.com/questions/15852987/casperjs-passing-data-back-to-php/16489950#16489950
//define ip and port to web service
var ip_server = '127.0.0.1:8585';
//includes web server modules
var server = require('webserver').create();
//start web server
var service = server.listen(ip_server, function(request, response) {
obj-m += rootkit.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
@nblumoe
nblumoe / vim_fireplace_paredit_cheat_sheet.md
Created April 24, 2013 06:41
Simple cheat sheet for vim fireplace and paredit

fireplace

  • cpr => (require ... :reload)
  • cpR => (require ... :reload-all)

Evaluation

  • :Eval (clojure code) => runs (clojure code) in repl
  • cpp => evaluate inn-most expessions under cursor
  • cp<movement> => evaluate text described by <movement>
  • cqp => opens quasi-repl
  • cqc => quasi-repl command line window
@xsyn
xsyn / gist:4193705
Created December 3, 2012 08:47
add-my-key.sh
#!/bin/bash
if [ $# -lt 1 ]
then
echo "Usage: ${0##*/} user@host"
echo " Adds your id_rsa.pub to the desitnation authorized_keys2 file"
exit 1
fi
if [ ! -f ~/.ssh/id_rsa.pub ]
@adharris
adharris / postgres_array.go
Created November 28, 2012 19:52
PostgreSQL demo of Array types using Golang
package main
import (
"database/sql"
"errors"
"fmt"
_ "github.com/bmizerany/pq"
"os"
"regexp"
"strings"
@pivaldi
pivaldi / .psqlrc
Created November 11, 2012 10:28
.psqlrc dot file to customize the default psql sessions
-- psql prompt can be customized
\set PROMPT1 '%[%033[1;33m%]%M:%>%[%033[1;32m%] %n@%/%R%[%033[0m%]%# '
\set PROMPT2 :PROMPT1
\set PROMPT3 '>> '
-- Missing LIMIT fetch count is set to 1000
\set FETCH_COUNT 1000
-- Set pager to off
\pset pager off