Skip to content

Instantly share code, notes, and snippets.

View Nill-R's full-sized avatar

Nill Ringil Nill-R

View GitHub Profile
@Nill-R
Nill-R / .tmux.conf
Last active June 2, 2023 15:54
minimal ~/.tmux.conf
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'
set-option -g default-shell /bin/zsh
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'jimeh/tmux-themepack'
set -g @themepack 'powerline/double/blue'
@Nill-R
Nill-R / yggdrasil
Last active February 5, 2020 06:10
Logrotate for yggdrasil
/var/log/yggdrasil.log {
daily
missingok
rotate 2
compress
olddir /var/log/old
dateext
dateformat -%Y-%m-%d.log
notifempty
create 640 syslog adm
@Nill-R
Nill-R / 20-yggdrasil.conf
Created December 30, 2019 06:04
Yggdrasil rsyslog conf
if $programname == 'yggdrasil' then /var/log/yggdrasil.log
& stop
@Nill-R
Nill-R / torrc
Created November 30, 2019 18:50
Minimal /etc/tor/torrc
SOCKSPort 9050
ExcludeNodes {ru}
ExcludeExitNodes {ru},{kz},{by},{cn},{kg},{tj},{uz},{ir}
Log notice file /var/log/tor/notices.log
#!/bin/bash
gpg --fetch-keys https://neilalexander.s3.dualstack.eu-west-2.amazonaws.com/deb/key.txt
gpg --export 569130E8CA20FBC4CB3FDE555898470A764B32C9 | apt-key add -
echo 'deb http://neilalexander.s3.dualstack.eu-west-2.amazonaws.com/deb/ debian yggdrasil' | tee /etc/apt/sources.list.d/yggdrasil.list
apt-get update
apt-get -y install yggdrasil
wget https://gist.github.com/Nill-R/e09566aa33c841fe73aeac373f734f05/raw/bed12fcde5901bd2f3320ab6e936ff6eeaae2421/20-yggdrasil.conf -O /etc/rsyslog.d/20-yggdrasil.conf ; systemctl restart rsyslog
wget https://gist.github.com/Nill-R/cb84b232a0baf6550d4733849c76175d/raw/a150a6333ff122a12c5e311d83a115d86177d728/yggdrasil -O /etc/logrotate.d/yggdrasil
#!/usr/bin/env bash
#
# Program: SSL Certificate Check <ssl-cert-check>
#
# Source code home: https://github.com/Matty9191/ssl-cert-check
#
# Documentation: http://prefetch.net/articles/checkcertificate.html
#
# Author: Matty < matty91 at gmail dot com >
# Edited by Nill Rinov for Telegram
@Nill-R
Nill-R / xmlrpc.conf
Created June 20, 2019 22:02
Allow WP xmlrpc.php to Jetpack and deny for all(nginx)
location = /xmlrpc.php {
allow 122.248.245.244;
allow 54.217.201.243;
allow 54.232.116.4;
allow 192.0.80.0/20;
allow 192.0.96.0/20;
allow 192.0.112.0/20;
allow 195.234.108.0/22;
deny all;
access_log off;
@Nill-R
Nill-R / badips-ipset.sh
Created May 1, 2019 02:46 — forked from JadedDragoon/badips-ipset.sh
A script to create and update an ipset with ip addresses retrieved from the badips.com blacklist. (With just a little effort should work with url to any source of IPs separated by newlines)
#!/bin/bash
# Script for blocking IPs which have been reported to www.badips.com
# via ipsets.
#
# - THIS SCRIPT DOES NOT BLOCK ANYTHING -
# This script only updates ipsets with applicable data from
# badips.com. Actually blocking the ips in that ipset is left
# up to the user (so that you may do so however you prefer).
#
# Additionally, this script does not persist the ipsets through
@Nill-R
Nill-R / run_it_first.bash
Last active April 18, 2021 14:17
Server initial setup
#!/usr/bin/env bash
apt update
apt -y install gdebi
cd $(mktemp -d backup.XXXXXXX)
TEMP_DIR=`pwd`
wget http://www.tataranovich.com/debian/pool/sid/main/t/tataranovich-keyring/tataranovich-keyring_2020.06.12_all.deb
gdebi --n tataranovich-keyring_2020.06.12_all.deb
printf "deb http://www.tataranovich.com/ubuntu bionic main\n" >/etc/apt/sources.list.d/mc.list
apt update
@Nill-R
Nill-R / create_db_and_user.bash
Created February 22, 2019 04:37
Script for create db and user with all privs to it
#!/bin/bash
EXPECTED_ARGS=2
E_BADARGS=65
MYSQL=`which mysql`
PASS=`tr -cd '[:alnum:]' < /dev/urandom | fold -w24 | head -n1`
echo $PASS
Q1="CREATE DATABASE IF NOT EXISTS $1;"
Q2="GRANT USAGE ON *.* TO $2@localhost IDENTIFIED BY '$PASS';"