Skip to content

Instantly share code, notes, and snippets.

View gist:8f4852b9e352468c7c0f747b11444c66
The full traceback is:
File "/tmp/ansible_NvoXyJ/ansible_modlib.zip/ansible/module_utils/basic.py", line 2744, in run_command
cmd = subprocess.Popen(args, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
[WARNING]: As of Ansible 2.4, the parameter 'executable' is no longer
supported with the 'command' module. Not using '/bin/bash'.
View gist:c6d782a9acab64de999fe72363b5b33a
strace -f -p 890
strace: Process 890 attached
futex(0x557420eb0508, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, NULL, ffffffff) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
futex(0x557420eb0508, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, NULL, ffffffff <unfinished ...>
+++ killed by SIGKILL +++
View state-getchildcontext.cljs
(defn foo-root [component]
(fn [data _owner]
(reify
om/IRender
(render [_]
(let [ctor (js/React.createFactory
(js/React.createClass
#js
{
:getDisplayName (fn [] "muiroot-context")
@areina
areina / org-protocol-elfeed.md
Last active Aug 29, 2015
Snippets for subscribe feeds with elfeed (emacs) from conkeror
View org-protocol-elfeed.md

In your emacs files:

(defun org-protocol-elfeed (data)
  (let ((url (org-protocol-sanitize-uri data)))
    (elfeed-add-feed url)
    (customize-save-variable 'elfeed-feeds elfeed-feeds)))

(add-to-list 'org-protocol-protocol-alist
             '("Subscribe to feed with elfeed."
View influxdb-sum-float
[~]$ curl http://foo:8086/db/bar/series\?u\=root\&p\=root\&q\=select%20sum\(value\)%20from%20service_31189720689_metric_79198034909.1m%20where%20time%20%3E%20%272010-09-01%2000%3A00%3A00.000%27%20AND%20time%20%3C%20%272010-09-30%2023%3A59%3A59.000%27
[{"name":"service_31189720689_metric_79198034909.1m","columns":["time","sum"],"points":[[0,1.020721e+06]]}]%
[~]$ curl http://foo:8086/db/bar/series\?u\=root\&p\=root\&q\=select%20value%20from%20service_31189720689_metric_79198034909.1m%20where%20time%20%3E%20%272010-09-01%2000%3A00%3A00.000%27%20AND%20time%20%3C%20%272010-09-30%2023%3A59%3A59.000%27
[{"name":"service_31189720689_metric_79198034909.1m","columns":["time","sequence_number","value"],"points":[[1283299200000,72026860001,1020721]]}]%
View hub-pull-request.el
(defun t-pull-request()
(interactive)
(async-shell-command "hub pull-request")
(with-current-buffer "*Async Shell Command*"
(add-hook 'comint-output-filter-functions
'(lambda (txt)
(if (string-match-p "https" txt)
(browse-url txt)))
nil t)))
@areina
areina / apitools_github_oauth.lua
Created Apr 23, 2014
Apitools middleware to provide a callback endpoint for github oauth
View apitools_github_oauth.lua
return function(request, next_middleware)
local CLIENT_ID = "foo"
local CLIENT_SECRET = "bar"
local APP_URL = "http://localhost:9000/#overview"
if request.uri == '/callback' then
local session_code = request.args["code"]
local url = "https://github.com/login/oauth/access_token"
local request_body = {
client_id = CLIENT_ID,
View battleschool-error
$ battle --ask-sudo-pass --config-file=https://db.tt/aG2uyydU
## Downloading config from url ###################################################################################
Fatal Task: localhost => Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py", line 530, in _executor
exec_rc = self._executor_internal(host, new_stdin)
File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py", line 621, in _executor_internal
return self._executor_internal_inner(host, self.module_name, self.module_args, inject, port, complex_args=complex_args)
File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py", line 878, in _executor_internal_inner
self.callbacks.on_failed(host, data, ignore_errors)
@areina
areina / bm-rescue-vs-check-ips.rb
Last active Aug 29, 2015
Benchmark about rescue exceptions
View bm-rescue-vs-check-ips.rb
require 'benchmark/ips'
Benchmark.ips do |bm|
path = "/tmp/unknown_file.unknown_ext"
bm.report("using rescue") do
begin
File.read(path)
rescue
"file doesn't exist"
@areina
areina / custom-mu4e-trash-folder.el
Created Oct 30, 2013
mu4e - Dynamic trash folder for multiple accounts
View custom-mu4e-trash-folder.el
(defun custom-mu4e-trash-folder (msg)
(if msg
(cond
((string-match "foo@gmail.com" (mu4e-message-field msg :maildir))
"/foo0@gmail.com/[Gmail].Trash")
((string-match "foo@3scale.net" (mu4e-message-field msg :maildir))
"/foo@3scale.net/[Gmail].Trash"))
(mu4e-ask-maildir-check-exists "Save message to maildir: ")))
(setq mu4e-trash-folder 'custom-mu4e-trash-folder)