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
| union maxtime=300 timeout=300 | |
[| rest splunk_server="local" "/servicesNS/-/-/data/ui/views" search="eai:acl.sharing=user" | eval Type="view" | fields - type description label] | |
[| rest splunk_server="local" "/servicesNS/-/-/data/props/calcfields" search="eai:acl.sharing=user" | eval Type="calculated fields" | fields - type field.* | rex field=title " : [^\-]+-(?<title>[^\e]+)"] | |
[| rest splunk_server="local" "/servicesNS/-/-/data/props/fieldaliases" search="eai:acl.sharing=user" | eval Type="field aliases" | fields - type value | rex field=title " : [^\-]+-(?<title>[^\e]+)"] | |
[| rest splunk_server="local" "/servicesNS/-/-/data/transforms/extractions" search="eai:acl.sharing=user" | eval Type="field transformations" | fields - type] | |
[| rest splunk_server="local" "/servicesNS/-/-/data/props/extractions" search="eai:acl.sharing=user" | eval Type="extractions" | rex field=title " : (?<type>(EXTRACT|REPORT))-(?<title>[^\e]+)"] | |
[| rest splunk_server="local" "/servicesNS/-/-/data/props/sourcetype-rename" search="eai: |
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
class MemoryMash { | |
public function mash() { | |
str_pad('', $this->getMaxMemory()); | |
} | |
private function getMaxMemory() { | |
$memoryLimit = ini_get('memory_limit'); | |
if ($memoryLimit != -1) { | |
$memoryLimit = $this->return_bytes($memoryLimit); | |
} else { |
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
<?php | |
// usage: `php getBootie.php <url> <album-title>` | |
// for a url like: http://bootiemashup.com/blog/2012/05/triple-tribute-bootie-mashup-pays-tribute-to-mca-of-beastie-boys-robin-gibb-of-bee-gees-donna-summer.html | |
// @see http://www.getid3.org/ | |
require_once(dirname(__FILE__) . '/getid3/getid3.php'); | |
$url = $argv[1]; | |
$album_title = $argv[2]; |
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 | |
/bin/grep $@ | /bin/grep -v svn |
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
<?php | |
/** | |
* Provide a set of fields to filter submissions from bots without requiring | |
* a captcha or otherwise inconveniencing human users | |
* | |
* TODO: Be more flexible about which fields are included - by default include | |
* all but allow caller to specify a subset | |
* | |
* TODO: Why you gotta be so static? |
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
from itertools import product | |
possible = [''.join(secret) for secret in product('ABCDEF', repeat=4)] | |
results = [(right, wrong) for right in range(5) for wrong in range(5 - right) if not (right == 3 and wrong == 1)] | |
def score(secret, guess): | |
first = len([speg for speg, gpeg in zip(secret, guess) if speg == gpeg]) | |
return first, sum([min(secret.count(j), guess.count(j)) for j in 'ABCDEF']) - first | |
def solve(secrets, attemptfun, first=False): |