Skip to content

Instantly share code, notes, and snippets.

Bruno Meneguello bkmeneguello

Block or report user

Report or block bkmeneguello

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View curl-stat.sh
echo <<EOT > curl-format.txt
time_namelookup: %{time_namelookup}\n
time_connect: %{time_connect}\n
time_appconnect: %{time_appconnect}\n
time_pretransfer: %{time_pretransfer}\n
time_redirect: %{time_redirect}\n
time_starttransfer: %{time_starttransfer}\n
----------\n
time_total: %{time_total}\n
EOT
View k8s-dashboard-token.sh
kubectl -n kube-system describe secrets \
`kubectl -n kube-system get secrets | awk '/clusterrole-aggregation-controller/ {print $1}'` \
| awk '/token:/ {print $2}'
@bkmeneguello
bkmeneguello / createLocalhostCert.sh
Created Apr 23, 2019
Generate a "localhost" valid certificate
View createLocalhostCert.sh
openssl req -x509 -out localhost.crt -keyout localhost.key \
-newkey rsa:2048 -nodes -sha256 \
-subj '/CN=localhost' -extensions EXT -config <( \
printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
View gist:995913ed872a66343717cc5dd0e7dd5b
gpg --gen-key
git config --global user.signingkey <KEY>
git config --global commit.gpgsign true
View gist:6f78ea804337edd1c3d88ed2b1dc2bdc
pem2openpgp "Name Surname <email@something>" < mykey.pem | gpg --import
View gist:54a84b678e05ec706b54a6239ef2e829
# host
apt-get install apt-cacher-ng
# dockerfile
ARG APT_CACHE
RUN [ ! -z "$APT_CACHE" ] && echo "Acquire::http::Proxy \"http://$APT_CACHE\";" > /etc/apt/apt.conf.d/30proxy ||:
# docker build
docker build --build-arg APT_CACHE=$HOST_IP:3142 .
@bkmeneguello
bkmeneguello / gist:c29da541d3183c26c792d628a46ad826
Created Dec 18, 2017
Raspberry Pi Docker "cgroups: memory cgroup not supported on this system"
View gist:c29da541d3183c26c792d628a46ad826
echo -n " cgroup_memory=1 swapaccount=1" >> /boot/cmdline.txt
View gist:f624323e238280c4e0a682cc03f0ee7f
vi /etc/sudoers.d/nopasswd
%sudo ALL = (ALL) NOPASSWD: ALL
@bkmeneguello
bkmeneguello / passwordless polkit
Created Dec 6, 2017
Avoid GUI password prompt
View passwordless polkit
vi /var/lib/polkit-1/localauthority/50-local.d/disable-passwords.pkla
[Do anything you want]
Identity=unix-group:sudo
Action=*
ResultActive=yes
View dictget.py
dictget = lambda d, *k: [d[i] for i in k]
'''
usage: v1, v2, vN = dictget(<dict>, 'key1', 'key2', 'keyN')
'''
You can’t perform that action at this time.