Skip to content

Instantly share code, notes, and snippets.

View freyes's full-sized avatar
🥑

Felipe Reyes freyes

🥑
View GitHub Profile
#!/bin/bash -u
MODEL=
TIMEOUT=10s
DESTROY_MODEL_OPTS=( )
while true; do
case "$1" in
-t)
shift
#!/bin/bash -eu
#
# Author: Felipe Reyes <felipe.reyes@canonical.com>
#
# References:
# - "Kubelet api server connection check in health checker" in kubernetes/node-problem-detector
# https://github.com/kubernetes/node-problem-detector/pull/489
# - "(1.17) Kubelet won't reconnect to Apiserver after NIC failure (use of closed network connection)" in kubernetes/kubernetes
# https://github.com/kubernetes/kubernetes/issues/87615
@freyes
freyes / query-etcd.sh
Last active November 30, 2020 20:58 — forked from brettmilford/query-etcd.sh
Query etcd keys
#!/bin/bash -eux
# brettmilford: added etcd /metrics gathering
# This file is based on https://code.launchpad.net/~freyes/+git/experiment
# Modified to use xargs instead of parallel
# 'etcd.etcdctl' is provided by the etcd snap
which etcd.etcdctl
PARALLEL_REQS=20
$ python3 parse-script.py test_script.sh
------
results:
{}
------
parameters:
{}
------
parsed_yaml:
{'description': 'This is something.',
sudo virsh domblklist $MACHINE
# copy the file path to the qcow2 disk that you want to resize
sudo qemu-img resize $QCOW2_PATH +20G # this will add 20G to the disk
sudo virsh start $MACHINE
# ssh into $MACHINE
lsblk # make sure the disk size is the one you want
sudo apt -y install cloud-guest-utils
sudo growpart /dev/vda 1 # change vda is the disk, and '1' is for the partition number as listed by lsblk.
sudo resize2fs /dev/vda1 # resize the filesystem.
df -h | grep /dev/vda # validate the new size is active.
@freyes
freyes / paste-ubuntu-com.el
Last active June 12, 2020 16:30
emacs webpaste support for https://paste.ubuntu.com
(require 'request)
(require 'cl-lib)
(require 'webpaste)
(defun paste-ubuntu-field-lambda ()
"lambda for building post compatible with paste.ubuntu.com."
(cl-function (lambda (&key text
post-field
provider-uri
(post-lang-field-name nil)
(post-data '()))
for PROJECT in $(openstack project list -c Name -f value);do
echo -e "$(openstack quota show -f value -c volumes $PROJECT) \t $PROJECT"
done
#! /bin/sh
#edit by stev-o - find the MTU available for current network
# source: https://www.routertech.org/viewtopic.php?t=1720
#Usage: $0 <exthost>
#
#$0 = Me
#<exthost> = custom host used for test, different from built-in ones, needed if they go down or close: this is optional
#
#P.S.:due to a limitation of busybox "ping" command, make sure the hosts passed reject fragmented packet, otherwise the test will be compromized...
#!/bin/bash
export VAULT_ADDR="http://`juju run --unit vault/0 unit-get private-address`:8200"
VAULT_INIT="$(vault operator init -key-shares=3 -key-threshold=3)"
for KEY in $(echo $VAULT_INIT | grep "Unseal Key " | cut -d' ' -f4); do
vault operator unseal $KEY
done
sudo do-release-upgrade --mode=server --frontend=DistUpgradeViewNonInteractive