Skip to content

Instantly share code, notes, and snippets.

View crisidev's full-sized avatar
🦀

Matteo Bigoi crisidev

🦀
View GitHub Profile
RUST_BACKTRACE=full /home/bigo/.cargo/bin/xidlehook --not-when-fullscreen --socket /home/bigo/.xidlehook.sock --timer 290 "/home/bigo/.bin/i3exit notify-lock" "" --timer 10 "/home/bigo/.bin/i3exit lock" "" --timer 290 "/home/bigo/.bin/i3exit notify-suspend" "" --timer 10 "/home/bigo/.bin/i3exit suspend-auto" ""
thread 'main' panicked at 'timer error: the timer is shutdown, must be called from the context of Tokio runtime', /home/bigo/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.21/src/time/delay.rs:96:23
stack backtrace:
0: 0x56172dc235c5 - backtrace::backtrace::libunwind::trace::h508d2c55eb856ef2
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
1: 0x56172dc235c5 - backtrace::backtrace::trace_unsynchronized::h31c9d8a0097b92f8
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
2: 0x56172dc235c5 - std::sys_common::backtrace::_pr
@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
<!-- 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 / access.lua
Created May 14, 2018 14:47 — forked from mariocesar/access.lua
Nginx Lua script redis based for Basic user authentication
function password_encode(password)
local bcrypt = require 'bcrypt'
return bcrypt.digest(password, 12)
end
function check_password(password, encoded_password)
local bcrypt = require 'bcrypt'
return bcrypt.verify(password, encoded_password)
end
@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 = {
@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: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