Skip to content

Instantly share code, notes, and snippets.

--- functions.php.orig 2012-07-04 00:20:58.000000000 +0000
+++ functions.php 2012-07-04 00:34:48.000000000 +0000
@@ -1641,14 +1641,14 @@
*/
function wp_ext2type( $ext ) {
$ext2type = apply_filters( 'ext2type', array(
- 'audio' => array( 'aac', 'ac3', 'aif', 'aiff', 'm3a', 'm4a', 'm4b', 'mka', 'mp1', 'mp2', 'mp3', 'ogg', 'oga', 'ram', 'wav', 'wma' ),
- 'video' => array( 'asf', 'avi', 'divx', 'dv', 'flv', 'm4v', 'mkv', 'mov', 'mp4', 'mpeg', 'mpg', 'mpv', 'ogm', 'ogv', 'qt', 'rm', 'vob', 'wmv' ),
- 'document' => array( 'doc', 'docx', 'docm', 'dotm', 'odt', 'pages', 'pdf', 'rtf', 'wp', 'wpd' ),
+ 'audio' => array( 'aac', 'ac3', 'aif', 'aiff', 'm3a', 'm4a', 'm4b', 'mka', 'mp1', 'mp2', 'mp3', 'ogg', 'oga', 'ram', 'wav', 'wma' ),
# Copyright (C) 2012 Mark Caudill
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the
# following conditions:
#
+--------+----------+-----------+-------------------+
| name | latitude | longitude | distance |
+--------+----------+-----------+-------------------+
| third | 3.000000 | 3.000000 | 313.4147056057557 |
| second | 2.000000 | 2.000000 | 470.241165991588 |
| first | 1.000000 | 1.000000 | 627.115323012258 |
+--------+----------+-----------+-------------------+
3 rows in set (0.00 sec)
SELECT
`name`,
`latitude`,
`longitude`,
(
6356.78 *
acos(cos(radians('LAT')) * cos(radians(`latitude`)) *
cos(radians(`longitude`) - radians('LONG')) +
sin(radians('LAT')) * sin(radians(`latitude`)))
) AS `distance`
INSERT INTO points (latitude, longitude, name) VALUES ('1', '1', 'first');
INSERT INTO points (latitude, longitude, name) VALUES ('2', '2', 'second');
INSERT INTO points (latitude, longitude, name) VALUES ('3', '3', 'third');
CREATE DATABASE `data`;
CREATE TABLE IF NOT EXISTS `data`.`points` (
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`latitude` DECIMAL(9,6) NOT NULL,
`longitude` DECIMAL(9,6) NOT NULL,
`name` VARCHAR(64) NOT NULL,
PRIMARY KEY(`id`)
) ENGINE = MyISAM;
#!/bin/sh
ssh_log=/var/log/auth.log
iptables_rules=/etc/iptables.up.rules
max_attempts=20
# Get list of IPs from failed SSH attempts
addresses=$(cat /var/log/auth.log | \
grep -Ei 'invalid user|failed password' | \
grep -Eo '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | \
grep *web* /etc/hosts | awk '{print $3}' | sort | uniq | sshpt.py --stdin -u root "/etc/init.d/httpd restart"
@markcaudill
markcaudill / .boto
Created January 25, 2013 21:07
A Boto credentials file.
[Credentials]
aws_access_key_id =
aws_secret_access_key =
*/5 * * * * /home/mcaudill/src/git/dynroute53/bin/python /home/mcaudill/src/git/dynroute53/update.py