Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
# -*- coding: utf-8 -*-
import csv
import math
gifts = [
("Sweets", 1),
("Stickers", 2),
("Card Game", 4),
("Jigsaw", 8),
("DVD", 16),
{% if pillar.get('primary_disk_uuid') %}
mount_root:
mount.mounted:
- name: /
- device: UUID={{pillar['primary_disk_uuid']}}
- fstype: ext4
- mount: False
- persist: True
- opts:
- noatime
@asyncmind0
asyncmind0 / yz_index_reload.erl
Last active February 26, 2019 09:18
command to cause yokozuna to write solr index schema to disk and reload
#!/usr/bin/env escript
%% -*- erlang -*-
%%! -pa /usr/lib/riak/lib/yokozuna-2.1.10-226-0-ga14d400/:/usr/lib/riak/lib/riak_core-2.1.9-225-0-g1d65cf70/ebin/:/usr/lib/riak/lib/clique-0.3.10-0-gbaed0a0/ -Wall -setcookie riak -name checker@127.0.0.1
-mode(compile).
-behavior(clique_handler).
-include_lib("/usr/lib/riak/lib/yokozuna-2.1.10-226-0-ga14d400/include/yokozuna.hrl").
-export([
register_cli/0,
reload_indexes/1
%% Riak Enterprise MDC replication hook sample
-module(riak_replication_hook).
-export([register/0]).
-export([recv/1, send/2, send_realtime/2]).
register() ->
riak_core:wait_for_service(riak_repl),
lager:log(info, self(),
"Automatically registering ~p hook with riak_core",
@asyncmind0
asyncmind0 / stdin
Created November 4, 2019 09:02
stdin
realtime_enabled: "bison-riak-blue"
realtime_started: []
fullsync_enabled: "bison-riak-blue"
fullsync_running: "bison-riak-blue"
proxy_get_enabled: []
server_bytes_sent: 186498255
server_bytes_recv: 0
server_connects: 0
server_connect_errors: 0
server_fullsyncs: 0
console.log.0:2019-11-04 02:27:08.365 [info] <0.1923.861>@riak_repl_fullsync_helper:handle_call:186 Partition 114179815416476790484662877555959610910619729920: 45896896 remote / 0 local: 45896896 missing, 0 differences.
console.log.0:2019-11-04 04:27:47.016 [info] <0.21406.888>@riak_repl_fullsync_helper:handle_call:186 Partition 913438523331814323877303020447676887284957839360: 42613820 remote / 0 local: 42613820 missing, 0 differences.
console.log.2:2019-11-03 17:29:38.519 [info] <0.10854.798>@riak_repl_fullsync_helper:handle_call:186 Partition 0: 36748227 remote / 0 local: 36748227 missing, 0 differences.
console.log.2:2019-11-03 17:35:32.676 [info] <0.10054.798>@riak_repl_fullsync_helper:handle_call:186 Partition 1141798154164767904846628775559596109106197299200: 43038598 remote / 0 local: 43038598 missing, 0 differences.
console.log.4:2019-11-03 06:23:07.246 [info] <0.9824.718>@riak_repl_fullsync_helper:handle_call:186 Partition 570899077082383952423314387779798054553098649600: 45828563 remote / 0 local:
2019-11-04 04:03:36.516 [info] <0.32185.3051>@riak_repl_keylist_client:wait_ack:278 Full-sync with site "bison-riak"; differences exchanged for 1438665674247607560106752257205091097473808596992 (done
in 32206.41 secs)
2019-11-04 04:03:36.516 [info] <0.32185.3051>@riak_repl_keylist_client:wait_ack:281 Full-sync with site "bison-riak"; full-sync for partition 1438665674247607560106752257205091097473808596992 complete
(done in 37961.95 secs)
2019-11-04 04:03:36.516 [info] <0.32185.3051>@riak_repl_keylist_client:request_partition:121 Full-sync with site "bison-riak" completed
2019-11-04 04:03:49.070 [info] <0.444.0>@riak_kv_entropy_manager:maybe_exchange:986 Attempt to start exchange between {1153216135706415583895095063315192070197259272192,3} and 116463411724806326294356
1351070788031288321245184 resulted in ok
2019-11-04 04:03:54.383 [info] <0.25756.3045>@riak_repl2_fssink:handle_info:140 Connection for site "bison-riak" closed
2019-11-04 04:03:54.430 [info] <0.20908.3334>@riak_core_service_conn:try_ssl:183 "
@asyncmind0
asyncmind0 / stdin
Last active November 4, 2019 10:00
stdin
%% Riak Enterprise MDC replication hook sample
%% refs
%% - https://medium.com/finally-functional/rocking-riak-with-hooks-and-datatypes-a28609aa02e2
-module(riak_replication_hook).
-export([register/0]).
-export([recv/1, send/2, send_realtime/2]).
register() ->
riak_core:wait_for_service(riak_repl),
@asyncmind0
asyncmind0 / stdin
Created November 4, 2019 10:03
stdin
realtime_enabled: []
realtime_started: []
fullsync_enabled: []
fullsync_running: []
proxy_get_enabled: []
server_bytes_sent: 0
server_bytes_recv: 0
server_connects: 0
server_connect_errors: 0
server_fullsyncs: 0
@asyncmind0
asyncmind0 / chatgpt.el
Last active August 28, 2023 00:03
emacs functions to use openapi chatgpt api on the selected text
; fix the in the invocation of chatgpt-handle-response
(require 'url)
(require 'json)
(require 'cl)
(require 'password-store)
(defvar chatgpt-api-key
(if (not (executable-find "pass"))
"NOTSET"