Skip to content

Instantly share code, notes, and snippets.

View lmacken's full-sized avatar

Luke Macken lmacken

  • Colorado
View GitHub Profile
@endolith
endolith / Has weird right-to-left characters.txt
Last active June 1, 2024 10:58
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@mmueller
mmueller / bitly.py
Created April 28, 2011 22:52
Command-line bit.ly URL generator (Python)
#!/usr/bin/env python
#
# Copyright 2009 Empeeric LTD. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@jordansissel
jordansissel / CEE.md
Created March 6, 2012 03:01
So, I read over most of CEE, and it is a failure.

Failure.

MITRE has this thing called "CEE" - Common Event Expression.

CEE is a failure because, while claiming to be a standards effort, it maximizes incompatibility between implementations by doing the following:

  • poorly describes multiple serialization formats, requires none of them. This ensures maximum incompatibility in event serialization
  • defines requirements for log transport protocols, but does not describe an actual protocol. This ensures maximum protocol incompatibility
  • naming style inconsistencies This ensures confusion
@datagrok
datagrok / gist:2199506
Last active April 8, 2023 17:36
Virtualenv's `bin/activate` is Doing It Wrong
@lmacken
lmacken / sshtail.py
Last active October 3, 2015 07:08
A script to tail a file across many systems at once
# sshtail.py
# A script to tail a file across many systems at once
# Author: Luke Macken <lmacken@redhat.com>
# License: GPLv3+
import getpass
import subprocess
servers = ['app1', 'app2', 'app3', 'app4', 'app5', 'app6', 'app7']
logfile = '/var/log/httpd/access_log'
@Jud
Jud / Price-Time Matching Engine.c
Created June 1, 2012 23:56
Price-Time Matching Engine
/*****************************************************************************
* QuantCup 1: Price-Time Matching Engine
*
* Submitted by: voyager
*
* Design Overview:
* In this implementation, the limit order book is represented using
* a flat linear array (pricePoints), indexed by the numeric price value.
* Each entry in this array corresponds to a specific price point and holds
* an instance of struct pricePoint. This data structure maintains a list
@jordansissel
jordansissel / RESULTS.md
Created September 21, 2012 07:41
screenshot + code showing how to query logstash/elasticsearch with a graphite function.

logstash queries graphed with graphite.

Operation: Decouple whisper from graphite.

Method: Create a graphite function that does a date histogram facet query against elasticsearch for a given query string for the time period viewed in the current graph.

Reason: graphite has some awesome math functions. Wouldn't it be cool if we could use those on logstash results?

The screenshot below is using logstash to watch the twitter stream of keywords "iphone" "apple" and "samsung" - then I graph them each, so we get an idea of popularity. As a bonus, I also do a movingAverage() on the iphone curve to show you why this is awesome.

@ssokolow
ssokolow / .coveragerc
Created May 1, 2013 16:17
Boilerplate for making a coverage.io run on a Travis-CI Python project which cleanly skips py25, doesn't crash under pypy, and ignores nose, Python stdlib, and backported modules like unittest2 and ordereddict.
[run]
omit =
*/python?.?/*
*/lib-python/?.?/*.py
*/lib_pypy/_*.py
*/site-packages/ordereddict.py
*/site-packages/nose/*
*/unittest2/*
@lmacken
lmacken / fedmsg-sessions.py
Last active December 17, 2015 08:09
Count the number of current and maximum fedmsg zeromq connections
# A script to count the number of current and maximum fedmsg zeromq connections
# Author: Luke Macken <lmacken@redhat.com>
# License: GPLv3
import requests
from multiprocessing.pool import ThreadPool
from BeautifulSoup import BeautifulSoup
num_proxies = 8
@zzzeek
zzzeek / gist:6143700
Last active December 20, 2015 14:08
# script: https://github.com/zzzeek/sqlalchemy/blob/master/test/perf/orm2010.py
# cpython 2.7 with no C extensions
classics-MacBook-Pro:sqlalchemy classic$ export PYTHONPATH=lib/
classics-MacBook-Pro:sqlalchemy classic$ python test/perf/orm2010.py
0 - Added 1000 boss objects
3 - Added 100000 grunt objects
29 - Associated grunts w/ bosses and committed
29 - Heavy query run #1
37 - Heavy query run #2