Skip to content

Instantly share code, notes, and snippets.

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

Viorel-Cosmin Miron uhlhosting

🏠
Working from home
View GitHub Profile
@uhlhosting
uhlhosting / default.vcl
Created January 30, 2016 03:35 — forked from fevangelou/default.vcl_PREFACE.md
The perfect Varnish configuration for Joomla (& other CMS based) websites
#################################################################################
### The perfect Varnish configuration for Joomla (& other CMS based) websites ###
#################################################################################
# USE: Place the contents of this configuration inside the main
# Varnish configuration file, located in: /etc/varnish/default.vcl (root server access required - obviously)
# IMPORTANT: The following setup assumes a 2 minute cache time. You can safely increase
# this to 5 mins for less busier sites or drop it to 1 min or even 30s for high traffic sites.
@uhlhosting
uhlhosting / my.cnf
Created January 31, 2016 19:11 — forked from fevangelou/my.cnf
Optimized MySQL configuration
# Optimized MySQL configuration by Fotis Evangelou - Updated Jan 2016
#
# The settings provided below are a starting point for a 4GB-8GB RAM server with 4 CPU cores.
# If you have less or more resources available you MUST adjust accordingly to save CPU, RAM and disk I/O usage.
# To fine tune these settings for your system, use MySQL DB diagnostics tools like:
# https://launchpad.net/mysql-tuning-primer
# or
# http://blog.mysqltuner.com/download/
# Note that if there is no comment beside a setting, then you don't need to adjust it.
@uhlhosting
uhlhosting / bots.py
Created February 3, 2016 20:50 — forked from edsu/bots.py
see what your bot traffic is like
#!/usr/bin/env python
"""
Hack to look for user agent strings in typical Apache style log and
count up the number of requests by bots vs non-bots. The list of bot
user agents comes from http://www.user-agents.org/ but has had some
agents added to it, since the user-agents.org list is pretty out of date, e.g.
no Bing?!
"""
@uhlhosting
uhlhosting / gist:4df29b13b47ff3ee6118173198c4ae65
Created July 8, 2016 04:06 — forked from wycks/gist:2315295
Rewrite static theme assets and plugins directory (WordPress)
<?php
// rewrite /wp-content/themes/theme-name/css/ to /css/
// rewrite /wp-content/themes/theme-name/js/ to /js/
// rewrite /wp-content/themes/theme-name/img/ to /img/
// rewrite /wp-content/plugins/ to /plugins/
function roots_flush_rewrites() {
global $wp_rewrite;
$wp_rewrite->flush_rules();
}
@uhlhosting
uhlhosting / fix-wordpress-permissions.sh
Created July 30, 2016 23:38 — forked from Adirael/fix-wordpress-permissions.sh
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@uhlhosting
uhlhosting / wp-permissions-script
Created July 30, 2016 23:59 — forked from macbleser/wp-permissions-script
WordPress Permissions Configuration Script
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro
#
WP_OWNER=changeme # &lt;-- wordpress owner
WP_GROUP=changeme # &lt;-- wordpress group
WP_ROOT=/home/changeme # &lt;-- wordpress root directory
@uhlhosting
uhlhosting / archive-wpseo_locations.php
Created October 24, 2016 02:29 — forked from bhubbard/archive-wpseo_locations.php
WordPress Templates for Local SEO by Yoast Multiple Locations CPT
<?php
/*
Our Template Page for Single Locations created with Local SEO by Yoast
Local SEO is good at at formatting this data use the schema format, please make sure you continue to support it.
*/
get_header(); ?>
<h1>Locations</h1>
@uhlhosting
uhlhosting / gist:45467da63872e1119a52abc8981e6c9c
Created May 21, 2017 07:07 — forked from goblindegook/gist:1919587
Adjust WordPress HTTP request timeout
<?php
function my_http_request_args ( $r )
{
$r['timeout'] = 15; # new timeout
return $r;
}
add_filter( 'http_request_args', 'my_http_request_args', 100, 1 );
@uhlhosting
uhlhosting / dynmotd
Created July 6, 2017 01:33 — forked from cha55son/dynmotd
RHEL (Centos/Fedora) dynamic motd
#!/bin/bash
# Installation:
#
# 1. vim /etc/ssh/sshd_config
# PrintMotd no
#
# 2. vim /etc/pam.d/login
# # session optional pam_motd.so
#
@uhlhosting
uhlhosting / dynmotd
Created July 6, 2017 01:33 — forked from cha55son/dynmotd
RHEL (Centos/Fedora) dynamic motd
#!/bin/bash
# Installation:
#
# 1. vim /etc/ssh/sshd_config
# PrintMotd no
#
# 2. vim /etc/pam.d/login
# # session optional pam_motd.so
#