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/sh | |
CONFIG=/etc/mysql/conf.d/xtradb-cluster.cnf | |
# With a syntax of gcomm://foo,bar,frog this should work eh? | |
NODES="$(grep ^wsrep_cluster_address ${CONFIG} | cut -d '/' -f3- | tr ',' ' ')" | |
if [ -z "${NODES}" ]; then | |
echo "Cannot find cluster nodes in config file: ${CONFIG}" | |
exit 1 |
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
_preprocess_node(&$variables) { | |
$terms = field_get_items('node', $variables['node'], 'field_topic'); | |
$parents = taxonomy_get_parents($terms[0]['tid']); | |
$parent = array_shift($parents); | |
$variables['top_topic'] = field_view_value('node', $node, 'field_topic', array('tid' => $parent->tid)); | |
} |
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 mytheme_preprocess_node(&$variables) { | |
$author = node_load($variables['node']->uid); | |
$variables['author_mail'] = check_plain($author->mail); | |
} |
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
# Set password authentication on nominated hostname via the | |
# setenvif module. | |
<IfModule mod_setenvif.c> | |
AuthType Basic | |
AuthName "Enter a damn password you monkey" | |
AuthUserFile /some/htpasswd | |
Require valid-user | |
SetEnvIf Host .*\.example\.com$ NEED_AUTH | |
SetEnvIf Host .*\.example2\.com$ NEED_AUTH |
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 | |
function mymod_menu() { | |
$items['view/path/that/returns/the/json] = array( | |
'title' => t('JSON Callback'), | |
'page callback' => 'mymod_callback', | |
'access callback' => TRUE, | |
'type' => MENU_CALLBACK, | |
); | |
return $items; | |
} |
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
hosts=$( sed -ne 's/^[ ]*[Hh][Oo][Ss][Tt]\([Nn][Aa][Mm][Ee]\)\{0,1\}[ ]*\([^#*?]*\)\(#.*\)\{0,1\}$/\2/p' .ssh/config ) |
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
/etc/cron.daily/mysqldumpcron: | |
#!/bin/bash | |
# | |
# Create a MySQL user: GRANT SELECT, RELOAD, REPLICATION CLIENT ON *.* TO backup@localhost identified by 'password'; | |
USER=backup | |
PASSWORD=password | |
# | |
# Dump the mysql and pgsql databases to a daily dump file. |
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
diff --git a/drush_make.orig/drush_make.download.inc b/drush_make/drush_make.download.inc | |
index 92c68f9..2bd0bb5 100644 | |
--- a/drush_make.orig/drush_make.download.inc | |
+++ b/drush_make/drush_make.download.inc | |
@@ -345,6 +345,7 @@ function drush_make_download_post($name, $download, $download_location) { | |
function drush_make_download_git($name, $download, $download_location) { | |
$tmp_path = drush_make_tmp(); | |
$wc = drush_get_option('working-copy'); | |
+ $wc = (!empty($download['working-copy'])) ? $download['working-copy'] : $wc; | |
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
# The MySQL database server configuration file. | |
# | |
# You can copy this to one of: | |
# - "/etc/mysql/my.cnf" to set global options, | |
# - "~/.my.cnf" to set user-specific options. | |
# | |
# One can use all long options that the program supports. | |
# Run program with --help to get a list of available options and with | |
# --print-defaults to see which it would actually understand and use. | |
# |
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
/** | |
* Implements hook_preprocess_status_messages(). | |
* | |
* Remove the login warning message, anon users can only see the login form anyway. | |
*/ | |
function intranet_preprocess_status_messages(&$vars) { | |
$messages = drupal_get_messages('error'); | |
if (!empty($messages['error'])) { | |
$errors = $messages['error']; | |
foreach ($errors as $error) { |