Skip to content

Instantly share code, notes, and snippets.

@thefkboss
thefkboss / magento-nginx.conf
Created July 1, 2019 06:23 — forked from gwillem/magento-nginx.conf
Battle-tested Nginx configuration for Magento (source: www.hypernode.com)
# This is an annotated subset of the Nginx configuration from our Magento production platform @ www.hypernode.com
# See https://www.byte.nl/blog/magento-cacheleak-issue
# !!!! If you are a Hypernode customer, do not use this config as it will result in duplicate statements. !!!!!
user app;
worker_processes 4;
pid /var/run/nginx.pid;
events {
@thefkboss
thefkboss / kill_trans_exp_audio.py
Created June 24, 2019 17:46 — forked from blacktwin/kill_trans_exp_audio.py
Kill Plex video transcoding streams only. All audio streams are left alone. Kill message based on platform.
"""
Kill Plex video transcoding streams only. All audio streams are left alone.
PlexPy > Settings > Notification Agents > Scripts > Bell icon:
[X] Notify on playback start
PlexPy > Settings > Notification Agents > Scripts > Gear icon:
Playback Start: kill_trans_exp_audio.py
"""
@thefkboss
thefkboss / createDatabaseAndUser
Created September 11, 2018 11:00 — forked from thejsj/createDatabaseAndUser
Bash script to automatically create MySQL databases where the database name and the username are the same. First argument: database name/username. Second argument: mysql_user password.
#!/bin/bash
params=" -uroot -p"
echo ' - - - - - - - '
echo 'DB Name : '$1
echo 'Password: '$2
# Create Database
echo ' - - - - - - - '
echo 'CREATE DATABASE IF NOT EXISTS $1;'
# Grant Options (Creates User Automatically)
echo ' - - - - - - - '
@thefkboss
thefkboss / wp-shell-install.sh
Created September 11, 2018 10:58 — forked from dongilbert/wp-shell-install.sh
Auto Install Latest WordPress from Shell
#!/bin/bash
# Install script for Latest WordPress by Johnathan Williamson - extended by Don Gilbert
# Disclaimer: It might not bloody work
# Disclaimer 2: I'm not responsible for any screwups ... :)
# DB Variables
echo "MySQL Host:"
read mysqlhost
export mysqlhost
@thefkboss
thefkboss / vm-backup.sh
Created May 2, 2018 17:37 — forked from cabal95/vm-backup.sh
I use this script to backup my QEMU/KVM/libVirt virtual machines. The script requires KVM 2.1+ since it uses the live blockcommit mode. This means the data in the snapshot disk is rolled back into the original instead of the other way around. Script does NOT handle spaces in paths.
#!/bin/bash
#
BACKUPDEST="$1"
DOMAIN="$2"
MAXBACKUPS="$3"
if [ -z "$BACKUPDEST" -o -z "$DOMAIN" ]; then
echo "Usage: ./vm-backup <backup-folder> <domain> [max-backups]"
exit 1
@thefkboss
thefkboss / jffs2.py
Created November 4, 2016 07:26 — forked from geekman/jffs2.py
JFFS2 scripts
#!/usr/bin/env python
#
# tool to parse JFFS2 images
# and more importantly, guess the erase block size
#
# 2015.10.19 darell tan
#
from struct import unpack
from argparse import ArgumentParser
frontend http-in-ext
bind 0.0.0.0:80
bind 0.0.0.0:443 ssl crt /SSL/yourcert.pem
option forwardfor
reqrep (.*)/seamedia/(.*) \1/seahub/seamedia/\2
acl path_seahub path_beg /seahub
acl path_seafile path_beg /seafhttp
#Force https
@thefkboss
thefkboss / iscsitarget.patch
Created September 4, 2016 21:38 — forked from Saneyan/iscsitarget.patch
A patch file for iscsitarget for Linux (checked only version 4.0.1)
diff -ur iscsitarget/kernel/conn.c iscsitarget.patched/kernel/conn.c
--- iscsitarget/kernel/conn.c 2015-05-05 18:11:24.000000000 +0000
+++ iscsitarget.patched/kernel/conn.c 2015-05-05 18:01:40.000000000 +0000
@@ -127,7 +127,7 @@
dprintk(D_GENERIC, "%llu\n", (unsigned long long) session->sid);
- conn->sock = SOCKET_I(conn->file->f_dentry->d_inode);
+ conn->sock = SOCKET_I(conn->file->f_path.dentry->d_inode);
conn->sock->sk->sk_user_data = conn;
@thefkboss
thefkboss / nginx.conf
Created May 24, 2016 07:07 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@thefkboss
thefkboss / analyseBreakinAttempts.sh
Last active August 29, 2015 14:26 — forked from pklaus/analyseBreakinAttempts.sh
A script that analyses the log files /var/log/auth.log* for illegal break-in attempts and writes all output to $logdir – Check http://blog.philippklaus.de/2010/02/analyse-illegal-ssh-login-attempts/
#!/bin/bash
# This script analyses the log files /var/log/auth.log* for
# illegal break-in attempts and writes all output to $logdir.
# <http://blog.philippklaus.de/2010/02/analyse-illegal-ssh-login-attempts/#comment-12211>
# inspired by <http://goo.gl/QMOhiU>
# and <http://filipivianna.blogspot.com/2009/10/checking-authlog-for-ssh-brute-force.html>
logbasedir=~/logs