Skip to content

Instantly share code, notes, and snippets.

Avatar

Marcin Zepp Nircek

View GitHub Profile
@Nircek
Nircek / task-roulette.py
Last active Mar 6, 2022
Dynamic task roulette
View task-roulette.py
#!/usr/bin/env python3
import random
import shutil
import math
N = 100
bag, weights = [], []
W = shutil.get_terminal_size((80, 20))[0]
class BreakException(Exception):
View dd-system.sh
#!/bin/bash
function confirm() {
# https://stackoverflow.com/a/1885534/6732111
read -p "Is it ok? " -n 1 -r
echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1 # handle exits from shell or function but don't exit interactive shell
fi
}
@Nircek
Nircek / split.py
Last active Dec 24, 2021
split audio files not evenly
View split.py
#!/usr/bin/env python3
# Copyright 2021 Marcin Zepp <nircek-2103@protonmail.com>
# SPDX-License-Identifier: MIT
import sys
import subprocess
import re
import math
opus, oldmagic, quiet, magic = False, False, True, True
View gist:af01cf27e06dc8a110f77a3977938db4
SuperBackup -- wyizolowany.zip/New Text Document.txt:$zip2$*0*3*0*9d8b65bd625853b3cdd279cdba545f97*3546*3e8*6834b1c27b44ddde6d3dbff7c736cfb0b6fe4c5fca6fe5238ff214b7e15c81d313375404950301a0f355cb86177ce40579fb38fd5e28291e8c1a50ddb31c8a37d13353d25b0e17728c58d730fea55d4f2f7cba3acc2e439c88f7924193e19d4b2455e2ef8bc171e28c2eb259a2f9b583c439e449af1b3a514ac0b9e93e522afb5ac2430128ce94f28eadb4e54e1b74d44d1cc8da47e57f615a0b9b2ccf061805bcc54c40a1b8b79a0b2b38896c972ff619c2a76d2ee785bb7555da6ab3b9b1ab089591e86b7c6f0ca693a1b7e549d388a63242576606bd5271e065f966e84a371b1a7c9d6b0e007affa668900196f4b39c24f0932ca551b6fb5de07e625d90a1ad930d4cb49844e0f918d497ae9dc8db4b2b9d02abf1ba7a36400efd499590b85a5d8f16def72f0d1c4b49953df839dfa6587f5559ee7a862d53759932fe4006f480fa0540ff06192a38ffe083cb585a3c2f86f56eb66958b460055eb1a86f46700d4bf5e3ff89002922345a75f14e2859799d8746b7d5378c9a9be7c10c74ca78153162275a3c0dd0b31bc95bba36670360f86aee075bc0b9a630faad4bef64c88f397ffbbe3fb92c041df20156aef44b0179768fa7e6adec3cd575e144f604f7715a163f15d766eeb2
@Nircek
Nircek / dancing-deno.svg
Created Jul 18, 2021
Dancing dinosaurs
View dancing-deno.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View arch-cheat.sh
# install base system
ln -s /usr/share/zoneinfo/Europe/Warsaw /etc/localtime
hwclock --systohc
pacman -S nano
nano /etc/locale.gen
# en_US.UTF-8 UTF-8
# pl_PL.UTF-8 UTF-8
locale-gen
localectl set-locale LANG=pl_PL.UTF-8 # nano /etc/locale.conf
localectl set-locale LANGUAGE=pl_PL
@Nircek
Nircek / 1result.txt
Last active Jun 20, 2021
OI difficulty
View 1result.txt
100:
1. 8-ant
2. 8-map
3. 6-gra
95:
4. 12-ska
5. 13-kra
6. 17-gil
7. 24-pod
View sprawozdanie.md
View kcuzad.tex
\documentclass[a4paper,12pt]{article}
% https://szkopul.edu.pl/problemset/problem/dI31cAE23BiVtoZUoRMMe6ug/site/?key=statement
\usepackage[T1]{fontenc}
\usepackage[polish]{babel}
\usepackage[utf8]{inputenc}
\selectlanguage{polish}
\usepackage{lastpage}
\usepackage{fancyhdr}
\usepackage[margin=2cm,headheight=50pt,includehead,includefoot]{geometry}
@Nircek
Nircek / nginx.conf
Last active Oct 19, 2021
nginx config
View nginx.conf
# https://gist.github.com/Nircek/a77d26456bc1c43c8d9f467963b0d53f
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
# multi_accept on;
}
http {