Skip to content

Instantly share code, notes, and snippets.

View tchellomello's full-sized avatar

Marcelo Mello tchellomello

View GitHub Profile
# ansible-playbook -i deploy-vm.yml -e vm_name=test
---
- name: Deploy VM on Libvirt
hosts: localhost
vars:
qemu_connection: "qemu:///system"
vm_domain: tatu.lab
vm_memory: 1024
vm_network: default
@tchellomello
tchellomello / troubleshooting
Created July 15, 2021 19:46
Issues to start Minikube on Fedora 34 using Btrfs + LUKS
https://github.com/kubernetes/minikube/issues/7923#issuecomment-701921931
# check the logs to identify which device is missing
[mdemello@x1 awx]$ minikube logs | grep 'stat failed on /d'
Jul 15 19:39:58 minikube kubelet[18138]: W0715 19:39:58.825712 18138 fs.go:588] stat failed on /dev/mapper/luks-de09a217-bae0-45b0-8210-40b6023ee125 with error: no such file or directory
! unable to fetch logs for: describe nodes
Jul 15 19:39:59 minikube kubelet[18479]: W0715 19:39:59.631737 18479 fs.go:214] stat failed on /dev/mapper/luks-de09a217-bae0-45b0-8210-40b6023ee125 with error: no such file or directory
# in another terminal, create a symlink
@tchellomello
tchellomello / awx-operator.yml
Last active June 11, 2021 05:04
awx-operator testing using custom-ca
# This file is generated by Ansible. Changes will be lost.
# Update templates under ansible/templates/
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: awxs.awx.ansible.com
spec:
group: awx.ansible.com
names:
@tchellomello
tchellomello / inventory.py
Last active November 20, 2020 17:22
VMware Inventory to allow sourced port variables (Ansible Tower 3.7.3)
# Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
# Python
import datetime
import time
import json
import logging
import re
import copy
@tchellomello
tchellomello / Dockerfile
Last active July 27, 2020 21:57
ookla-speedtest on k8s
FROM centos:8
LABEL MAINTAINER Tchello Mello <tchello.mello@gmail.com>
# install main packages:
RUN yum -y update && \
yum -y install wget python38 && \
wget https://bintray.com/ookla/rhel/rpm -O /etc/yum.repos.d/bintray-ookla-rhel.repo && \
yum -y install speedtest && \
yum clean all
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;

Keybase proof

I hereby claim:

  • I am tchellomello on github.
  • I am tchellomello (https://keybase.io/tchellomello) on keybase.
  • I have a public key whose fingerprint is 80EB 7351 E74D 2928 80F2 5B9E A252 99D7 632F DE44

To claim this, I am signing this object:

@tchellomello
tchellomello / pgsql_queries.sql
Created February 26, 2018 19:17
PostgreSQL queries
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
### Keybase proof
I hereby claim:
* I am tchellomello on github.
* I am tchellomello (https://keybase.io/tchellomello) on keybase.
* I have a public key ASBbVk33aSGv5wr20jQjY8tvd4rWLTKAw5_nU_EhtAuxjQo
To claim this, I am signing this object:
@tchellomello
tchellomello / ring.py
Created November 7, 2017 05:01
camera ring.py
"""
This component provides support to the Ring Door Bell camera.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/camera.ring/
"""
import asyncio
import logging
from datetime import datetime, timedelta