For those users who use cPanel/WHM on their virtual or dedicated servers the following article describes common system paths and utilities.
PHP
/usr/bin/php
cd /usr/local/cpanel/3rdparty/bin/git clone https://github.com/pagespeed/cpanel.git /root/pagespeed/ | |
/usr/local/cpanel/3rdparty/bin/git clone https://github.com/pagespeed/cpanel.git /root/pagespeed/ | |
cd /root/pagespeed | |
cd Easy | |
tar -zcvf Speed.pm.tar.gz pagespeed | |
mkdir -p /var/cpanel/easy/apache/custom_opt_mods/Cpanel/Easy | |
mv Speed.pm Speed.pm.tar.gz -t /var/cpanel/easy/apache/custom_opt_mods/Cpanel/Easy/ | |
rm -rf /root/pagespeed/ | |
screen -S ea | |
/scripts/easyapache |
#!/usr/bin/env bash | |
# Base16 - Gnome Terminal color scheme install script | |
[[ -z "$PROFILE_NAME" ]] && PROFILE_NAME="flatabulous-terminal" | |
[[ -z "$PROFILE_SLUG" ]] && PROFILE_SLUG="flatabulous-terminal" | |
[[ -z "$DCONF" ]] && DCONF=dconf | |
[[ -z "$UUIDGEN" ]] && UUIDGEN=uuidgen | |
dset() { | |
local key="$1"; shift |
<?php | |
/*-----------------------------------------------------------------------------------*/ | |
/* Clean them stylesheet <link> tags | |
/*-----------------------------------------------------------------------------------*/ | |
function clean_style_tag($input) { | |
preg_match_all("!<link rel='stylesheet'\s?(id='[^']+')?\s+href='(.*)' type='text/css' media='(.*)' />!", $input, $matches); | |
// Display media if it's print | |
$media = $matches[3][0] === 'print' ? ' media="print"' : ''; | |
return '<link rel="stylesheet" href="' . $matches[2][0] . '"' . $media . '>' . "\n"; |
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl'); |
/*---------------------------------------------- | |
--Common MQs Min-Width | |
----------------------------------------------- */ | |
$mq-xsmall: 22em; | |
//after iphone | |
$mq-small: 32em; | |
//Tablet ish (main break) | |
$mq-med: 54em; |
<html> | |
<head> | |
<!-- Inlined critical styles --> | |
<style>.blue{color:blue;}</style> | |
<!-- CSS loader --> | |
<script> | |
/* ========================================================================== | |
Load CSS asynchronously and conditionally after initial painting |
Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.
This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.
You are encouraged to fork this and modify it to your heart's content to match your own needs.
<?php | |
/*-----------------------------------------------------------------------------------*/ | |
/* Conditional Logic to Detect Various Event Related Views/Pages | |
/*-----------------------------------------------------------------------------------*/ | |
if( tribe_is_month() && !is_tax() ) { // Month View Page | |
echo 'were on the month view page'; | |
} elseif( tribe_is_month() && is_tax() ) { // Month View Category Page |
#!/bin/bash | |
SET_USERS="usernameone:password:/path/to/web/folder usernametwo:password:/path/to/second/folder" | |
IFS=' ' read -a USERS <<< "${SET_USERS}" | |
for SET_USER in ${USERS[@]}; do | |
IFS=':' read -a USER <<< "${SET_USER}" | |
NAME=${USER[0]}; | |
PASS=${USER[1]}; | |
DIR=${USER[2]}; | |
(echo $PASS; echo $PASS) | pure-pw useradd $NAME -u www-data -g www-data -d $DIR |