Skip to content

Instantly share code, notes, and snippets.

View s5csimmons's full-sized avatar

Collin Simmons s5csimmons

  • Site5
View GitHub Profile
#!/usr/local/bin/ruby
#Changelog:
#v1.2
#Added the following options and functionality:
# -h: There's now a help screen to show you how to use the command
# -n: View current weather, a.k.a. the old output.
# -t: View the forecast for tomorrow.
#v1.1
#We remove the unnecessary "stats" variable and merge it into one query.
#!/bin/bash
#Create a list of all of the songs that need converting
SONGS=$(find . \( -iname "*.m4a" -or -iname "*.webm" -or -iname "*.mp4" \) -maxdepth 1 | cut -c3-)
#If there are no songs to convert, alert user. Else, start looping through.
[[ -z $SONGS ]] && echo "Nothing here" || echo "$SONGS" | while read line
do
#We need to fix the original filename so that problem characters get escaped, has to be a better way.
fixed=$(echo $line | sed "s/ /\\\ /g; s/'/\\\'/g; s/,/\\\,/g; s/(/\\\(/g; s/)/\\\)/g; s/&/\\\&/g; s/\*/\\\*/g; s/\^/\\\^/g")
#!/bin/bash
for website in $(awk --posix '/ServerName/ { if ( $2 !~ /([0-9]{1,3}\.){3}[0-9]+/ && $2 != ENVIRON["HOSTNAME"] && $2 !~ /^_wildcard_/ ) print $2 }' /etc/httpd/conf/httpd.conf)
do
((totalSites++))
curl -s http://labs.sucuri.net/?is-my-wordpress-ddosing=$website | grep -q "Good: Your Website"
[ "$?" -ne "0" ] && badSites+=($website) || ((goodSites++))
sleep 1
done
#!/bin/bash
for website in $(awk --posix '/ServerName/ { if ( $2 !~ /([0-9]{1,3}\.){3}[0-9]+/ && $2 !~ ENVIRON["HOSTNAME"] && $2 !~ /^_wildcard_/ ) print $2 }' /etc/httpd/conf/httpd.conf)
do
((totalSites++))
curl -s http://labs.sucuri.net/?is-my-wordpress-ddosing=$website | grep -q "Good: Your Website"
[ "$?" -ne "0" ] && badSites+=($website) || ((goodSites++))
sleep 1
done