This file contains 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
# Apache Environment Variables | |
The following environment variables are available through phpinfo(). | |
* VCAP_SERVICES | |
* HTTP_HOST | |
* HTTP_X_FORWARDED_FOR | |
* HTTP_CONNECTION | |
* HTTP_ACCEPT | |
* HTTP_ACCEPT_ENCODING |
This file contains 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 | |
/** | |
* Database Configuration | |
* | |
* All of your system's database configuration settings go in here. | |
* You can see a list of the default settings in craft/app/etc/config/defaults/db.php | |
*/ | |
if ($_SERVER['HTTP_HOST'] == 'local.domainname.com') { |
This file contains 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
#Craft Plugin Developement - Forms Cheatsheet | |
My quick reference for working with forms while developing plugins for Craft. | |
###checkbox | |
* id | |
* class | |
* name | |
* checked |
This file contains 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
{% if loop.index is divisibleby(3) %} | |
<div class="clearfix"></div> | |
{% endif %} |
This file contains 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
#!/usr/bin/env bash | |
echo ">>> Starting Install Script" | |
# Update | |
sudo apt-get update | |
# Install MySQL without prompt | |
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root' | |
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root' |
This file contains 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
public function getTitle() | |
{ | |
if (craft()->hasPackage(CraftPackage::PublishPro)) | |
{ | |
$section = $this->_getSection(); | |
if ($section) | |
{ | |
return Craft::t('Post a new {section} entry', array('section' => strtolower($section->name))); | |
} |
This file contains 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
# Don't throw any errors for missing favicons and don't display them in the logs | |
location = /favicon.ico { | |
log_not_found off; | |
access_log off; | |
} | |
# Don't log missing robots or show them in the nginx logs | |
location = /robots.txt { | |
allow all; | |
log_not_found off; |
This file contains 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
#!/usr/bin/env bash | |
if [ $EUID -ne 0 ]; then | |
echo "You must be root: \"sudo ngxvhost\"" | |
exit 1 | |
fi | |
# May need to run this as sudo! | |
# I have it in /usr/local/bin and run command 'ngxvhost' from anywhere, using sudo. |
This file contains 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
[nginx] | |
name=nginx repo | |
baseurl=http://nginx.org/packages/centos/6.5/$basearch/ | |
gpgcheck=0 | |
enabled=1 |
This file contains 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
# flush all rules | |
iptables -F | |
# block null packets | |
iptables -A INPUT -p tcp --tcp-flags ALL NONE -j DROP | |
# block syn-flood attacks | |
iptables -A INPUT -p tcp ! --syn -m state --state NEW -j DROP | |
# block XMAS packets |
OlderNewer