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
#!/usr/bin/env bash | |
STATE='ON' | |
if [[ $1 == 'off' ]]; then | |
STATE='OFF' | |
fi | |
STR_1='<?xml version="1.0" encoding="UTF8"?><SMARTPLUG id="edimax"><CMD id="setup"><Device.System.Power.State>' | |
STR_2='</Device.System.Power.State></CMD></SMARTPLUG>' |
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
#!/usr/bin/env sh | |
pacman -Rs $(pacman -Qtdq) |
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
#!/usr/bin/env bash | |
set -x | |
killall -9 jackdbus | |
qjackctl & | |
sleep 2 | |
while true; | |
do |
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
# This file must be used with ". bin/activate.fish" *from fish* (http://fishshell.org) | |
# you cannot run it directly | |
# --- $PYTHONEXECUTABLE SETTING: See https://stackoverflow.com/a/53190037/1067833 --- | |
function deactivate -d "Exit virtualenv and return to normal shell environment" | |
# reset old environment variables | |
if test -n "$_OLD_VIRTUAL_PATH" | |
set -gx PATH $_OLD_VIRTUAL_PATH | |
set -e _OLD_VIRTUAL_PATH |
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
#!/usr/bin/env python3.7 | |
from argparse import ArgumentParser | |
from hashlib import sha256 | |
from http.client import HTTPResponse | |
from io import BytesIO | |
from json import loads | |
from pathlib import Path | |
from subprocess import check_output | |
from sys import exit |
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
proxy_cache_path /var/cache/pkgmirror/ max_size=10G inactive=1y manager_sleep=10m keys_zone=pkgirror_meta_zone:10m; | |
server { | |
listen *:80; | |
listen [::]:80; | |
server_name pkgmirror._yourdomain_; | |
autoindex on; | |
access_log /var/log/nginx/pkgmirror._yourdomain_-access.log combined2 buffer=32k flush=5m; | |
error_log /var/log/nginx/pkgmirror_yourdomain_-error.log info; |
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
#!/usr/bin/env bash | |
mariabackup --stream=xbstream --backup --user root|pigz >mariadb-backup.gz |
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
# ---- | |
# | |
# uwsgi log https://gist.github.com/karolyi/3032020b4d62c6fd0b9148db1a242548 | |
colorscheme:uwsgi:https://uwsgi-docs.readthedocs.io/en/latest/ | |
# HTTP method highlighting | |
cs_re_s:cyan:\{[0-9]+ vars in [0-9]+ bytes\} \[.*\] (GET) | |
cs_re_s:magenta:\{[0-9]+ vars in [0-9]+ bytes\} \[.*\] (POST|PUT|DELETE|OPTIONS) | |
# Response time highlighting: >500: yellow, >750ms: magenta-bold, >1000ms: red-bold | |
cs_re_val_bigger:red,,bold:1000:generated [0-9]+ bytes in ([0-9]+) msecs | |
cs_re_val_bigger:magenta,,bold:750:generated [0-9]+ bytes in ([0-9]+) msecs |
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
from django.db.models import CharField | |
from django.db.models.functions import Length | |
CharField.register_lookup(Length, 'length') | |
result = MyModel.objects.filter(text__length__gt=10) |
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
# -*- coding: utf-8 -*- | |
# Generated by Django 1.11.6 on 2017-10-19 13:31 | |
from __future__ import unicode_literals | |
from django.conf import settings | |
from django.db import connection, migrations, models | |
from django.db.migrations import RunPython | |
PROJECT_NAMESPACE = settings.PROJECT_NAMESPACE |
NewerOlder