Created
March 24, 2010 07:06
-
-
Save devn/342052 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| (set! *print-length* 50) | |
| (set! *warn-on-reflection* true) | |
| ;; psykotic's trace-seq functions | |
| (defn trace-seq* [name xs printer] | |
| (for [x xs] | |
| (do (println name "->" (printer x)) | |
| x))) | |
| (defmacro trace-seq [xs & [printer]] | |
| `(trace-seq* ~(str xs) ~xs ~(or printer identity))) | |
| (defn find-lines-in-file [#^String text file] | |
| (filter (fn [#^String line] | |
| (< 0 (.indexOf line text))) | |
| (line-seq (reader file)))) ;took out flatten here | |
| (defn parse-outside-ips [coll] | |
| (remove empty? | |
| (pmap | |
| #(rest (re-find #"Deny tcp src outside:(\d+\.\d+\.\d+\.\d+)" %)) | |
| coll))) | |
| ; => (("127.0.0.1") ("127.0.0.1") ("123.456.789.0")...) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment