Skip to content

Instantly share code, notes, and snippets.

View WorldException's full-sized avatar
🏠
Working from home

Evgeny Stoyanov WorldException

🏠
Working from home
  • Russia, Rostov-on-Don
View GitHub Profile
@WorldException
WorldException / settings.json
Created December 5, 2022 08:27
vscode omniSharp settings
{
"omnisharp.enableAsyncCompletion": false,
"omnisharp.enableImportCompletion": true,
"omnisharp.enableRoslynAnalyzers": false,
"omnisharp.organizeImportsOnFormat": false,
"omnisharp.enableMsBuildLoadProjectsOnDemand": false,
"omnisharp.analyzeOpenDocumentsOnly": false,
"omnisharp.autoStart": true,
"omnisharp.useModernNet": true,
"omnisharp.projectLoadTimeout": 600,
@WorldException
WorldException / make_user.sh
Created February 10, 2022 12:41
sftp only home directory without login
#!/bin/bash
groupadd ftponly
useradd -s /bin/false uploader
usermod -aG ftponly uploader
passwd uploader
chown root:root /home/uploader
chmod 755 /home/uploader
systemctl restart sshd
@WorldException
WorldException / snapcraft.yaml
Created February 6, 2022 08:54
hydrogen-music snap
name: hydrogen
version: "1.1.1"
description: |
Hydrogen is a software synthesizer which can be used alone,
emulating a drum machine based on patterns, or via an external
MIDI keyboard/sequencer software. Hydrogen runs on Linux, Mac OS X and Windows.
summary: "Hydrogen is a software synthesizer"
base: core18
architectures:
- build-on: [amd64]
@WorldException
WorldException / gist:c7283f7546fb54ec7df5c7708bfc47c8
Created September 30, 2021 05:52
SelectFieldDynamic use function for choices
class SelectFieldDynamic(SelectField):
# use function in choices
def __init__(self, label=None, validators=None, coerce=str, choices=None, validate_choice=True, **kwargs):
super(SelectFieldDynamic, self).__init__(label, validators, **kwargs)
self.coerce = coerce
self.choices = choices
self.validate_choice = validate_choice
def iter_choices(self):
@WorldException
WorldException / docker-compose.yml
Created August 5, 2021 07:22
postgres for 1C docker
version: "2"
services:
db:
restart: always
#image: quickes/pg1c:12.6_6
image: quickes/pg1c:12.7_1
shm_size: 4G
stop_grace_period: 1m
stop_signal: SIGINT
oom_score_adj: -1000
@WorldException
WorldException / init-zram-swapping
Created July 1, 2021 10:43
Ubuntu zram-config change default size of memory
#!/bin/sh
# /usr/bin/init-zram-swapping
# load dependency modules
NRDEVICES=$(grep -c ^processor /proc/cpuinfo | sed 's/^0$/1/')
if modinfo zram | grep -q ' zram_num_devices:' 2>/dev/null; then
MODPROBE_ARGS="zram_num_devices=${NRDEVICES}"
elif modinfo zram | grep -q ' num_devices:' 2>/dev/null; then
MODPROBE_ARGS="num_devices=${NRDEVICES}"
else
@WorldException
WorldException / Logging - SQLite handler
Created June 1, 2017 11:12 — forked from giumas/Logging - SQLite handler
A minimal SQLite handler for the python logging module
from __future__ import absolute_import, division, print_function, unicode_literals
import sqlite3
import logging
import time
__version__ = "0.1.0"
initial_sql = """CREATE TABLE IF NOT EXISTS log(
#coding:utf8
from __future__ import unicode_literals
from celery import current_app, task
from functools import wraps
import logging
import simplejson
import time
mylog = logging.getLogger(__name__)
@WorldException
WorldException / menu.sh
Created March 29, 2017 09:46 — forked from dimkalinux/menu.sh
User menu file for Midnight Commander
shell_patterns=0
+ ! t t
@ Do something on the current file
CMD=%{Enter command}
$CMD %f
+ t t
@ Do something on the tagged files
set %t; CMD=%{Enter command}
while [ -n "$1" ]; do
@WorldException
WorldException / gist:fdbd699365b5ea98109c
Created February 24, 2016 09:08 — forked from overplumbum/gist:4473076
OpenVPN server as an LXC container
#!/bin/bash
set -ve
lxc-create -n vpn -t ubuntu
# ln -s /var/lib/lxc/vpn/config /etc/lxc/auto/vpn.conf
perl -i -ple 's/#lxc.aa_profile = unconfined/lxc.aa_profile = unconfined/' /etc/lxc/auto/vpn.conf
perl -i -ple 's/^exit 0/# exit 0/' /etc/rc.local
cat >>/etc/rc.local <<hello
mkdir -p /var/lib/lxc/vpn/rootfs/dev/net/