Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| #define KBUILD_MODNAME "load_balancer" | |
| #include <uapi/linux/bpf.h> | |
| #include <linux/in.h> | |
| #include <linux/if_ether.h> | |
| #include <linux/if_packet.h> | |
| #include <linux/if_vlan.h> | |
| #include <linux/ip.h> | |
| #include <linux/ipv6.h> | |
| BPF_HASH(counter, uint32_t, long); |
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
| (defn tree-searcher | |
| "Parse through every node in a tree and check against | |
| give matcher function. If a match succeeds, return the node. | |
| If no match is found after all recursions, just return the tree. | |
| Also see clojure.walk" | |
| [zipper matcher] | |
| (loop [loc zipper] | |
| (if (zip/end? loc) | |
| (zip/root loc) | |
| (if-let [matcher-result (matcher (zip/node loc))] |
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
| /* Copyright (c) 2013 Gianni Tedesco | |
| * Released under the terms of the GNU GPL version 3 | |
| * mmap() packet socket transmission | |
| */ | |
| #ifndef __linux__ | |
| #error "Are you loco? This is Linux only!" | |
| #endif | |
| #include <stdio.h> |
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
| (insta/parse parser "install_requires = ['argparse', 'requests>=1.1.0,<1.3.0', 'colorama>=0.9,!=1.1,!=1.2.1,<=1.4.1a3']") | |
| [:PYTHON_SETUP_PARSER | |
| "install_requires" | |
| "=" | |
| "[" | |
| [:SEQ-OF-REQUIREMENT | |
| [:REQUIREMENT "argparse"] | |
| [:REQUIREMENT | |
| "requests" |
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
| ;; LTSV (Labeled Tab-separated Values) parser by Clojure | |
| (use '[clojure.string :only [split]]) | |
| (defn ltsv-parse-line | |
| "Parses one LTSV line. Returns a map." | |
| [^String line] | |
| (reduce (fn [r s] (let [[k v] (split s #":" 2)] (assoc r k v))) | |
| {} (split line #"\t") )) |
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
| # Run me with: | |
| # | |
| # $ nginx -p /path/to/this/file/ -c nginx.conf | |
| # | |
| # All requests are then routed to authenticated user's index, so | |
| # | |
| # GET http://user:password@localhost:8080/_search?q=* | |
| # | |
| # is rewritten to: | |
| # |