Skip to content

Instantly share code, notes, and snippets.

@eegrok
eegrok / postfix-modify-header
Created May 13, 2011 22:54
Modify the to: header in postfix
# so recently I had an issue where I wanted to send email sent to a local user root (from logwatch, e.g.) to a different email address
# simple enough -- just add a ~root/.forward file, with the contents root-handler-testing@gmail.com
# all the email gets sent there...
# but the email shows up with a to: header of root@my-example-machine.com
# what I really want is the to: header to be root-handler-testing@gmail.com
# so I can filter emails, etc... below is how to do that.
#uncomment the following line in /etc/postfix/main.cf
#header_checks = regexp:/etc/postfix/header_checks
@KartikTalwar
KartikTalwar / Documentation.md
Last active June 13, 2024 07:02
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@mkayala
mkayala / ConvertToMP4_KindleFire.sh
Created February 3, 2013 21:49
Script to convert video to mp4 in a way that is playable on the Kindle Fire. Prereqs: Compile the latest ffmpeg and x264 encoder. On Ubuntu, this worked well: https://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide
#!/bin/bash
## Convert input files $name.* into $name.mp4, suitable for playing
## in Kindle Fire.
usage="$0 file1 [file2 ...]"
if [ -z "$1" ]
then
echo $usage
@JonMcL
JonMcL / sshd-obvious.conf
Last active March 1, 2016 19:44
sshd-obvious configuration for fail2ban Allows for a maxretry=1 for obvious hack attempts while leaving maxretry=3 available for possible mistakes.
# Fail2Ban configuration file
#
# Author: Cyril Jaquier
#
# $Revision$
#
[INCLUDES]
# Read common prefixes. If any customizations available -- read them from
@mckelvey
mckelvey / apache-livewhale.conf
Last active June 7, 2019 09:19
This is a fail2ban filter to protect against malicious use of an injection/vulnerability scanner (that might also be slamming your server with useless requests).
# Fail2Ban configuration file
#
# Intended to assist in protecting LiveWhale from malicious use
# of injection and vulnerabilty scanners such as:
#
# Acunetix Web Vulnerabilty Scanner
# Unknown Scanner (dubbed KIDC below)
# Unknown Scanner (dubbed RIPE below)
#
# Note: if you use penetration software for testing, add the server ip
@szepeviktor
szepeviktor / allow-iptables-multiport.conf
Last active August 29, 2015 13:57
pass2allow - fail2ban filter and action to allow hosts to connect
# Fail2Ban configuration file for allowing hosts
#
#
[INCLUDES]
before = iptables-blocktype.conf
[Definition]
@cam8001
cam8001 / go_lean.sh
Last active January 10, 2022 04:50
Disable all the stuff we don't need on a MyBookLive.
#!/bin/bash
# See http://mybookworld.wikidot.com/forum/t-583096
# See http://tech.roxee.tv/2012/06/12/solving-the-my-book-live-insane-load/
# http://community.wd.com/t5/My-Book-Live-Duo/New-MyBook-Duo-4Tb-astonishingly-slow-I-mean-really-soul/td-p/417642/page/5
# Disable all this stuff, but also make miocrawler drops its logs.
# vi /etc/rsyslog.d/miocrawler.conf
# [root@storagecasa rsyslog.d]# cat miocrawler.conf
@djdefi
djdefi / apache-antibot.conf
Created June 13, 2014 22:35
Amazon AMI - Wordpress fail2ban anti-bot
# Fail2Ban Configuration File
#
# filter.d/apache-antibot.conf
#
#
# match stuff like this from *access.log from a dummy NameVirtualHost or a normal NameVirtualHost
# the dummy host always returns 403 via rewrite rule
#
# match all 404s or 403s where url contains special "badurl" parts
#
@bbengfort
bbengfort / venv_cheat_sheet.md
Created August 20, 2014 14:16
My virtualenv and virtualenv wrapper cheat sheet. I alias the commands of virtualenv and virtualenv wrapper for my own development environment.

Ben's VirtualEnv Cheatsheet

This cheat sheet describes my usage/implementation of virtualenv with virtualenv wrapper and the bash foo that I added with the help of many blogs to make it all tick together in fun land.

Quick Reference

$ echo $WORKON_HOME
/Users/benjamin/.virtualenvs

$ echo $PROJECT_HOME
@dvas0004
dvas0004 / searchsploit-update.sh
Created October 19, 2014 09:41
Kali Linux Searchsploit updater
echo "Updating SearchSploit... (Kali Linux)"
# move into the exploit db directory within Kali
cd /usr/share/exploitdb
echo "Downloading latest archive..."
wget http://www.exploit-db.com/archive.tar.bz2
echo "Downloaded archive, proceeding to extract..."
tar -xjvf archive.tar.bz2