Skip to content

Instantly share code, notes, and snippets.

@yourdesigncoza
yourdesigncoza / firewall-ufw
Created April 30, 2013 15:52
UFW - Uncomplicated Firewall
# The Uncomplicated Firewall (ufw) is a frontend for iptables and is particularly well-suited for host-based firewalls. ufw provides a framework for managing netfilter, as well as a command-line interface for manipulating the firewall.
# resources
# https://wiki.ubuntu.com/UncomplicatedFirewall
# IMPORTANT : add your own data or parameters, I make use of double segments [[ your variable ]]. eg. ssh root@[[ 96.172.44.11 ]] should be replaced with ssh root@888.88.88.88 where "888.88.88.88" is your value, variable etc. I have a habit of using ":::" to indicate line ending and end of paragraph, crazy I know but be warned its just how I write ::: All notes are for my own use & should you use any it's at your own risk, it's NOT a Tutorial :::
# Enable and configure Firewall - ufw
# ufw firewall is installed by default on Ubuntu 12.04. gufw is a handy GUI frontends for ufw to manage the firewall.
@yourdesigncoza
yourdesigncoza / php-mail-postfix-ubuntu
Created April 26, 2013 18:42
Ubuntu PHP mail() Function with Postfix
# Ubuntu PHP mail
# Ubuntu 12.04 LTS
# IMPORTANT : add your own data or parameters, I make use of double segments [[ your variable ]]. eg. ssh root@[[ 96.172.44.11 ]] should be replaced with ssh root@888.88.88.88 where "888.88.88.88" is your value, variable etc. I have a habit of using ":::" to indicate line ending and end of paragraph, crazy I know but be warned its just how I write ::: All notes are for my own use & should you use any it's at your own risk, it's NOT a Tutorial :::
# Resources
# https://help.ubuntu.com/12.04/serverguide/postfix.html
# http://sourcelibrary.org/2011/08/29/how-to-set-up-the-php-mail-function-on-a-ubuntu-linux-lamp-server/
# http://stackoverflow.com/questions/12083025/xampp-on-ubuntu-server-12-04-with-pear-installed-returns-errors-when-trying-to-u
# http://askubuntu.com/questions/47609/how-to-have-my-php-send-mail
Verifying that "johnmontgomery.id" is my Blockstack ID. https://onename.com/johnmontgomery
@yourdesigncoza
yourdesigncoza / monit-deamon-server-monitor
Created April 19, 2013 15:59
Monit is a utility for managing and monitoring, processes, programs, files, directories and file systems on a UNIX system. Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations ::: " a great little utility that monitors your daemons " In Short it lets you know when your Apache server goes d…
# Monit is a utility for managing and monitoring, processes, programs, files, directories and file systems on a UNIX system. Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations ::: " a great little utility that monitors your daemons "
# in Short it lets you know when your Apache server goes down, when you reach your pre-determined memory usage. It will also restart key components should they stop working, for instance your web server ( apache ) might "crash" due to a DDOS attack or similar, monit will attempt to restart said services notifying you of whats going on, depending on your mmonit configuration :::
# Official site : http://mmonit.com/
# IMPORTANT : add your own data or parameters, I make use of double segments [[ your variable ]]. eg. ssh root@[[ 96.172.44.11 ]] should be replaced with ssh root@888.88.88.88 where "888.88.88.88" is your value, variable etc. I have a habit of using ":::" to indicate line ending and end of paragraph, crazy I
@yourdesigncoza
yourdesigncoza / virtualmin-centos6-backup-to-dropbox
Created May 18, 2013 14:06
Backing Up To DropBox just sounds "cool" so here we go ::: I'm running a Centos 6 VPN with Webmin and Virtualmin GPL install, with "reseller" accounts ( not that I sell, I just like the functionality ) so I needed a way to create nightly BU's of each account ::: Below are some links I found very handy
# Backing Up To DropBox just sounds "cool" so here we go ::: I'm running a Centos 6 VPN with Webmin and Virtualmin GPL install, with "reseller" accounts ( not that I sell, I just like the functionality ) so I needed a way to create nightly BU's of each account ::: Below are some links I found very handy :::
# IMPORTANT : add your own data or parameters, I make use of double segments [[ your variable ]]. eg. ssh root@[[ 96.172.44.11 ]] should be replaced with ssh root@888.88.88.88 where "888.88.88.88" is your value, variable etc. I have a habit of using ":::" to indicate line ending and end of paragraph, crazy I know but be warned its just how I write ::: All notes are for my own use & should you use any it's at your own risk, it's NOT a Tutorial :::
# Resource
# http://kiteplans.info/2012/03/26/centos-virtualmin-server-backups-dropbox/ ( Centos )
# http://www.dropboxwiki.com/Using_Dropbox_CLI
# https://whatbox.ca/wiki/Dropbox ( Ubuntu )
@yourdesigncoza
yourdesigncoza / mediaelements
Created August 18, 2013 11:19
Style WordPress media elements : video controls
/*----------------------------------------LAUDES----------------------------------------*/
/* Mediaelements Controls */
/*--------------------------------------------------------------------------------------*/
.hentry .mejs-mediaelement,
.hentry .mejs-container .mejs-controls {
background: #191919;
}
.hentry .mejs-controls .mejs-time-rail .mejs-time-loaded,
@yourdesigncoza
yourdesigncoza / the-slug.php
Created June 25, 2013 15:29
function to get post/page slug When coding or styling a theme, it can be very useful to be able to get the slug of the current post or page, for example to create a css class. Here’s an easy function to get the slug from the current post or page. source : http://www.wprecipes.com/wordpress-function-to-get-postpage-slug
<?php
function the_slug() {
$post_data = get_post($post->ID, ARRAY_A);
$slug = $post_data['post_name'];
return $slug;
}
?>
Once done, simply call the function within the loop to get the post or page slug.
@yourdesigncoza
yourdesigncoza / ratings
Created June 9, 2013 14:42
Remove ratings
remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 );
@yourdesigncoza
yourdesigncoza / out-of-stock
Created June 9, 2013 14:42
Out of stock custom text after title in archive pages
add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_out_stock', 10);
function woocommerce_template_loop_out_stock() {
global $product;
if ( ! $product->managing_stock() && ! $product->is_in_stock() )
echo '<p class="stock out-of-stock">Out of stock</p>';
}
@yourdesigncoza
yourdesigncoza / functions.php
Created June 9, 2013 11:19 — forked from jameskoster/functions.php
set image dimensions upon theme activation
<?php
/**
* Hook in on activation
*/
global $pagenow;
if ( is_admin() && isset( $_GET['activated'] ) && $pagenow == 'themes.php' ) add_action( 'init', 'yourtheme_woocommerce_image_dimensions', 1 );
/**
* Define image sizes
*/