Skip to content

Instantly share code, notes, and snippets.

{
"version": "2",
"templates": [
{
"type": 1,
"title": "Airsonic",
"name": "airsonic",
"description": "Airsonic is a free, web-based media streamer, providing ubiqutious access to your music. Use it to share your music with friends, or to listen to your own music while at work. You can stream to multiple players simultaneously, for instance to one player in your kitchen and another in your living room.",
"logo": "https://raw.githubusercontent.com/SelfhostedPro/selfhosted_templates/master/Images/airsonic-logo.png",
"image": "lscr.io/linuxserver/airsonic:latest",
@manugarri
manugarri / pyrasite-stacktrace-how-to.md
Created May 10, 2021 14:49 — forked from soxofaan/pyrasite-stacktrace-how-to.md
How to get a stack trace from a stuck/hanging python script

How to get a stack trace for each thread in a running Python script

Sometimes a Python script will simply hang forever with no indication of what is going wrong. Perhaps it's polling a service that will never return a value that allows the program to move forward.

Here's a way to see where the program is currently stuck, using pyrasite a tool for injecting code into running Python processes.

Install gdb and pyrasite

Install gdb.

{
"cells": [
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
@manugarri
manugarri / render_json.py
Created November 9, 2018 14:50
widget to display json in jupyter notebook
import uuid
from IPython.display import display_javascript, display_html, display
import json
class RenderJSON(object):
def __init__(self, json_data):
if isinstance(json_data, dict):
self.json_str = json.dumps(json_data)
else:
self.json_str = json
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@manugarri
manugarri / kafka-cheat-sheet.md
Created October 24, 2018 12:39 — forked from ursuad/kafka-cheat-sheet.md
Quick command reference for Apache Kafka

Kafka Topics

List existing topics

bin/kafka-topics.sh --zookeeper localhost:2181 --list

Describe a topic

bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic

Purge a topic

bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000

... wait a minute ...

@manugarri
manugarri / Structured_with_text.py
Created October 20, 2018 13:09 — forked from ranihorev/Structured_with_text.py
PyTorch module for classification or regression of categorical+continuous+text inputs. This module is based on fast.ai library
from fastai.text import *
from fastai.structured import proc_df
import pandas as pd
import numpy as np
class MixedInputModelWithText(nn.Module):
def __init__(self, emb_szs, n_cont, emb_drop, out_sz, szs, drops,
y_range=None, use_bn=False, is_reg=True, is_multi=False, n_text=0):
super().__init__()
for i, (c, s) in enumerate(emb_szs): assert c > 1, f"cardinality must be >=2, got emb_szs[{i}]: ({c},{s})"
@manugarri
manugarri / cookie_read_test.go
Created April 19, 2018 12:06 — forked from jonnyreeves/cookie_read_test.go
Testing Cookie Writes in Golang
diccionario_columnas = {
"belongs_to_collection": "franquicia",
"budget": "presupuesto",
"genres": "genero",
"homepage": "pagina_web",
"original_language": "lenguaje",
"popularity": "popularidad",
"poster_path": "poster",
"production_companies": "productores",
"production_countries": "pais",
@manugarri
manugarri / config
Created December 19, 2017 17:11 — forked from gerardorf/config
bastion ssh configuration. Add this config on ~/.ssh/config
Host *.gerardorf.org !bastion.gerardorf.org
User admin
IdentityFile ~/.ssh/gerardorf-private-key
ProxyCommand ssh -W %h:%p [email protected]
Host bastion.gerardorf.org
Hostname XXX.XXX.XXX.XXX
User admin
IdentityFile ~/.ssh/gerardorf-private-key
ForwardAgent yes