Skip to content

Instantly share code, notes, and snippets.

View alirzaev's full-sized avatar

Ali Rzaev alirzaev

View GitHub Profile
@alirzaev
alirzaev / WebClientFileSizeLimit4GiB.reg
Created January 27, 2022 14:22
Set the file size for WebDAV to 4GiB
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters]
"FileSizeLimitInBytes"=dword:ffffffff
from gimpfu import *
def improve_grayscale(img):
ly2 = img.active_layer.copy()
img.add_layer(ly2)
pdb.plug_in_gauss_rle(img, ly2, 100, 1, 1)
ly2.mode = DIVIDE_MODE
img.flatten()
pdb.gimp_convert_grayscale(img)
@alirzaev
alirzaev / fix-r8169.service
Created February 21, 2019 15:23
Fix RTL-8169 Driver on resume from suspend
[Unit]
Description=Fix RTL-8169 Driver on resume from suspend
After=suspend.target
[Service]
User=root
Type=oneshot
ExecStartPre=/sbin/modprobe -r r8169
ExecStart=/sbin/modprobe r8169
TimeoutSec=0
@alirzaev
alirzaev / asynctask.py
Created January 15, 2019 15:49
AsyncTask
class AsyncTask(QRunnable):
class _Signals(QObject):
result = pyqtSignal(tuple)
@staticmethod
def _callback(args: Tuple[Callable[[Any], None], Any]):
fun, arg = args
fun(arg)
def __init__(self):
@alirzaev
alirzaev / hanoi.cpp
Created January 15, 2019 15:48
The Hanoi Tower Sort Algorithm
#include <algorithm>
#include <cassert>
#include <climits>
#include <cstdio>
#include <deque>
typedef std::deque<int> stack;
void move_top1(stack& from, stack& to, stack& spare);
int top(const stack& o)