Skip to content

Instantly share code, notes, and snippets.

View Bambarello's full-sized avatar

Alex Bambarello

View GitHub Profile
@Bambarello
Bambarello / http-get-dos.conf
Created October 20, 2018 21:25 — forked from zettacristiano/http-get-dos.conf
Fail2ban Configuration
# Fail2Ban configuration file
#
# NOTE
# You should set up in the jail.conf file, the maxretry and findtime carefully in order to avoid false positives.
#
# Author: http://www.go2linux.org
# Modified by: samnicholls.net
# * Mon 6 Jun 2016 - Updated failregex to capture HOST group correctly
[Definition]
@Bambarello
Bambarello / spend_tx.md
Created December 2, 2018 16:52
how to send spend tx from epoch, for the restless

Get your private key

To send a transaction from an account, you'd need to sign it beforehand. To sign it, you need the private key that corresponds to the account.

If you used bin/epoch keys_gen <password>, then you should have your private key in generated_keys/key and your public key (aka address) in generated_keys/key.pub. Let's read and decipher them.

erl shell detour

@Bambarello
Bambarello / ssh-attempts.txt
Last active December 30, 2018 16:08 — forked from gfoss/ssh-attempts.txt
grep IP addresses from auth logs to see attempted ssh attempts into your box w/ invalid creds {ubuntu}
#search for invalid logon attempts, pull out IP, remove dupes, sort...
$ grep -rhi 'invalid' /var/log/auth.log* | awk '{print $10}' | uniq | sort > ~/ips.txt
#look em up
$ for i in `cat ~/ips.txt`; do @nslookup $i 2>/dev/null | grep Name | tail -n 1 | cut -d " " -f 3; done > ~/who.txt
#search through system journal deamon all failed SSH attempts.
# journalctl _SYSTEMD_UNIT=ssh.service | egrep "Failed|Failure"
# journalctl _SYSTEMD_UNIT=sshd.service | egrep "Failed|Failure" #In RHEL, CentOS
#!/bin/bash
stegosout=$(echo "show balance" | /root/stegos/stegos --data-dir /data/stegos/data/)
stegosexit=$?
if [ $stegosexit -gt 0 ]; then
echo stegosout: "$stegosout"
exit $stegosexit
fi
if grep -q -i error <<< "$stegosout"; then
echo stegos returned error:
@Bambarello
Bambarello / noia-cli-debian.md
Created November 6, 2019 21:20 — forked from AGx10k/noia-cli-debian.md
noia cli debian
  1. выполняем эти команды:
curl -sL https://deb.nodesource.com/setup_10.x | bash -
apt-get install -y gcc g++ make git nodejs
export NOIA_WORKING_DIR="/root/noia-node-cli" && git clone https://github.com/noia-network/noia-node-cli.git ${NOIA_WORKING_DIR}
cd ${NOIA_WORKING_DIR}
npm install
npm audit fix
npm run build
@Bambarello
Bambarello / remote_bash.sh
Created February 1, 2020 20:05 — forked from n0ts/remote_bash.sh
execute bash script from remote site
# http://stackoverflow.com/questions/5735666/execute-bash-script-from-url
bash <(curl -s http://mywebsite.com/myscript.txt)
# http://stackoverflow.com/questions/4642915/passing-parameters-to-bash-when-executing-a-script-fetched-by-curl
curl http://foo.com/script.sh | bash -s arg1 arg2
####
# пути к ключам будут вида /solana/validator-keypair.json
# а на хосте они будут лежать в папке /root/solana_blabla. например /root/solana_agx10k
####
#######################################dockerfile####
echo "export SOLANA_NAME=<имя>" | tee -a ~/.bashrc ### например AG
source ~/.bashrc
echo "export SOLANA_DIR=/root/solana_${SOLANA_NAME}" | tee -a ~/.bashrc
#!/bin/bash
# Using:
# cosmos.sh PASS VALIDATOR DELEGATOR WALLET_NAME NETWORK_NAME COIN DENOMINATION
CLI="/root/go/bin/kvcli"
wallet_pass=$1
validator=$2
delegator=$3
wallet_name=$4
network=$5
coin=$6
@Bambarello
Bambarello / parity_on_hetzner.md
Last active November 2, 2022 16:27 — forked from suenot/parity_on_hetzner.md
parity on hetzner

Block reserved IPS:

# iptables -A OUTPUT -p tcp -s 0/0 -d 0.0.0.0/8 -j DROP
# iptables -A OUTPUT -p tcp -s 0/0 -d 10.0.0.0/8 -j DROP
iptables -A OUTPUT -p tcp -s 0/0 -d 100.64.0.0/10 -j DROP
iptables -A OUTPUT -p tcp -s 0/0 -d 169.254.0.0/16 -j DROP
# iptables -A OUTPUT -p tcp -s 0/0 -d 172.16.0.0/12 -j DROP
iptables -A OUTPUT -p tcp -s 0/0 -d 192.0.0.0/24 -j DROP
iptables -A OUTPUT -p tcp -s 0/0 -d 192.0.2.0/24 -j DROP
#!/bin/bash
set -e
vote_account="/root/solana/vote-account-keypair.json"
identity_account="/root/solana/validator-keypair.json"
new_stake="/root/solana/validator-stake-keypair-$(printf '%(%Y-%m-%d)T').json"
min_vote_balance=100
available_for_withdraw=$(solana balance $vote_account | awk -F\. '{print $1}')
re='^[0-9]+$'
if ! [[ $available_for_withdraw =~ $re ]] ; then