Skip to content

Instantly share code, notes, and snippets.

View Bambarello's full-sized avatar

Alex Bambarello

View GitHub Profile
#!/bin/bash
set -e
export PATH="/root/.local/share/solana/install/active_release/bin:$PATH"
TEXTFILE_COLLECTOR_DIR=/var/lib/prometheus/node-exporter
FILENAME=solana_active_stake.prom
metrics_prefix=solana_monit_mainnet
ALL=$(timeout 45 solana validators --output json | jq -r '.currentValidators[] |[.identityPubkey, .activatedStake/1000000000] | @csv' )
@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]
@zettacristiano
zettacristiano / http-get-dos.conf
Created March 11, 2018 15:33 — forked from petarnikolovski/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]
@Nihhaar
Nihhaar / linux_performance.md
Created September 18, 2017 18:42 — forked from marianposaceanu/linux_performance.md
Linux simple performance tweaks

Linux simple performance tweaks

Change the I/O Scheduler

Open $ vim /etc/default/grub then add elevator=noop next to GRUB_CMDLINE_LINUX_DEFAULT. Run $ update-grub and $ cat /sys/block/sda/queue/scheduler to be sure that noop is being used:

$ vim /etc/default/grub
$ update-grub
$ cat /sys/block/sda/queue/scheduler

[noop] deadline cfq

@gfoss
gfoss / ssh-attempts.txt
Last active December 30, 2018 11:02
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
# :-) #
$ do moar things...
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active November 19, 2024 10:49
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname