Skip to content

Instantly share code, notes, and snippets.

@thetemplateblog
thetemplateblog / gist:9873767
Created March 30, 2014 14:47
Read module params
jimport( 'joomla.application.module.helper' );
function getParam( $module, $attribs ) {
$modules = JModuleHelper::getModules( $module );
$params = json_decode($modules[0]->params);
$param = $params->$attribs;
if (strpos($param,'contain-to-grid') !== false) {
$param = 'contain-to-grid';
}
else {
@thetemplateblog
thetemplateblog / gist:10010305
Created April 6, 2014 19:14
HTML5 Page Structure
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Your Website</title>
</head>
<body>
//Theres two parts to this code: first the birthday part and then the clock part which i had on separate arduinos.
//The first section is original and the second is modified from Joe Caldwell at http://www.highonsolder.com who modified it from Scott Bezek who modified it from Doug Jackson
//Good luck
#include <Wire.h>
#include "RTClib.h"
#include <Adafruit_NeoPixel.h>
#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9
@thetemplateblog
thetemplateblog / pd_backup.sh
Last active August 29, 2015 14:10
Postgres Schema Backup
#!/bin/bash
###########################
####### LOAD CONFIG #######
###########################
while [ $# -gt 0 ]; do
case $1 in
-c)
if [ -r "$2" ]; then
# Bind SSL port with PFS-enabling cipher suite
bind :443 ssl crt path_to_certificate no-tls-tickets ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-RSA-RC4-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES128-SHA:AES256-SHA256:AES256-SHA:RC4-SHA
# Distinguish between secure and insecure requests
acl secure dst_port eq 443
# Mark all cookies as secure if sent over SSL
rsprep ^Set-Cookie:\ (.*) Set-Cookie:\ \1;\ Secure if secure
# Add the HSTS header with a 1 year max-age
#!/usr/bin/env python
#
# usage:
# conv2vmx-ovf.py some-vm.ovf
#
# ref: http://www.cnblogs.com/eshizhan/p/3332020.html
#
import sys
fn = sys.argv[1]
@thetemplateblog
thetemplateblog / 0_pw_hash.rb
Last active September 16, 2015 16:44 — forked from pschyska/0_pw_hash.rb
PW hashing with puppet parser function
# lib/puppet/parser/functions/pw_hash.rb
module Puppet::Parser::Functions
newfunction(:pw_hash, type: :rvalue) do |args|
raise Puppet::ParseError, "pw_hash takes exactly two arguments, #{args.length} provided" if args.length != 2
# SHA512 ($6), default number of rounds (5000)
# rounds could be specified by prepending rounds=<n>$ parameter before the salt, i.e.
# args[0].crypt("$6$rounds=50000$#{args[1]}")
args[0].crypt("$6$#{args[1]}")
end
<div class="container">
<div class="row">
<div class="col-sm-12 col-md-6 col-lg-3"><p>1</p></div>
<div class="col-sm-12 col-md-6 col-lg-3"><p>1</p></div>
<div class="col-sm-12 col-md-6 col-lg-3"><p>1</p></div>
<div class="col-sm-12 col-md-6 col-lg-3"><p>1</p></div>
</div>
</div>
@thetemplateblog
thetemplateblog / VirtualBoxKickstart.md
Created February 6, 2016 05:27 — forked from jtyr/VirtualBoxKickstart.md
How to use kickstart in VirtualBox

How to use kickstart in VirtualBox

This short howto describes how to install VMs via kickstart in VirtualBox. It's using PXE functionality built into the NAT network mode of the VirtualBox. The following instructions apply to CentOS installation but it should work for any RedHat-based distro.

Prepare directory structure