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
#!/bin/bash | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" | |
exit 1 | |
fi | |
function get_hostname() { | |
read -p "Enter hostname: " hostname | |
if [ -z "$hostname" ]; then |
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
diff --git a/ape.test b/ape.test | |
index 756cfeb..f34a7fe 100644 | |
--- a/ape.test | |
+++ b/ape.test | |
@@ -31,6 +31,7 @@ class ApeTestHelper extends DrupalWebTestCase { | |
$modules[] = 'path'; | |
$modules[] = 'user'; | |
$modules[] = 'common_test'; | |
+ $modules[] = 'ape_redirect_test'; | |
parent::setUp($modules); |
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
#!/bin/bash | |
STLOAD=$(cat /proc/loadavg | awk '{print $1}') | |
while true; do | |
FINLOAD=$(cat /proc/loadavg | awk '{print $1}') | |
if (( $(echo "$STLOAD $FINLOAD" | awk '{ if ($1 >= 8 && $2 >= 8) print 1}') )); then | |
if [[ -z $TIME ]]; then | |
TIME=$(date +"%s") | |
fi |
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 perl | |
use strict; | |
use warnings; | |
use LWP::Simple; | |
use Scalar::Util qw(looks_like_number); | |
our $VERSION = 1.337; |
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 | |
/** | |
* @file | |
* Drush command to check for overly large items in DB cache tables that will | |
* not work with memcache. | |
*/ | |
/** | |
* Implements hook_drush_command(). |
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
user_restrictions_create_form: | |
route_name: user_restrictions.create_form | |
title: 'Add rule' | |
appears_on: | |
- user_restrictions.list_form |
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
User "apache" | |
Group "apache" | |
#RootJail "/var/pound/jail" | |
#Alive 60 | |
ListenHTTPS | |
HeadRemove "X-Forwarded-Proto" | |
AddHeader "X-Forwarded-Proto: https" | |
Address 0.0.0.0 | |
Port 443 |
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
newmac() { | |
MAC=`openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'` | |
echo "Setting MAC address to $MAC" | |
sudo ifconfig en0 ether $MAC | |
} |
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
watch 'grep -o "forwarded_for=\".*\" " nginx.log | cut -d= -f2 | sed -e "s/\"//g" | tr "," "\n" | tr -d " " | sort -n | uniq -c | sort -nr | head -n20' |
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 | |
$user = ''; | |
$pass = ''; | |
$database = ''; | |
$limit = 1000000; | |
$dsn = 'mysql:dbname=' . $database . ';unix_socket=/var/run/mysqld/mysqld.sock'; | |
try { |