Skip to content

Instantly share code, notes, and snippets.

@avleen
avleen / gist:63e670295fd6942a401bdcf6bdd345c4
Last active October 6, 2016 23:12
Multi-protocol caching package management proxy
A multi-threaded process which listens on port 80 for connections from yum, apt, npm, gem, etc.
It recognises the kind of request made (yum, apt, npm, gem) automatically and responds accordingly.
If a requested package is available locally, it is served.
If not, it is fetched from a configured list of upstream servers, cached and served.
On a regular basis, the process retreives a package list (eg, Repodata.xml) from its upstream servers,
and merges it with a list of local packages.
Users provide mappings for where to point for each repo (eg: cent 7, cent 7 updates, npm, etc). Eg:
@Millnert
Millnert / nfs_lock_stack_trace
Last active February 28, 2017 13:18
Stack trace and source code references from a RHEL 7.1 NFS lock bug
Apr 18 21:01:26 tsm1 kernel: [<ffffffffa07045a0>] ? nfs_pageio_doio+0x50/0x50 [nfs] http://lxr.free-electrons.com/source/fs/nfs/pagelist.c?v=3.10#L394
Apr 18 21:01:26 tsm1 kernel: [<ffffffff8160954d>] io_schedule+0x9d/0x130 http://lxr.free-electrons.com/source/kernel/sched/core.c?v=3.10#L4512
Apr 18 21:01:26 tsm1 kernel: [<ffffffffa07045ae>] nfs_wait_bit_uninterruptible+0xe/0x20 [nfs] http://lxr.free-electrons.com/source/fs/nfs/pagelist.c?v=3.10#L261
Apr 18 21:01:26 tsm1 kernel: [<ffffffff81607320>] __wait_on_bit+0x60/0x90 http://lxr.free-electrons.com/source/kernel/sched/wait.c#L387
Apr 18 21:01:26 tsm1 kernel: [<ffffffffa07045a0>] ? nfs_pageio_doio+0x50/0x50 [nfs] http://lxr.free-electrons.com/source/fs/nfs/pagelist.c?v=3.10#L394
Apr 18 21:01:26 tsm1 kernel: [<ffffffff816073d7>] out_of_line_wait_on_bit+0x87/0xb0 http://lxr.free-electrons.com/source/kernel/wait.c?v=3.10#L209
Apr 18 21:01:26 tsm1 kernel: [<ffffffff81098260>] ? autoremove_wake_function+0x40/0x40 http://lxr.free-electrons.com/source/ker
@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.