Skip to content

Instantly share code, notes, and snippets.

View llazzaro's full-sized avatar
👨‍🚒
Fighting fire with fire 🔥

Leonardo Lazzaro llazzaro

👨‍🚒
Fighting fire with fire 🔥
View GitHub Profile
@llazzaro
llazzaro / install_ruby_rpi.sh
Last active September 8, 2015 04:13 — forked from blacktm/install_ruby_rpi.sh
A Bash script to install Ruby 2.2 on the Raspberry Pi (Raspbian).
#!/bin/bash
# -----------------------------------------------------------------------
# Installs Ruby 2.2 using rbenv/ruby-build on the Raspberry Pi (Raspbian)
#
# Run from the web:
# bash <(curl -s raw_script_url_here)
# -----------------------------------------------------------------------
# Set up variables
@llazzaro
llazzaro / 0-openwrt-auto-mount-readme.md
Last active January 9, 2018 09:32 — forked from lanceliao/0-openwrt-auto-mount-readme.md
Auto mount USB storage device by uuid on OpenWrt
  1. Install USB device support;
opkg install kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-storage e2fsprogs fdisk usbutils mount-utils block-mount kmod-fs-ext4 kmod-fs-vfat kmod-nls-utf-8 kmod-nls-cp437 kmod-nls-iso8859-1

reboot
  1. Install blkid, run opkg update && opkg install blkid;
  2. Copy block.sh to directory /lib/functions;
  3. Copy 10-mount and 20-swap to directory /etc/hotplug.d/block;
  4. That's it! run logread -f command then plug in a USB stick to test.
@llazzaro
llazzaro / tor.py
Last active August 29, 2015 14:20 — forked from jefftriplett/tor.py
"""
setup:
pip install requesocks
super helpful:
http://packetforger.wordpress.com/2013/08/27/pythons-requests-module-with-socks-support-requesocks/
"""
import requests
import requesocks
  1. General Background and Overview
@llazzaro
llazzaro / hb-test.py
Last active August 29, 2015 14:14 — forked from takeshixx/hb-test.py
#!/usr/bin/env python2
"""
Author: takeshix <takeshix@adversec.com>
PoC code for CVE-2014-0160. Original PoC by Jared Stafford (jspenguin@jspenguin.org).
Supportes all versions of TLS and has STARTTLS support for SMTP,POP3,IMAP,FTP and XMPP.
"""
import sys,struct,socket
from argparse import ArgumentParser
#!/bin/bash
# www.fduran.com
# script that will send an email to EMAIL when disk use in partition PART is bigger than %MAX
# adapt these 3 parameters to your case
MAX=95
EMAIL=alert@example.com
PART=sda1
USE=`df -h |grep $PART | awk '{ print $5 }' | cut -d'%' -f1`
if [ $USE -gt $MAX ]; then
@llazzaro
llazzaro / mywallet.py
Last active August 29, 2015 14:08 — forked from fcicq/mywallet.py
#!/usr/bin/env python
import base64, hashlib, hmac, json, sys, getpass
from Crypto.Cipher import AES
from Crypto.Hash import RIPEMD, SHA256
base58_chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
def prompt(p):
return getpass.getpass(p + ": ")
@llazzaro
llazzaro / setup_logging.py
Created October 6, 2014 01:16
python logger initialize code
import logging
def init_logging():
logger = logging.getLogger('logger_name')
logger.setLevel(logging.INFO)
# create file handler which logs even debug messages
fh = logging.FileHandler('logger_name.log')
fh.setLevel(logging.INFO)
# create console handler with a higher log level
ch = logging.StreamHandler()
/*
gulpfile from one of my React applications which has a gulp --production build
set up.
Assumptions:
1. All your own .js/.jsx modules are somewhere under ./src, have unique
filenames and use Node.js-style requires WITHOUT any path information, just
the name of another module somewhere under ./src
@llazzaro
llazzaro / build_cgminer_openwrt.sh
Created August 14, 2014 00:35
Script for cross-compile cgminer for OpenWRT
#!/bin/bash
A_OPENWRT_DIR=/home/pepe/openwrt_buildroot/openwrt
A_TARGET=mips_34kc
# export STAGING_DIR="${A_OPENWRT_DIR}/staging_dir"
export TOOLCHAIN_PATH=${A_OPENWRT_DIR}/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2
export PATH=$PATH:$TOOLCHAIN_PATH/bin/:${A_OPENWRT_DIR}/staging_dir/host/bin
export AR=$TOOLCHAIN_PATH/bin/mips-openwrt-linux-uclibc-ar
export AS=$TOOLCHAIN_PATH/bin/mips-openwrt-linux-uclibc-as