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 | |
# Show some help | |
if (( $# != 1 )); then | |
echo "" | |
echo "Usage: $(basename $0) <domain.com>" | |
echo "Does some lookups to help find out where a website is hosted, given a domain name." | |
echo "" | |
exit 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
#!/bin/bash | |
############################################## | |
# File: backdir | |
# Author: Dale C. Anderson | |
# Purpose: Small script to quickly back up a folder | |
############################################## | |
set -u # Fail if an undeclared variable is used (helps when making changes / debugging) |
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 -ue | |
# To use: | |
# wget -q -O - https://gist.githubusercontent.com/dale-c-anderson/b791c79de07d604b76db/raw/hook-chain-install.sh | bash | |
# @TODO: Allow use of either wget or curl (try the other if the first doesn't exist) | |
function main () { | |
DIRNAME=$(basename "$PWD") |
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 -u | |
# Restart postfix on Ubuntu 14.04 | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi | |
service postgrey status |
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 | |
function main () { | |
if [ $# -gt 0 ]; then | |
# Someone sent us a filename | |
cat "$@" | grep -v ^\; | grep -v ^$ | grep -v ^\ $ | grep -v '^#' | |
else | |
if [ -t 0 ]; then | |
# Someone called us without args or pipes. | |
usage |
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
# /etc/fail2ban/filter.d/apache-wordpress.conf | |
# | |
# Fail2Ban configuration file | |
# | |
# Author: | |
# Dale Anderson <danderson@acromediainc.com> | |
# | |
# Description: | |
# Bans anyone who tries to POST to a PHP file (existing or not) in the wp-content/uploads directory. | |
# |
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
server { | |
listen 80; | |
server_name www.example.com; | |
access_log /var/log/vhosts/myaccount/myproject/nginx-access.log; | |
error_log /var/log/vhosts/myaccount/myproject/nginx-error.log; | |
root /var/vhosts/myaccount/www/myproject/wwwroot; | |
index index.html index.php; | |
client_max_body_size 8m; | |
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 | |
W_PATH="$(xclip -selection clipboard -o)" | |
U_PATH="$(echo "$W_PATH" | sed -e 's/\\/\//g' -e 's/A:/\/media\/accounts/g')" | |
nautilus "$U_PATH" |
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
--- | |
- hosts: all | |
gather_facts: true | |
become: yes | |
tasks: | |
- name: Remove php5-fpm | |
apt: name=php5-fpm | |
update_cache=no |
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
# Customize BASH PS1 prompt to show current GIT repository and branch. | |
# by Mike Stewart - http://MediaDoneRight.com | |
# SETUP CONSTANTS | |
# Bunch-o-predefined colors. Makes reading code easier than escape sequences. | |
# I don't remember where I found this. o_O | |
# Reset | |
Color_Off="\[\033[0m\]" # Text Reset |
OlderNewer