Skip to content

Instantly share code, notes, and snippets.

View crisidev's full-sized avatar
🦀

Matteo Bigoi crisidev

🦀
View GitHub Profile

Keybase proof

I hereby claim:

  • I am crisidev on github.
  • I am crisidev (https://keybase.io/crisidev) on keybase.
  • I have a public key whose fingerprint is 099F 4F3A A10B 27C9 7B74 6F03 AEFB BD3B E8C6 6E4A

To claim this, I am signing this object:

@crisidev
crisidev / exporter.py
Created July 19, 2016 16:25
Convert text-secure server metrics into a Prometheus readable format
import sys
import time
import click
import backoff
import requests
from prometheus_client import start_http_server, Gauge
STATUS = {
'text_secure_server': {},
@crisidev
crisidev / gist:bbf31c66c14e2dd64bd7fb7540cdabfd
Created February 11, 2017 13:17
Python3 script to download all "NASA picture of the day" from 1995
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
**************************************************************************
Nasa's picture of the day since 1995, by Matteo Bigoi <bigo@crisidev.org>
Original work by Cecil Woebker (http://cwoebker.com)
**************************************************************************
Usage:
$ ./apod.py
@crisidev
crisidev / Karabiner-Elements profile switcher
Created July 7, 2017 17:58
Quick and dirty hacks to switch Karabiner-Elements profile. Depends on terminal-notifier and psutil
#!/usr/bin/env python
import os
import sys
import json
import signal
import psutil
import argparse
import subprocess
from os.path import expanduser
from collections import OrderedDict
@crisidev
crisidev / gist:6d454e577a2b6497800f8c8850d66189
Created December 7, 2017 13:04
Kubespray vault failure
### NON VERBOSE RUN ###
TASK [vault : bootstrap/gen_ca | Generate vault root CA] *****************************************************************************************************
Wednesday 06 December 2017 13:02:40 +0000 (0:00:00.541) 0:06:11.577 ****
fatal: [spirito -> spirito]: FAILED! => {"cache_control": "no-store", "changed": false, "connection": "close", "content": "{\"errors\":[\"1 error occurred:\\n\\n* Error converting input [vault.kube-system.svc.k8s.cardina.li vault.kube-system.svc vault.kube-system vault] for field alt_names: '' expected type 'string', got unconvertible type '[]interface {}'\"]}\n", "content_length": "234", "content_type": "application/json", "date": "Wed, 06 Dec 2017 13:02:40 GMT", "failed": true, "json": {"errors": ["1 error occurred:\n\n* Error converting input [vault.kube-system.svc.k8s.cardina.li vault.kube-system.svc vault.kube-system vault] for field alt_names: '' expected type 'string', got unconvertible type '[]interface {}'"]}, "msg": "Status code was not [200
@crisidev
crisidev / chunkwm-query.py
Created July 9, 2017 20:26
Quick and dirty python hack to get chunckwm information
#!/usr/bin/env python
import socket
import argparse
import subprocess
TCP_IP = '127.0.0.1'
TCP_PORT = 3920
DESKTOPS = {
<!-- please remove the issue template when request for a feature -->
## Expected behavior, english is recommend
## Environment Information
- OS: linux
- vim version: -
- neovim version: 0.4.0
- SpaceVim version: 1.1.0-dev
- SpaceVim status:
<!-- please remove the issue template when request for a feature -->
## Expected behavior, english is recommend
## Environment Information
- OS: linux
- vim version: -
- neovim version: 0.4.0
- SpaceVim version: 1.1.0-dev
- SpaceVim status:
@crisidev
crisidev / goto.py
Created May 5, 2020 14:05 — forked from georgexsh/goto.py
python goto with system trace function
import sys
def j(lineno):
frame = sys._getframe().f_back
called_from = frame
def hook(frame, event, arg):
if event == 'line' and frame == called_from:
try:
frame.f_lineno = lineno
@crisidev
crisidev / goto.py
Created May 5, 2020 14:05 — forked from georgexsh/goto.py
python goto with system trace function
import sys
def j(lineno):
frame = sys._getframe().f_back
called_from = frame
def hook(frame, event, arg):
if event == 'line' and frame == called_from:
try:
frame.f_lineno = lineno