View webdav-nginx.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define lua functions | |
init_by_lua_block { | |
function is_dir(path) | |
local f = io.open(path, "r") | |
if not f then | |
return false | |
end | |
local ok, err, code = f:read(1) | |
f:close() | |
return code == 21 |
View yggdrasil
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: yggdrasil | |
# Required-Start: $local_fs | |
# Required-Stop: | |
# Should-Start: $network $portmap | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: | |
# Short-Description: Overlay network |
View dropbear
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: dropbear | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Lightweight SSH server | |
# Description: Init script for drobpear SSH server. Edit | |
# /etc/default/dropbear to configure the server. |
View antix_f2fs.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -ne 1 ] || ! [ -b $1 ]; then | |
echo Usage: | |
echo $(basename $0) boot_part | |
exit 1 | |
fi | |
if [ $(whoami) != root ]; then | |
echo you are not root |
View code-block.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { LitElement, html, css, property, customElement } from "lit-element"; | |
import { unsafeHTML } from "lit-html/directives/unsafe-html"; | |
import * as hljs from "highlight.js"; | |
@customElement("code-block") | |
export class CodeBlock extends LitElement { | |
@property() lang = ""; | |
private contentUpdateObserver?: MutationObserver = undefined; | |
static get styles() { |
View rpc_client_with_futures.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Based on synchronous implementation of the aiozmq.rpc.RPCClient | |
https://gist.github.com/derfenix/f18e4a8f0ee9bad738c2b22106a3ad4d | |
""" | |
import functools | |
import logging | |
import os | |
import random | |
import struct | |
import sys |
View clutter_animation_test.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import gi | |
gi.require_version('Clutter', '1.0') | |
gi.require_version('Gtk', '3.0') | |
gi.require_version('GtkClutter', '1.0') | |
from gi.repository import Clutter # isort:skip | |
from gi.repository import Gtk # isort:skip |
View arraybuffer.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import enum | |
import logging | |
import unittest | |
import numpy as np | |
class Side(enum.IntEnum): | |
NONE = 0 | |
LEFT = 1 |
View ssh proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
создаем пользователя pxy | |
adduser pxy | |
закрываем ему доступ к locahost, eth0 заменить на интерфейс смотрящий в интернет | |
iptables -A OUTPUT -m owner --uid pxy -p tcp -o lo --dport 53 -j ACCEPT # allow dns | |
iptables -A OUTPUT -m owner --uid pxy -o !eth0 -j DROP # deny localhost | |
ip6tables -A OUTPUT -m owner --uid pxy -p tcp -o lo --dport 53 -j ACCEPT # allow dns | |
ip6tables -A OUTPUT -m owner --uid pxy -o !eth0 -j DROP # deny localhost | |
генерируем ssh ключи, добавляем публичный ключь в ~pxy/.ssh/authorized_keys вставив перед ним: |
View controller.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TKViewController(CementBaseController): | |
class Meta: | |
label = "tkview" | |
stacked_on = 'base' | |
stacked_type = 'nested' | |
arguments = [ | |
(['dataset'], | |
dict(help='dataset to show', | |
action='store', metavar='DATASET', nargs='?') |
NewerOlder