Even with ssl.verify off, berks install
or berks vendor
will fail when supermarket is using a self-signed certificate. So, how do we get around that?
Note: I hacked my /etc/hosts to resolve supermarket-0.c.cheffian-supermarket.internal
bash -c ' | |
<%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%> | |
exists() { | |
if command -v $1 &>/dev/null | |
then | |
return 0 | |
else | |
return 1 | |
fi |
Dir.glob(File.join(File.dirname(__FILE__), "cookbooks", "*")).each do |cb| | |
cookbook File.basename(cb), :path => cb | |
end |
"""A little script to recover deleted recording of a mongoDB db file | |
There's no optimization but it work and has saved me | |
""" | |
import struct | |
import bson | |
import sys | |
# pip install logentries-lecli | |
# then configure as per https://blog.logentries.com/2016/07/introduction-to-the-logentries-command-line-interface/ | |
# logsets with logs in them | |
lecli get logs | jq -r '.logs[].logsets_info[].id' | sort -u > have_logs | |
# all logset ids | |
lecli get logsets | jq -r '.logsets[] | .id' | sort > logsets | |
for ls in $(comm logsets have_logs | grep -v "$(printf '\t')") |
(defn response | |
([status body] | |
{:status status | |
:headers {} | |
:body body})) | |
(defmacro http-status [code sym] | |
`(def ~sym (partial response ~code))) | |
(defmacro http-statuses [& pairs] |
# Postfix stuff based on https://gist.github.com/jbrownsc/4694374: | |
QUEUEID (?:[A-F0-9]+|NOQUEUE) | |
EMAILADDRESSPART [a-zA-Z0-9_.+-=:]+ | |
EMAILADDRESS %{EMAILADDRESSPART:local}@%{EMAILADDRESSPART:remote} | |
RELAY (?:%{HOSTNAME:relayhost}(?:\[%{IP:relayip}\](?::[0-9]+(.[0-9]+)?)?)?) | |
POSREAL [0-9]+(.[0-9]+)? | |
DELAYS (%{POSREAL}[/]*)+ | |
DSN %{NONNEGINT}.%{NONNEGINT}.%{NONNEGINT} | |
STATUS sent|deferred|bounced|expired |
#!/bin/bash | |
# Configs overwritable via environment variables | |
VSYSTEM=${VSYSTEM:=qemu} # Either 'qemu' or 'kvm' | |
FLAVOUR=${FLAVOUR:=debian} # Either 'debian' or 'ubuntu' | |
INCLUDES=${INCLUDES:="less,vim,sudo,openssh-server,acpid"} | |
MIRROR=${MIRROR:="http://ftp.hu.debian.org/debian"} | |
#MIRROR=${MIRROR:="http://localhost:3142/debian"} | |
#MIRROR=${MIRROR:="http://hu.archive.ubuntu.com/ubuntu/"} | |
#MIRROR=${MIRROR:="http://localhost:3142/ubuntu"} |
This script can be used to feed collectd with cpu and memory usage statistics for running docker containers using the collectd exec
plugin.
This script will report the used and cached memory as well as the user and system cpu usage by inspecting the appropriate cgroup stat file for each running container.
This script is intented to be executed by collectd on a host with running docker containers. To use, simply configure the exec
plugin in collectd to execute the collectd-docker.sh
script. You may need to adjust the script to match your particulars, such as the mount location for cgroup.