Skip to content

Instantly share code, notes, and snippets.

View brianseeders's full-sized avatar

Brian Seeders brianseeders

View GitHub Profile

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@brianseeders
brianseeders / gist:91fb71c16bc5ca91fe79
Created January 9, 2015 21:57
PHP logstash pattern
PHPERROR \[%{PHPDATESTAMP:timestamp}\] PHP %{DATA:error_type}:(?:\s*)%{PHPMESSAGE:message}
PHPMESSAGE %{DATA:message_short} in %{UNIXPATH:path} on line %{POSINT:line_number}
PHPDATESTAMP %{MONTHDAY}[./-]%{MONTH}[./-]%{YEAR} %{TIME}
#####
# You'll be needing two machines, the target machine and source one (makes sense, right)?
#####
# On the target machine
nc -l 55555 | gzip -d -c | mysql <database name> -u<user> -p<password> [ | <decrypt> ]
#####
# On the source machine
mysqldump -u<user> -p<password> <database name> | gzip | nc <ip of target server> 55555 [ | <encrypt> ]
#!/bin/bash
## The regex string to use for all detail page transforms is:
regex='s/([^:]{4,5}:\/\/)?((www|m)\.)?(.*)/http:\/\/m.\4?embed=copyright/'
## It is hardened against transient protocol and subdomain presence.
## It does not account for preexisting query strings.
## That would require 2 separate regexes and is not likely to occur in our feed.
## Here is the test suite.