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 | |
# Locate our phpunit. | |
phpunit=`which phpunit` | |
# Any extra arguments to phpunit should go here. | |
phpunit_args="" | |
# Define a location to save the output. | |
outputlog="/tmp/phpunit_output_`date +%s`.log" |
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
SELECT table_name, engine, table_rows, data_length, ROUND(((data_length+index_length)/1024/1024),0) "MB" | |
FROM information_schema.tables | |
WHERE table_schema = 'DATABASE_NAME' | |
ORDER BY data_length; |
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 | |
### | |
# A short script to sync S3 to a local directory. | |
# Read arguments | |
while getopts ":c:b:dts" opt ; do | |
case $opt in | |
c) | |
if [ -e ${OPTARG} ] ; then |
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
# tcpdump filter for HTTP GET | |
sudo tcpdump -s 0 -A 'tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x47455420' | |
# tcpdump filter for HTTP POST | |
sudo tcpdump -s 0 -A 'tcp dst port 80 and (tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x504f5354)' |
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
ps auxw | grep sbin/apache | awk '{print"-p " $2}' | xargs strace -f |
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 | |
ps -ylC httpd | awk '{x += $8;y += 1} END {print "Apache Memory Usage (MB): "x/1024; print "Average Proccess Size (MB): "x/((y-1)*1024)}' |
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 | |
server=`hostname` | |
timestamp=`date +%s` | |
mail_subject="${1-"$timestamp"} ($server)" | |
mail_address=${2-"[email protected]"} | |
mail_message="/tmp/$timestamp.message" | |
mail_program="/bin/mail" | |
echo "Sending test mail to $mail_address, with subject \"$mail_subject\"" |
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
# Copy this file to /etc/systemd/system/xvfb.service | |
# Then execute: | |
# systemctl enable /etc/systemd/system/xvfb.service | |
# systemctl start xvfb.service | |
[Unit] | |
Description=X Virtual Frame Buffer Service | |
After=network.target | |
[Service] |
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
-- | |
-- Simple script to do unattented reboot of Airport devices. | |
-- Assumptions: all the devices are sequential, with none to skip. | |
-- | |
-- only run this script if it's before 5am. | |
set foo to do shell script "date +%H" | |
set thisHour to foo as number | |
if thisHour < 5 then |
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 | |
if [[ $# -ne 1 ]]; then | |
echo "Usage: $(basename $0) user" | |
exit 99 | |
fi | |
HOST=ldap.example.com | |
BASE_DN="dc=example,dc=com" | |
ROOT_DN="cn=admin,${BASE_DN}" |
OlderNewer