This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
: <<'### README ###' | |
Style 1 | |
======= | |
This is a multiline comment, created by combining two relatively | |
less known Bash features, the `:` command, and Here Documents. | |
This has the advantage of less syntactic noise per line, and the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import random | |
import requests | |
from requests.exceptions import HTTPError | |
koans = [] | |
num_same_koan_found = 0 | |
max_num_same_koan_found = 30 | |
zen_url = 'https://api.github.com/zen' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; see also: | |
;; https://gist.github.com/emres/917ffc60f4fe209a6a1bad6b3abd4fa1 | |
(defun font-is-mono-p (font-name) | |
(string-match "-mono-" font-name)) | |
(defun compare-monospace-fonts () | |
"Display a list of all monospace font faces. Tested on MS Windows 10." | |
(interactive) | |
(pop-to-buffer "*Monospace Fonts*") | |
(erase-buffer) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; See the following for more details | |
;; https://emacs.stackexchange.com/a/50215/8887 | |
;; and also see the following on a recent GNU/Linux or similar system: | |
;; /usr/share/doc/fontconfig/fontconfig-user.html | |
;; for the explanation of spacing=100 | |
;; also see the following UNIX StackExchange answer: | |
;; https://unix.stackexchange.com/a/363368/13105 | |
(defun compare-monospace-font-families () | |
"Display a list of all monospace font faces. Tested on GNU/Linux." | |
(interactive) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun font-is-mono-p (font-name) | |
(string-match "-mono-" font-name)) | |
(defun compare-monospace-fonts () | |
"Display a list of all monospace font faces. Tested on MS Windows 10." | |
(interactive) | |
(pop-to-buffer "*Monospace Fonts*") | |
(erase-buffer) | |
(dolist (font-name (x-list-fonts "*")) | |
(if (and (font-is-mono-p font-name) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copy of ActiveState recipe: Adaptive Replacement Cache in Python | |
# Original URL, last visited on 15-Jan-2019: | |
# http://code.activestate.com/recipes/576532/ | |
# | |
# For more details, please see the following: | |
# - http://u.cs.biu.ac.il/~wiseman/2os/2os/os2.pdf | |
# - https://www.usenix.org/conference/fast-03/arc-self-tuning-low-overhead-replacement-cache | |
# - https://www.usenix.org/conference/hotstorage15/workshop-program/presentation/santana | |
# - http://www.c0t0d0s0.org/archives/5329-Some-insight-into-the-read-cache-of-ZFS-or-The-ARC.html | |
# - https://blogs.oracle.com/roch/it-is-the-dawning-of-the-age-of-the-l2arc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jq '.value[] .attendees[].emailAddress.name' events.json | sort | uniq | egrep -i -v \(Belgium\|meeting\|\emre\) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jq '.value[] .attendees[].emailAddress.name' events.json | sort | uniq |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jq '.value[] .attendees[].emailAddress.name' events.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USER='admin' | |
PASS='admin' | |
CLUSTER='dev' | |
HOST=$(hostname -f):8080 | |
function start(){ | |
curl -u $USER:$PASS -i -H 'X-Requested-By: ambari' -X PUT -d \ | |
'{"RequestInfo": {"context" :"Start '"$1"' via REST"}, "Body": {"ServiceInfo": {"state": "STARTED"}}}' \ | |
http://$HOST/api/v1/clusters/$CLUSTER/services/$1 | |
} |
NewerOlder