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
When
[Case
(Deposit
(PK "be")
(Role "player1")
(Token "" "")
(Constant 15)
)
(When
[Case
@llazzaro
llazzaro / recover.py
Created July 16, 2021 20:25
Recover bitcoin from seeds
import sys
import tempfile
from pybloom_live import ScalableBloomFilter
try:
from electrum import SimpleConfig
from electrum.keystore import from_seed
from electrum.tests.test_wallet_vertical import WalletIntegrityHelper
from electrum.util import BitcoinException
# This is a step by step tutorial on how to run uwsgi in emperor mode,
# behind nginx on Fedora 20. I'll add to the tutorial as time goes on.
# SeLinux will likely be a pain (even in permissive mode), so please see my comment on how to fix it.
sudo yum upgrade
sudo yum install nano yum-utils gcc uwsgi-plugin-python3 nginx
yum-builddep python3-psycopg2
@llazzaro
llazzaro / bash_dispatcher.ini
Created January 21, 2020 03:15
Bash dispatcher.ini example
[server]
host = 127.0.0.1
api_port = 5985
websocket_port = 9000
workspace = agent
[tokens]
registration = TOKEN
[agent]
@llazzaro
llazzaro / echo.sh
Last active January 21, 2020 03:10
Example agent script code
printf '{"hosts":[{"ip":"127.0.0.1","description":"host description","vulnerabilities":[],"credentials":[],"services":[{"name":"http","protocol":"tcp","port":80,"vulnerabilities":[{"name":"vuln test from agent","severity":"high","desc":"vuln desc","type":"Vulnerability"}]}]}]}}'
@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
@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 / fabric_backup_mysql.py
Created June 25, 2014 12:42
Fabric script for mysql backup
import time
def vps():
env.hosts = ['apps.myvps.com']
env.user = 'app'
env.dbname = 'blog'
env.dbuser = 'blogger'
env.dbpass = 'password'
def backup():
@llazzaro
llazzaro / check_file.py
Created April 11, 2017 21:16
How to check that a file or directory exists with Python?
# example taken from https://tutorials.technology/tutorials/08-How-to-check-that-file-exists-with-Python.html
from pathlib import Path
def file_or_directory(pathname):
file_or_directory = Path(pathname)
if file_or_directroty.exists():
if file_or_directory.is_file():
print('Filename {0} is a file!'.format(pathname)
else:
print('Filename {0} is a directory!'.format(pathname)
@llazzaro
llazzaro / redis_cheatsheet.bash
Created July 16, 2017 23:31 — forked from Yogendra0Sharma/redis_cheatsheet.bash
Redis Cheatsheet - Basic Commands You Must Know
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.