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 -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 | |
############################################## | |
# 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 -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
#!/bin/bash -ue | |
#################### | |
# For small AWS EC2 instances that have no swap space by default. | |
# A tiny, slow swap file may be preferable to having the server's OOM killer shutting down processes. | |
# A real swap on ephemeral storage is better, but this will do in a pinch. | |
# The disadvantage is that if a server starts using swap, it will burn through it's EBS disk burst credits very quickly. | |
# Works on Ubuntu 14,16,18, LTS. Not tested on any other platform. | |
#################### |
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 <[email protected]> | |
# | |
# 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 |
OlderNewer