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
(import '(java.net InetAddress | |
InetSocketAddress | |
DatagramPacket | |
DatagramSocket)) | |
(defn create-udp-server [& {:keys [local-ip local-port remote-ip remote-port]}] | |
(let [s (InetSocketAddress. (InetAddress/getByName local-ip) local-port) | |
r (InetSocketAddress. (InetAddress/getByName remote-ip) remote-port) | |
d (DatagramSocket. s) | |
udp-server (ref d)] |
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
(import '(java.net InetAddress | |
InetSocketAddress | |
DatagramPacket | |
DatagramSocket)) | |
; Create a SocketAddress object that holds the IP address and UDP port the | |
; socket will listen to. | |
(let [listener-ip "127.0.0.1" | |
listener-port 29000] |
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
(import '(java.net InetAddress InetSocketAddress DatagramPacket DatagramSocket)) | |
(def buf-len 1500) | |
; create a SocketAdress for the listener | |
(let [listener-port 29000 | |
listener-ip "127.0.0.1"] | |
(def l-socket-address (InetSocketAddress. (InetAddress/getByName listener-ip) listener-port))) |
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
; Generate a list of random IPs to be fed into nmap so that nmap may scan | |
; aggressively but not swamp any given subnet within the 172.16.0.0/12 range. | |
; | |
; Licensed under the EPL. (fwiw ;) | |
(use '[clojure.contrib.seq-utils :only (shuffle)] | |
'[clojure.contrib.duck-streams :only (write-lines)]) | |
(write-lines | |
"./ips.txt" |
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
(ns nmanage) | |
(def running (atom true)) | |
(defn process | |
[] | |
(when @running | |
(prn "hi") | |
(Thread/sleep 1000)) | |
(recur)) |
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
(ns bar.baz | |
(:require [vertigo.core :as vc] | |
[vertigo.structs :as vs])) | |
;; | |
;; based off of work by Michał Marczyk | |
;; http://stackoverflow.com/questions/8949837/binary-search-in-clojure-implementation-performance | |
;; | |
(set! *warn-on-reflection* true) |
NewerOlder