Skip to content

Instantly share code, notes, and snippets.

View gtirloni's full-sized avatar

Giovanni Tirloni gtirloni

View GitHub Profile
@gtirloni
gtirloni / Dockerfile
Created April 7, 2015 00:11
Using container volumes to root the host
FROM centos:7
EXPOSE 8080
RUN yum -y install epel-release
RUN yum -y install python-cherrypy
COPY hackme.py /tmp/
CMD ["/usr/bin/python", "/tmp/hackme.py"]
@gtirloni
gtirloni / notes.txt
Created December 10, 2015 18:18
Kubernetes Notes
kubernetes-client - Kubernetes client tools
/usr/bin/kubectl
kubernetes-master - Kubernetes services for master host
/etc/kubernetes
/etc/kubernetes/apiserver
/etc/kubernetes/config (**)
/etc/kubernetes/controller-manager
@gtirloni
gtirloni / npm_cache.md
Last active July 8, 2017 14:34
Comparing local-npm and npm caching

Method

git clone https://github.com/GPII/universal
rm -rf node_modules
time npm install

npm 3.10.10

  • Run #1 - 3m3s (cold cache)
@gtirloni
gtirloni / lfs258.md
Created August 12, 2017 20:17
LFS258 Notes

etcd

List all keys

ETCDCTL_API=3 etcdctl get / --prefix --keys-only

What used to be directories in etcd v2

ETCDCTL_API=3 etcdctl get / --prefix --keys-only | awk -F/ '{ printf("%s/%s\n", $2, $3); }'| sort | uniq

@gtirloni
gtirloni / mirror.sh
Created July 18, 2018 18:15
CentOS/Fedora mirror
#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o xtrace
LOCKFILE="${PWD}/$(basename "$0").lock"
LOCKFD=99
_lock() { flock -"$1" "$LOCKFD"; }
@gtirloni
gtirloni / ghactions-roadmap.txt
Last active July 28, 2020 16:53
GH Actions - Interesting work in progress
https://github.com/github/roadmap/issues/51
https://github.com/github/roadmap/issues/52
https://github.com/github/roadmap/issues/59
https://github.com/github/roadmap/issues/75
https://github.com/github/roadmap/issues/78
https://github.com/github/roadmap/issues/88
https://github.com/github/roadmap/issues/96
https://github.com/github/roadmap/issues/98
https://github.com/github/roadmap/issues/99
@gtirloni
gtirloni / wsl-dropbox.md
Last active August 27, 2024 02:44
Windows WSL2 and Dropbox

This was only tested on Fedora 35 with systemd but should work on any WSL distribution that uses systemd.

Install the Dropbox headless client:

$ cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -

Install the Dropbox manager script into your ~/bin folder:

@gtirloni
gtirloni / wsl-luks.md
Created May 2, 2022 12:44
Windows WSL2 and LUKS

If you have a LUKS-encrypted partition on another disk, it's easy to mount it inside WSL.

List your disks:

> wmic diskdrive list brief

Mount the whole disk inside WSL (using --bare so WSL doesn't attempt to mount it automatically):

@gtirloni
gtirloni / ansible_version.md
Last active July 28, 2022 00:01
ansible_version.py

ansible_version.py

This is a plugin that verifies if the Ansible version meets the version requirements.

You can use the same range identifiers from Ansible Galaxy, separate by commas:

*: The most recent version. This is the default.
!=: Not equal to the version specified.
==: Exactly the version specified.
@gtirloni
gtirloni / known_hosts.yml
Created January 9, 2023 18:05
known_hosts.yml
- hosts: all
gather_facts: false
become: false
tasks:
- name: Populate ~/.ssh/known_hosts
delegate_to: localhost
known_hosts:
key: "{{ lookup('pipe', 'ssh-keyscan ' + inventory_hostname + ' 2>/dev/null') }}"
name: "{{ inventory_hostname }}"