sudo service fail2ban restart
tail -f /var/log/fail2ban.log
#!/bin/bash | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" | |
exit 1 | |
fi | |
echo 'GRUB_DEFAULT=0' > /etc/default/grub | |
echo 'GRUB_TIMEOUT=5' >> /etc/default/grub | |
echo 'GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`' >> /etc/default/grub | |
echo 'GRUB_CMDLINE_LINUX_DEFAULT="quiet loglevel=3 vga=current rd.systemd.show_status=auto rd.udev.log-priority=3 vt.global_cursor_default=0"' >> /etc/default/grub | |
echo 'GRUB_CMDLINE_LINUX="console=ttyS0"' >> /etc/default/grub |
Download the latest ugw3
package from https://github.com/Lochnair/vyatta-wireguard/releases and install it on your USG using dpkg -i wireguard-ugw3-<version>.deb
.
cd /config/auth
umask 077
mkdir wireguard
cd wireguard
wg genkey > wg_private.key
wg pubkey < wg_private.key > wg_public.key
# Hardening as-per https://gist.github.com/plentz/6737338 | |
server_tokens off; | |
# Expires map | |
map $sent_http_content_type $expires { | |
default off; | |
text/html epoch; | |
text/css max; | |
application/javascript max; | |
~image/ max; |
function child_theme_dequeue_style() | |
{ | |
wp_dequeue_style('wpsisac_slick_style'); | |
wp_dequeue_style('wpos-slick-style'); | |
wp_dequeue_style('menu-icons-extra'); | |
wp_dequeue_style('woocommerce_frontend_styles'); | |
wp_dequeue_style('woocommerce-general'); | |
wp_dequeue_style('woocommerce-layout'); | |
wp_dequeue_style('woocommerce-smallscreen'); | |
wp_dequeue_style('woocommerce_fancybox_styles'); |
# Reference: https://www.youtube.com/watch?v=B9dXiKhDVl0 | |
## Remember to tailor this to your network! ## | |
set interfaces openvpn vtun0 config-file /config/auth/midwest.ovpn | |
set interfaces openvpn vtun0 description 'Private Internet Access' | |
set interfaces openvpn vtun0 enable | |
set service nat rule 5000 description PIA | |
set service nat rule 5000 log disable | |
set service nat rule 5000 outbound-interface vtun0 |
# List of cheatsheet for linux find. | |
# Taken from here http://alvinalexander.com/unix/edu/examples/find.shtml | |
# basic 'find file' commands | |
# -------------------------- | |
find / -name foo.txt -type f -print # full command | |
find / -name foo.txt -type f # -print isn't necessary | |
find / -name foo.txt # don't have to specify "type==file" | |
find . -name foo.txt # search under the current dir | |
find . -name "foo.*" # wildcard |
# http://askubuntu.com/questions/505446/how-to-install-ubuntu-14-04-with-raid-1-using-desktop-installer | |
# http://askubuntu.com/questions/660023/how-to-install-ubuntu-14-04-64-bit-with-a-dual-boot-raid-1-partition-on-an-uefi%5D | |
sudo -s | |
apt-get -y install mdadm | |
apt-get -y install grub-efi-amd64 | |
sgdisk -z /dev/sda | |
sgdisk -z /dev/sdb | |
sgdisk -n 1:0:+100M -t 1:ef00 -c 1:"EFI System" /dev/sda | |
sgdisk -n 2:0:+8G -t 2:fd00 -c 2:"Linux RAID" /dev/sda |
#!/usr/bin/env python | |
import i3 | |
outputs = i3.get_outputs() | |
workspaces = i3.get_workspaces() | |
# figure out what is on, and what is currently on your screen. | |
workspace = list(filter(lambda s: s['focused']==True, workspaces)) | |
output = list(filter(lambda s: s['active']==True, outputs)) |
#!/usr/bin/env python3 | |
# Get your files that Gmail block. Warning message: | |
# "Anti-virus warning - 1 attachment contains a virus or blocked file. Downloading this attachment is disabled." | |
# Based on: https://spapas.github.io/2014/10/23/retrieve-gmail-blocked-attachments/ | |
# Instructions: | |
# Go to your emails, click the arrow button in the top right, "Show original", then "Download Original". | |
# Move the files to the same directory as this program, then run it. | |
import sys |