Skip to content

Instantly share code, notes, and snippets.

@Pk13055
Pk13055 / SCREENSAVER.md
Created August 3, 2026 09:07
guide to set up mac os like screensaver on locking linux workstations to prevent display from going to sleep

Video Screensaver (XScreenSaver + mpv)

Turn a folder of videos into a lock-shortcut screensaver on Linux (X11): Super+L plays a shuffled, looping playlist (GPU-decoded), dims brightness to 50% with a short fade, and requires a password only after a 5-minute grace period. On unblank, brightness fades back to the pre-lock level.

Designed for an ultrawide 32:9 display (e.g. 5120×1440) with crop-to-fill, NVIDIA GPU decode via mpv --hwdec=auto-safe, and optional integration with a custom brightness CLI.

What persists across restarts?

Piece Persists? Where
@Pk13055
Pk13055 / nginx-tuning.md
Created March 23, 2018 17:33 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

##
## tinyproxy.conf -- tinyproxy daemon configuration file
##
## This example tinyproxy.conf file contains example settings
## with explanations in comments. For decriptions of all
## parameters, see the tinproxy.conf(5) manual page.
##
#
# User/Group: This allows you to set the user and group that will be
import os
import signal
import subprocess
import sys
# Parse command-line arguments.
if len(sys.argv) > 1:
folder = os.path.abspath(sys.argv[1])
else:
folder = os.path.abspath(os.getcwd())
@Pk13055
Pk13055 / index.org
Created September 8, 2020 18:07
Defining a parser and syntax checker

ARITHMETIC Language

The Assignment is about implementing the ARITHMETIC Language

In this assignment you will be implementing an interpreter for the ARITHMETIC Language, a language of arithmetic expressions.

The language consists of the following:

@Pk13055
Pk13055 / college_configs.py
Created August 10, 2020 16:40
Pass config file(s) and load default vals in `argparse`
#!/usr/bin/env python3
# coding: utf-8
"""
:author: pk13055
:brief: wrapper script for pars initiation
"""
import argparse
import configparser
from multiprocessing import set_start_method
import sys
import requests
import json
import alpaca_trade_api
tickers_list = []
with open('tickers.txt', 'r+') as tickers_file:
tickers_list = tickers_file.read().splitlines()
tenquant_key = 'FAKE_KEY'
@Pk13055
Pk13055 / boost.pc
Created June 3, 2019 09:27
Boost `pkg-config` file for default installation
# Package Information for pkg-config
# Path to where Boost is installed
prefix=/usr/local
# Path to where libraries are
libdir=${prefix}/lib
# Path to where include files are
includedir=${prefix}/include/boost
Name: Boost
@Pk13055
Pk13055 / Dockerfile
Created May 30, 2019 12:17
Ubuntu 16.04 docker with cuda-9.1, cudnn7, dlib, openCV, boost, ffmpeg
FROM nvidia/cuda:9.1-cudnn7-runtime-ubuntu16.04
MAINTAINER <hidden>
# env vars to be loaded at build
ARG http_proxy
ARG https_proxy
ARG no_proxy
ENV http_proxy=$http_proxy
ENV https_proxy=$https_proxy
@Pk13055
Pk13055 / JSON.py
Created April 8, 2019 11:24
Create a json based object with setting and getting using Python dicts
class Tupperware(dict):
MARKER = object()
def __init__(self, value=None):
if value is None:
pass
elif isinstance(value, dict):
for key in value:
self.__setitem__(key, value[key])
else: