Skip to content

Instantly share code, notes, and snippets.

@theanalyst
theanalyst / source.hy
Last active August 29, 2015 13:58
Getting source of a function in hy.. WIP
(import re
linecache
inspect
[hy.lex.lexer [lexer]]
[itertools [count]])
(defmacro getstartlines [f]
"Gets the starting lines for a given function"
(if-python2 `(. ~f func-code co-firstlineno)
@theanalyst
theanalyst / Dockerfile
Created October 14, 2014 12:57
ceph make check dockerfile
FROM ubuntu:14.04
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y \
autoconf \
automake \
autotools-dev \
ccache \
libbz2-dev \
@theanalyst
theanalyst / vagrant-failure.log
Last active August 29, 2015 14:14
vagrant failure
Bringing machine 'default' up with 'kvm' provider...
==> default: Importing base box 'precise64'...
==> default: Assigning a new mac address to the VM.
==> default: Preparing network interfaces based on configuration...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 192.168.123.99:22
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Host unreachable. Retrying...
(defun send-region-as-email (start end)
"A hacky function to send a region as mail
Assumes the region follows the below format
To: <recepient>
Subject: <subject>
<mail body>"
(interactive (if (use-region-p)
(list (region-beginning) (region-end))
(list nil nil)))
(let* ((selection (buffer-substring-no-properties start end))
@theanalyst
theanalyst / giant-release-notes.txt
Created April 21, 2015 11:23
giant-release-notes
* allow -L to disable lttng. Enable it by default (Alfredo Deza)
* mon: MDSMonitor: wait for osdmon to be writable when requesting proposal (#9794 Joao Eduardo Luis)
* mon: MDSMonitor: have management_command() returning int instead of bool (Joao Eduardo Luis)
* osd: Get pgid ancestor from last_map when building past intervals (#10430 David Zafman)
* Objecter: failed assert(tick_event==NULL) at osdc/Objecter.cc (#11183 Zhiqiang Wang)
* ceph-objectstore-tool: Output only unsupported features when incomatible (#11176 David Zafman)
* rgw: Swift API. Support for X-Remove-Container-Meta-{key} header. (#10475 Dmytro Iurchenko)
* librados: Translate operation flags from C APIs (Matthew Richards)
* Objecter: check the 'initialized' atomic_t safely (#9617 Josh Durgin)
* Objecter: init with a constant of the correct type (Josh Durgin)
* allow -L to disable lttng. Enable it by default (#11303 Alfredo Deza)
* mon: MDSMonitor: wait for osdmon to be writable when requesting proposal (#9794 Joao Eduardo Luis)
* osd: Get pgid ancestor from last_map when building past intervals (#10430 David Zafman)
* Objecter: failed assert(tick_event==NULL) at osdc/Objecter.cc (#11183 Zhiqiang Wang)
* ceph-objectstore-tool: Output only unsupported features when incompatible (#11176 David Zafman)
* rgw: Swift API. Support for X-Remove-Container-Meta-{key} header. (#10475 Dmytro Iurchenko)
* librados: Translate operation flags from C APIs (#10497 Matthew Richards)
* Objecter: check the 'initialized' atomic_t safely (#9617 Josh Durgin)
* Objecter: init with a constant of the correct type (#9617 Josh Durgin)
* CrushWrapper: pick a ruleset same as rule_id (#9675 Xiaoxi Chen)
@theanalyst
theanalyst / make_release_notes.py
Last active August 29, 2015 14:19
release notes helper
#!/usr/bin/env python
# Originally borrowed from A. Israel's https://gist.github.com/aisrael/b2b78d9dfdd176a232b9
from __future__ import print_function
import re
import github
from git import Repo
gh = github.GitHub(
@theanalyst
theanalyst / The Repo Less Forked.md
Last active October 13, 2015 23:08
The Repo Less Forked

The Repo Less Forked

An attempt at a parody on git and Github, a non-sensical fork of the Road Less Taken by Robert Frost, fork with care and a tribute to Git and GitHub

Two forks diverged in an open repo,
And sorry I could not commit both
And be one follower, long I stood
And watched one as far as I could
To where it diverged in the fork;

Then forked the other, as just as fair,

@theanalyst
theanalyst / remove-nonprint-ascii.el
Last active December 11, 2015 20:48
Removes non printable (possibly control characters) in files
(defun remove-non-print-ascii()
"Remove non printable ascii characters from buffer"
(interactive)
(save-match-data
(save-excursion
(goto-char (point-min))
(while (re-search-forward "[^ -~\n]" (point-max) t)
(replace-match "" nil nil))
(message "Removed non-printable ascii chars"))))