Skip to content

Instantly share code, notes, and snippets.

View scriptzteam's full-sized avatar

[sCRiPTz-TEAM] scriptzteam

  • .::[S.p.\-A-/.c.E]::.
View GitHub Profile
@scriptzteam
scriptzteam / taproot.sh
Created May 4, 2021 16:41 — forked from mutatrum/taproot.sh
Print a taproot signalling block diagram
#!/bin/bash
BLOCKCHAININFO=$(bitcoin-cli getblockchaininfo)
TAPROOT=$(echo "$BLOCKCHAININFO" | jq .softforks.taproot.bip9)
SINCE=$(echo "$TAPROOT" | jq .since)
ELAPSED=$(echo "$TAPROOT" | jq .statistics.elapsed)
for BLOCK in $(seq "$SINCE" $((SINCE + ELAPSED - 1))); do
HASH=$(bitcoin-cli getblockhash "$BLOCK")
HEADER=$(bitcoin-cli getblockheader "$HASH")
VERSION=$(echo "$HEADER" | jq .version)
SIGNAL=$(((VERSION & 3758096388) == 536870916))
@scriptzteam
scriptzteam / cloudflare.sh
Created December 22, 2018 20:31 — forked from Manouchehri/cloudflare.sh
Allow CloudFlare only
# Source:
# https://www.cloudflare.com/ips
# https://support.cloudflare.com/hc/en-us/articles/200169166-How-do-I-whitelist-CloudFlare-s-IP-addresses-in-iptables-
for i in `curl https://www.cloudflare.com/ips-v4`; do iptables -I INPUT -p tcp -m multiport --dports http,https -s $i -j ACCEPT; done
for i in `curl https://www.cloudflare.com/ips-v6`; do ip6tables -I INPUT -p tcp -m multiport --dports http,https -s $i -j ACCEPT; done
# Avoid racking up billing/attacks
# WARNING: If you get attacked and CloudFlare drops you, your site(s) will be unreachable.
iptables -A INPUT -p tcp -m multiport --dports http,https -j DROP
@scriptzteam
scriptzteam / .rtorrent.rc
Created November 3, 2018 19:08 — forked from ItsAdventureTime/.rtorrent.rc
This an optimized version of the rTorrent configuration file.
#
#
# The Seedbox From Scratch Script
# By Notos ---> https://github.com/Notos/
#
#
######################################################################
#
# Copyright (c) 2013 Notos (https://github.com/Notos/)
#
@scriptzteam
scriptzteam / bitcoin_decode.php
Created May 24, 2018 16:16 — forked from JburkeRSAC/bitcoin_decode.php
decode bitcoin OP_RETURN
<?php
$transaction_id = $argv[1];
$url = "https://blockchain.info/tx/$transaction_id?show_adv=true&format=json";
$result = file_get_contents($url);
$resultJSON = json_decode($result, true);
function hex2str($hex) {
$str = '';
for($i=0;$i<strlen($hex);$i+=2) $str .= chr(hexdec(substr($hex,$i,2)));
return $str;
}
@scriptzteam
scriptzteam / bootstrap.sh
Created January 20, 2018 09:00 — forked from donaldsteele/bootstrap.sh
Install magneticod go-rewrite on a brand new scaleway ubuntu 16.04 instance
####
# Install magneticod go-rewrite on a brand new scaleway ubuntu 16.04 instance
####
apt-get update && apt-get -y upgrade
apt-get install -y software-properties-common python-software-properties git trickle
add-apt-repository ppa:gophers/archive
apt update
apt-get -y install golang-1.9-go
mkdir -p $HOME/go/src
cd $HOME/go/src
@scriptzteam
scriptzteam / pomf
Created September 20, 2017 18:23 — forked from KittyKatt/pomf
pomf.se BASH script to upload images
#!/usr/bin/env bash
# pomf.se uploader
# requires: curl
dest_url='http://pomf.se/upload.php'
return_url='http://a.pomf.se'
if [[ -n "${1}" ]]; then
file="${1}"
if [ -f "${file}" ]; then
@scriptzteam
scriptzteam / rclone_refresh.py
Created May 25, 2017 05:43 — forked from ryd994/rclone_refresh.py
Script to refresh ACD token with token from drivesink
#!/bin/env python
import json
import logging
import sys
import os
from six.moves import configparser
from datetime import datetime, timedelta
'''
Usage:
@scriptzteam
scriptzteam / node_crypto.js
Created January 21, 2017 17:15 — forked from rojan/node_crypto.js
Encrypt in nodejs and decrypt in php or vice versa
var crypto = require('crypto');
var key = 'MySecretKey12345';
var iv = '1234567890123456';
var cipher = crypto.createCipheriv('aes-128-cbc', key, iv);
var decipher = crypto.createDecipheriv('aes-128-cbc', key, iv);
var text = 'plain text';
var encrypted = cipher.update(text, 'utf8', 'binary');
encrypted += cipher.final('binary');
hexVal = new Buffer(encrypted, 'binary');
@scriptzteam
scriptzteam / nzbtunnel.sh
Created January 20, 2017 12:52 — forked from egrouse/nzbtunnel.sh
BASH script to tunnel NNTP connections
#!/bin/bash
# Script that attempts to create a tunnel for Usenet (NNTP) to pass through
# This script: creates a tunnel, assigns the host address to local address in /etc/hosts
# For Mac OS X
### CONFIGURATION ###
SERVER='your.nntp.server'
PORT='your.nntp.port'
LOCAL='127.0.0.1'
USER='root'
HOST='your.ssh.server'
#!/bin/bash
# get a country statistic for Fail2Ban blocks:
# this just accounts for IPs once. Multiple failed attempts by one IP just show up once for a country.
for i in `sudo cat /var/log/fail2ban.log | sed 's/.*[Bb]an \(.*\)/\1/' | sort | uniq | cut -d ' ' -f 1 | grep "\."`;
do
echo $i; whois $i | grep country\: |head -n 1 >> fail2ban_ctry.log ;
done
cat fail2ban_ctry.log | sed 's/country: //g' |sort | uniq -c | sort -nr