This file contains hidden or 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
RewriteCond %{HTTP_HOST} ^example.com [NC] | |
RewriteRule ^(.*)$ http://example.ca/$1 [L,R=301] | |
RewriteCond %{HTTP_HOST} ^example.com$ [NC] | |
RewriteRule ^(.*)$ http://example.ca/$1 [L,R=301] |
This file contains hidden or 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
<?php | |
/** | |
* Validates a string containing numbers. | |
* | |
* @param $string | |
* A string to validate if it contains numbers. | |
* @return | |
* TRUE or FALSE if it contains numbers. | |
*/ |
This file contains hidden or 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
echo "Hello Michael, You are great at turning me on." | |
### ---------- | |
### PATH SETTINGS | |
### ---------- | |
PATH=/applications/MacVim/:$PATH | |
### ---------- | |
### Archive | |
### ---------- | |
alias tarc="tar -zcf" |
This file contains hidden or 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
#! /bin/bash | |
# Upgrade and install required packages. | |
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get install lamp-server^ | |
sudo apt-get install php5-cli php5-gd php5-curl phpmyadmin | |
# Configure Apache | |
sudo sed -ie 's/AllowOverride None/AllowOverride All/g' /etc/apache2/sites-available/default |
This file contains hidden or 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
function valid_human_name($name) { | |
return preg_match("/^[A-Z][a-zA-Z '&-]*[A-Za-z]$/", $name); | |
} |
This file contains hidden or 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
#! /bin/bash | |
# | |
# Aegir 1.1 install script for Ubuntu 10.4 LTS (Lucid) servers | |
# (install-aegir-on-ubuntu.sh) | |
# script on Github: https://raw.github.com/doka/install-aegir-on-ubuntu/lucid/install-aegir-on-ubuntu.sh | |
# | |
# run with users with sudo rights | |
# | |
# this script assumes: | |
# - your hostname is: myhost.local (it will be the Aegir admin interface) |
This file contains hidden or 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
Alberta | |
British Columbia | |
Manitoba | |
New Brunswick | |
Newfoundland | |
Northwest Territories | |
Nova Scotia | |
Nunavut | |
Ontario | |
Prince Edward Island |
This file contains hidden or 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
# Creating git user | |
sudo adduser -system -shell /bin/bash -gecos 'git version control' -group -disabled-password -home /var/git git | |
# Clone Gitolite | |
git clone git://github.com/sitaramc/gitolite | |
cd gitolite | |
src/gl-system-install | |
# Run setup as git user. | |
sudo su |
This file contains hidden or 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
# Create User | |
CREATE USER 'user'@'localhost' IDENTIFIED BY 'password'; | |
# Grant Privileges | |
GRANT ALL PRIVILEGES ON database.* TO 'user'@'localhost' IDENTIFIED BY 'password'; |
This file contains hidden or 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
<?php | |
/** | |
* Validate a postal code. | |
* | |
* @param $value | |
* A postal code as string. | |
* @param $country | |
* The country postal code format. | |
* @return |