Skip to content

Instantly share code, notes, and snippets.

View daevaorn's full-sized avatar

Alexander Koshelev daevaorn

View GitHub Profile
@iwalton3
iwalton3 / jellyfin_extract_sub.py
Created March 27, 2021 04:15
Jellyfin Extract Subtitles
#!/usr/bin/env python3
# Based on https://github.com/EraYaN/jellyfin-stats
# pip3 install requests tqdm
URL = ""
API_KEY = ""
from re import sub
import requests
from tqdm import tqdm
@AdamNaj
AdamNaj / about.md
Last active July 13, 2022 19:50
Z Wave Graph for Home Assistant
@kekru
kekru / 1-Enable Docker Remote API with TLS client verification.md
Last active June 14, 2024 09:01
Docker Remote API with client verification via daemon.json

Enable Docker Remote API with TLS client verification

Docker's Remote API can be secured via TLS and client certificate verification.
First of all you need a few certificates and keys:

  • CA certificate
  • Server certificate
  • Server key
  • Client certificate
  • Client key

Create certificate files

@stefanfoulis
stefanfoulis / docker_for_mac_disk_default_size.md
Last active June 29, 2023 12:02
How to resize Docker for Mac Disk image and set the default size for new images

Set the default size for new Docker for Mac disk images

UPDATE: The instructions here are no longer necessary! Resizing the disk image is now possible right from the UI since Docker for Mac Version 17.12.0-ce-mac49 (21995).

If you are getting the error: No space left on device

Configuring the qcow2 size cap is possible in the current versions:

# my disk is currently 64GiB
@123Daoxyz
123Daoxyz / client part
Created April 8, 2014 16:57
udp server based on tornado
#!/usr/bin/env python
# encoding: utf-8
import time
import socket
from tornado.iostream import IOStream
from tornado.ioloop import IOLoop
from tornado import stack_context
import functools
import collections
@marcelom
marcelom / pysyslog.py
Created December 5, 2012 18:06
Tiny Python Syslog Server
#!/usr/bin/env python
## Tiny Syslog Server in Python.
##
## This is a tiny syslog server that is able to receive UDP based syslog
## entries on a specified port and save them to a file.
## That's it... it does nothing else...
## There are a few configuration parameters.
LOG_FILE = 'youlogfile.log'
@jxson
jxson / README.md
Created February 10, 2012 00:18
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation

@kmike
kmike / asserts.py
Created September 10, 2010 12:24
assertNumQueries decorator and context manager
import functools
import sys
import re
from django.conf import settings
from django.db import connection
def shrink_select(sql):
return re.sub("^SELECT(.+)FROM", "SELECT .. FROM", sql)
def shrink_update(sql):
@shvechikov
shvechikov / super_custom_chunkify.py
Created September 2, 2010 21:17
Super Chunkify
# -*- coding: utf-8 -*-
"""
На работе как-то раз появилась довольно стандартная задача:
написать генаратор, который отдаёт элементы из некого итератора пачками
по n элементов.
Дополнительное условие:
Не возвращать пустой список на последней итерации (возникает, когда
общее количество элементов кратно размеру пачки).
В общем, как-то её в тот раз решили, хоть и не слишком красиво.
@karmi
karmi / whats-wrong-with-ruby-libraries-for-couchdb.markdown
Created August 1, 2010 19:17
What's wrong with Ruby libraries for CouchDB?

What's wrong with Ruby libraries for CouchDB?

During the last year, I have worked on couple of Ruby/Rails based projects where the primary datastore was CouchDB. CouchDB, to me, is a dream database for web developer come true. The simplicity, the HTTP-based API, the abandonment of SQL semantics, the inspiring community, that all reminds me of when I came into Rails years ago.

However, working with Couch in Ruby and Rails is very, very painful, in my opinion. I'd like to briefly summarize some of my frustrations here. Maybe they are shared, maybe not -- if they are, I think we should launch some coordinate effort to make using Couch in Ruby a pleasure and intelectual satisfaction, not endless loops of research and hacks to „make it work“.

Please note, that my interest is solely to stir the debate. I may be severely mistaken in any point. But, I'd like using Couch in a Ruby application to be a joy, not a frustration, which is what I've met more times than I'd ha