Skip to content

Instantly share code, notes, and snippets.

View tcolgate's full-sized avatar

Tristan Colgate-McFarlane tcolgate

View GitHub Profile
(define l3list '(localhost))
(define (find-host )
(for-each
(lambda(router)
(session router
(let* ((arp (get (+ ipNetToMediaPhysAddressq
(% 2 (iid (walk vtpVlanState)))
(ip-as-oid hostip))))
(vlan (% 1 (iid arp)))
@tcolgate
tcolgate / gist:1893027
Created February 23, 2012 14:15
guile filter output via an external command
(use-modules (ice-9 rdelim))
(define (filter inproc outproc cmd . args)
"filter the output of inproc via cmd to outproc through an external cmd"
(let* ((read-pipe (pipe))
(read-in (car read-pipe))
(read-out (cdr read-pipe))
(write-pipe (pipe))
(write-in (car write-pipe))
(write-out (cdr write-pipe))
(defmacro define-automaton (name states &key (stop 'stop) (debug nil))
(let ((event-func (gensym "func")))
`(defun ,name (,event-func)
(tagbody
,@(loop for (state-name . transitions) in states
appending
(list state-name
`(case (funcall ,event-func)
,@(loop for (match next . actions) in transitions
collecting `(,match
@tcolgate
tcolgate / coroutine.ss
Created March 2, 2013 11:12
scheme co routine using prompts, by Andy WIngo
(define-module (gnumaku coroutine)
  #:use-module (oop goops)
  #:export (coroutine define-coroutine wait))
(define (do-coroutine thunk)
  "Creates a procedure that be yield and resume at any point. Used for cooperative multi-threading."
  (define (handler cont callback . args)
    (define (resume . args)
      ;; Call continuation that resumes the procedure.
      (call-with-prompt 'coroutine-prompt
@tcolgate
tcolgate / gist:5075232
Last active December 14, 2015 10:49
Another wingo co-routine
(define (call-with-yield proc)
(let ((tag (make-prompt-tag)))
(define (handler k . args)
(define (resume . args)
(call-with-prompt tag
(lambda () (apply k args))
handler))
(apply values resume args))
(call-with-prompt
root@onatas(mer:hadoop:node):/etc/we7# cat we7tempo.cfg
[Tempo]
STREAM_HOST=http://lynceus.mediagraft.com/stream/
root@molpe:/etc/we7# cat we7tempo.cfg
[Tempo]
TEMPODB = trackversiontempo
@tcolgate
tcolgate / aubio.txt
Created November 21, 2013 20:19
Example of using sonic-annotator to run multiple filters
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix vamp: <http://purl.org/ontology/vamp/> .
@prefix : <#> .
:transform_plugin a vamp:Plugin ;
vamp:identifier "aubiotempo" .
:transform_library a vamp:PluginLibrary ;
vamp:identifier "vamp-aubio" ;
vamp:available_plugin :transform_plugin .
13/11/26 18:02:11 WARN conf.Configuration: session.id is deprecated. Instead, use dfs.metrics.session-id
13/11/26 18:02:11 INFO jvm.JvmMetrics: Initializing JVM Metrics with processName=JobTracker, sessionId=
13/11/26 18:02:11 WARN mapred.JobClient: Use GenericOptionsParser for parsing the arguments. Applications should implement Tool for the same.
13/11/26 18:02:12 INFO hdfs.DFSClient: Created HDFS_DELEGATION_TOKEN token 19 for tristan on ha-hdfs:athena
13/11/26 18:02:12 INFO security.TokenCache: Got dt for hdfs://athena; Kind: HDFS_DELEGATION_TOKEN, Service: ha-hdfs:athena, Ident: (HDFS_DELEGATION_TOKEN token 19 for tristan)
13/11/26 18:02:12 INFO mapred.FileInputFormat: Total input paths to process : 2
13/11/26 18:02:12 INFO mapred.LocalJobRunner: OutputCommitter set in config null
13/11/26 18:02:12 INFO mapred.JobClient: Running job: job_local289259229_0001
13/11/26 18:02:12 INFO mapred.LocalJobRunner: OutputCommitter is org.apache.hadoop.mapred.FileOutputCommitter
13/11/26 18:02:12 INFO mapred.LocalJobRu
# Managed by Puppet 2.7.23
[libdefaults]
default_realm = ATHENA.WE7.LOCAL
ticket_lifetime = 25h
renew_lifetime = 120h
forwardable = true
proxiable = true
default_tkt_enctypes = arcfour-hmac-md5 aes256-cts aes128-cts des3-cbc-sha1 des-cbc-md5 des-cbc-crc
rdns = false
mysql.aborted_clients 1386768462 79 schema=default
mysql.aborted_connects 1386768462 0 schema=default
mysql.binlog_cache_disk_use 1386768462 0 schema=default
mysql.binlog_cache_use 1386768462 2119733 schema=default
mysql.bytes_received 1386768462 12685538768 schema=default
mysql.bytes_sent 1386768462 25870016085 schema=default
mysql.com_admin_commands 1386768462 13883491 schema=default
mysql.com_assign_to_keycache 1386768462 0 schema=default
mysql.com_alter_db 1386768462 0 schema=default
mysql.com_alter_db_upgrade 1386768462 0 schema=default