Skip to content

Instantly share code, notes, and snippets.

View VirtuBox's full-sized avatar
🏠
Working from home

VirtuBox VirtuBox

🏠
Working from home
View GitHub Profile
@VirtuBox
VirtuBox / .htaccess
Created January 8, 2020 17:16 — forked from seoagentur-hamburg/.htaccess
UPDATE 2019/07: Perfect .htaccess file for highspeed and security. You can use it for every WordPress-Website without problems. Highspeed and Security - testet on hundreds of Websites. If you are using a WordPress Multisite, change the last part of this file.
########################################################################
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2019
# ----------------------------------------------------------------------
# @Author: Andreas Hecht
# @Author URI: https://andreas-hecht.com
# License: GNU General Public License v2 or later
# License URI: http://www.gnu.org/licenses/gpl-2.0.html
########################################################################
@VirtuBox
VirtuBox / wordpress-hack.md
Created November 6, 2019 14:45 — forked from andersevenrud/wordpress-hack.md
wordpress-hack.md

Wordpress is a very popular target for hackers. They normally get in with holes found in plugins, themes or in wordpress core.

Prevention methods

An up-to-date installation (including plugins and themes) is crutial!

Hardening Wordpress is sadly not a part of the standard installation documentation, but they have a guide available in the "codex": http://codex.wordpress.org/Hardening_WordPress

Removing unused plugins and users, setting htpasswd and/or ip-whitelisting in //wp-admin// also should be considered.

@VirtuBox
VirtuBox / pihole.list
Created September 25, 2019 00:22
Pi-hole blocking lists
##StevenBlack's list
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
##MalwareDomains
https://mirror1.malwaredomains.com/files/justdomains
##Cameleon
http://sysctl.org/cameleon/hosts
##Zeustracker
@VirtuBox
VirtuBox / github-rocket-chat-webhook-script.js
Last active September 21, 2019 00:33
Github releases integration with rocket.chat (issue, commit, push, pull request, comment, release)
/* exported Script */
String.prototype.capitalizeFirstLetter = function() {
return this.charAt(0).toUpperCase() + this.slice(1);
}
const getLabelsField = (labels) => {
let labelsArray = [];
labels.forEach(function(label) {
labelsArray.push(label.name);
@VirtuBox
VirtuBox / mediapad.sh
Created September 18, 2019 11:41
Huawei mediapad M5 bloatware cleanup script using adb
#!/system/bin/sh
# ---------------------mediapad.sh---------------------------------------------------------------
# usage :
# adb push mediapad.sh /storage/emulated/0/
# adb shell sh /storage/emulated/0/mediapad.sh
# -----------------------------------------------------------------------------------------------
# list current packages :
# adb shell
# pm list packages -f | cut -c 9- | awk -F "=" '// {printf("%s\t\t\t\t%s\n", $2, $1);}' | sort
#
@VirtuBox
VirtuBox / acme.sh
Created September 18, 2019 00:21
acme.sh setup for WordOps
#!/usr/bin/env bash
wo_install_acme_sh() {
# check if acme.sh is already installed
if [ ! -x /etc/letsencrypt/acme.sh ]; then
# clone the git repository
if [ -d /opt/acme.sh/.git ]; then
git -C /opt/acme.sh pull origin master
else
@VirtuBox
VirtuBox / ufw.sh
Last active August 15, 2019 13:03
WordOps Firewall config
#!/usr/bin/env bash
# get current ssh port
CURRENT_SSH_PORT=$(grep "Port" /etc/ssh/sshd_config | awk -F " " '{print $2}')
# define firewall rules
ufw logging low
ufw default allow outgoing
ufw default deny incoming
@VirtuBox
VirtuBox / wp-config.php
Created August 5, 2019 02:35
set wordpress siteurl/home variable depending on HTTP_HOST
# source : https://github.com/pantheon-systems/WordPress/blob/default/wp-config.php
# license : GPL
# b2 is (c) 2001, 2002 Michel Valdrighi - [email protected] -
if (isset($_SERVER['HTTP_HOST'])) {
// HTTP is still the default scheme for now.
$scheme = 'http';
// If we have detected that the end use is HTTPS, make sure we pass that
// through here, so <img> tags and the like don't generate mixed-mode
// content warnings.
@VirtuBox
VirtuBox / 1-deploy-ubuntu-repositories.md
Last active September 6, 2019 10:24
ubuntu sources.list
wget -O /etc/apt/sources.list https://vtb.cx/$(lsb_release -sc)-list
@VirtuBox
VirtuBox / nginx-map.md
Last active July 22, 2019 23:00
nginx map example to block direct access in wordpress files (not tested)

in a new file in /etc/nginx/conf.d

valid_referers none blocked server_names;

map $http_cookie $cookie_block {
    default 1;
    "~*wordpress_logged_in" 0;
}
map $request_uri $uri_block {