This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# {{ ansible_managed }} | |
# nginx Configuration File | |
# http://wiki.nginx.org/Configuration | |
# Run as a less privileged user for security reasons. | |
user {{ nginx_user }}; | |
# How many worker threads to run; | |
# "auto" sets it to the number of CPU cores available in the system, and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Kernel sysctl configuration file for Linux | |
# | |
# This file should be saved as /etc/sysctl.conf and can be activated using the command: | |
# sysctl -e -p /etc/sysctl.conf | |
# | |
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and sysctl.conf(5) for more details. | |
# ---------- | |
# Credits: | |
# https://klaver.it/linux/sysctl.conf | |
# http://whatizee.blogspot.com/2015/02/webserverftpserver-sysctlconf-parameter.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Documentation: https://roots.io/trellis/docs/security/ | |
# Which components to generate the configuration files for. | |
# If remote machine doesn't have an SSH server then change the ssh_client_hardening to false. | |
ssh_client_hardening: true # SSH | |
ssh_server_hardening: true # SSHD | |
# Set to true if CBC for ciphers is required. | |
ssh_client_cbc_required: false # SSH | |
ssh_server_cbc_required: false # SSHD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#!/bin/bash | |
# forget old rules | |
iptables -F | |
iptables -X | |
iptables -Z | |
# set default policy to drop | |
iptables -P INPUT DROP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# forget old rules | |
iptables -F | |
iptables -X | |
iptables -Z | |
# set default policy to drop | |
iptables -P INPUT DROP | |
iptables -P OUTPUT DROP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find /install-path/ -type d -exec chmod 755 {} \; | |
find /install-path/ -type f -exec chmod 644 {} \; | |
chmod 400 wp-config.php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://jamielinux.com/blog/force-all-network-traffic-through-openvpn-using-iptables/ | |
# Force all traffic through VPN tun | |
*mangle | |
:PREROUTING ACCEPT [0:0] | |
:INPUT ACCEPT [0:0] | |
:FORWARD ACCEPT [0:0] | |
:OUTPUT ACCEPT [0:0] | |
:POSTROUTING ACCEPT [0:0] | |
COMMIT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Watch current directory (recursively) for file changes, and execute | |
# a command when a file or directory is created, modified or deleted. | |
# | |
# Written by: Senko Rasic <[email protected]> | |
# | |
# Requires Linux, bash and inotifywait (from inotify-tools package). | |
# | |
# To avoid executing the command multiple times when a sequence of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Settings for Atom editor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!function_exists('get_post_id_by_meta_key_and_value')) { | |
function get_post_id_by_meta_key_and_value($key, $value) { | |
global $wpdb; | |
$meta = $wpdb->get_results("SELECT * FROM `".$wpdb->postmeta."` WHERE meta_key='".$wpdb->escape($key)."' AND meta_value='".$wpdb->escape($value)."'"); | |
if (is_array($meta) && !empty($meta) && isset($meta[0])) { | |
$meta = $meta[0]; | |
} | |
if (is_object($meta)) { | |
return $meta->post_id; |
OlderNewer