Skip to content

Instantly share code, notes, and snippets.

@volkmax777
volkmax777 / dynamic_ip_update_on_openwrt_6in4ru.md
Last active October 20, 2025 20:59
Динамическое обновление IP WAN в сервисе 6in4.ru на OpenWRT

Ставим пакеты 6in4 и curl

opkg update
opkg install 6in4 curl

В файле /etc/config/network прописываем

@MichaelMonashev
MichaelMonashev / warn.go
Created May 18, 2020 18:33
Golang async logger
package warn
import (
"errors"
"fmt"
"io"
"log"
"os"
"path/filepath"
"runtime"
@tavinus
tavinus / nextcloud-onlyoffice.md
Last active November 2, 2023 20:27
debian 8 + nextcloud + onlyoffice + nginx + mariadb + redis + rabbitmq

debian 8 + nextcloud + onlyoffice + nginx + mariadb + redis + rabbitmq

How to run everything on a single Debian install

About

This guide was compiled from the notes and logs of two re-installs
I made on Debian 8 (Jessie) servers running Owncloud on Apache.

I have basically removed and reinstalled everything except the database
contents and the users files, while also migrating from owncloud to nextcloud.

@drewchapin
drewchapin / bash_coproc_example.sh
Last active January 3, 2024 11:13
Example of how to use the COPROC feature of Bash by showing a progress bar with zenity and updating it.
#!/bin/bash
on_exit() {
echo "#The script has quit unexpectidly on line $1" >&$z
echo "The script has quit unexpectidly on line $1" >&2
exit
}
on_error() {
echo "Error on line $1"
#!/bin/bash
# a tool to extract data from those MS Winsoze "web-archives" arrived as a ".DOC" file...
# run as ```splitmime.sh < /tmp/where-it-is.doc``` and check for "./C_/" directory.
div=''
typeset -i nl=0
typeset -i ol=0
file_header='yes'
header='no'
@ergo70
ergo70 / notify.py
Created November 13, 2016 17:54
psycopg2 asynchronous notifications w. LISTEN/NOTIFY
# -*- coding: utf-8 -*-
"""
Created on Sun Nov 13 00:00:06 2016
@author: ergo
"""
import select
import psycopg2
import psycopg2.extensions
@drmalex07
drmalex07 / README-python-service-on-systemd-activated-socket.md
Last active June 21, 2025 17:32
An example network service with systemd-activated socket in Python. #systemd #python #socket #socket-activation

README

The example below creates a TCP server listening on a stream (i.e. SOCK_STREAM) socket. A similar approach can be followed to create a UDP server on a datagram (i.e. SOCK_DGRAM) socket. See man systemd.socket for details.

An example server

Create an simple echo server at /opt/foo/serve.py.

@kgriffs
kgriffs / sample.py
Last active March 26, 2017 01:33
Falcon Web Framework (http://falconframework.org)
# sample.py
import falcon
import json
class QuoteResource:
def on_get(self, req, resp):
"""Handles GET requests"""
quote = {
'quote': 'I\'ve always been more interested in the future than in the past.',
'author': 'Grace Hopper'
@dtheodor
dtheodor / listen_sqla.py
Last active February 17, 2025 19:04
Listen for pg_notify with SQL Alchemy + Psycopg2
import select
import datetime
import psycopg2
import psycopg2.extensions
from sqlalchemy import create_engine, text
engine = create_engine("postgresql+psycopg2://vagrant@/postgres")
@typehorror
typehorror / Flask-SQLAlchemy Caching.md
Last active February 15, 2024 14:44
Flask SQLAlchemy Caching

Flask-SQLAlchemy Caching

The following gist is an extract of the article Flask-SQLAlchemy Caching. It allows automated simple cache query and invalidation of cache relations through event among other features.

Usage

retrieve one object

# pulling one User object

user = User.query.get(1)