This file contains 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
# config to don't allow the browser to render the page inside an frame or iframe | |
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking | |
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri | |
# https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options | |
add_header X-Frame-Options SAMEORIGIN; | |
# when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header, | |
# to disable content-type sniffing on some browsers. | |
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers | |
# currently suppoorted in IE > 8 http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx |
This file contains 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
UPDATE wp_options SET option_value = replace(option_value, 'oldurl.com', 'newurl.com') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'oldurl.com','newurl.com'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'oldurl.com', 'newurl.com'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value,'oldurl.com','newurl.com'); |
This file contains 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
# usage | |
# bash install-python-2.7.17.sh | |
sudo apt-get update | |
sudo apt-get install build-essential checkinstall -y | |
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev -y | |
cd /usr/src | |
sudo wget https://www.python.org/ftp/python/2.7.17/Python-2.7.17.tgz | |
sudo tar xzf Python-2.7.17.tgz | |
cd Python-2.7.17 | |
sudo ./configure --enable-optimizations |
This file contains 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
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
This file contains 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
server { | |
listen 80; | |
listen [::]:80; #Use this to enable IPv6 | |
server_name www.example.com; | |
root /var/www/prestashop17; | |
access_log /var/log/nginx/access.log; | |
error_log /var/log/nginx/error.log; | |
index index.php index.html; |
This file contains 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
server { | |
listen 80; | |
server_name maxmobiles.lo *.maxmobiles.lo; | |
root /var/www/maxmobiles.lo; | |
error_log /var/www/maxmobiles.lo/log/error.log warn; | |
location / { | |
index index.html index.php; ## Allow a static html file to be shown first |
This file contains 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
#!/usr/bin/env bash | |
# convert sql dumps to csv, tsv, ssv... | |
# also can filter fields using a sed pattern | |
# only works on linux | |
function usage | |
{ | |
echo "usage: $0 [-sc CORES] [-o OUTFILE] [-p PATTERN] SQLFILE" 2>&1 && exit 1 | |
} |
This file contains 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
/* | |
* put this on the very bottom of the functions.php file of your theme | |
* or create manually .maintenance on your web root with desired message | |
*/ | |
// Activate WordPress Maintenance Mode | |
function wp_maintenance_mode(){ | |
if(!current_user_can('edit_themes') || !is_user_logged_in()){ | |
wp_die('<h1 style="color:red">Website under Maintenance</h1><br />We are performing scheduled maintenance. We will be back online shortly!'); | |
} |
NewerOlder