Skip to content

Instantly share code, notes, and snippets.

import random
import timeit
from collections import defaultdict
random.seed(1)
def bucketsort(order, seq):
buckets = [0] * (max(seq) + 1)
for x in seq:
# Default config for sway
#
# Copy this to ~/.config/sway/config and edit it to your liking.
#
# Read `man 5 sway` for a complete reference.
### Variables
#
# Logo key. Use Mod1 for Alt.
set $mod Mod4
import base64
import textwrap
import lzma
import sys
from collections import defaultdict
import elftools.elf.constants
import elftools.elf.elffile
import elftools.elf.sections
import elftools.elf.relocation
#!/home/mukundan/Documents/misc/tmenu/.venv/bin/python
import base64
import curses
import curses.ascii
import fcntl
import itertools
import os
import struct
import subprocess
import datetime
import json
import logging
import sched
import time
import urllib.parse
import humanize
import requests
@Mukundan314
Mukundan314 / custom-test.py
Created June 25, 2020 12:02
Tool to do custom tests on codeforces form cli
import argparse
import getpass
import pathlib
import sys
import time
import lxml.html
import requests
LANG_TO_ID = {
7760271406486818269530232833213886664232322405923376103150619226903215930614069531943489553238330332385800231950890047033440942119828335089534461575588743649189679666551254647725845465104616027482769081922732732396247083767521718123833193071062059470897781028461513719299898681118688416927278569657347426759698333740863013275725181399039295240867535897511016330381995952286224898977476794934777588622737237462556750901162963406793824520542616769323712193802126066318528132663283452332581822161262798206752262793825532048353317745360788194195100129025353789079430770802223904770027123239826800547510706333124064018424941062645591356335709328739507098468251865084648997734103578487702314212070231873054292195983109500375466193591164922665755209918440066710594444899354146614740178809647842125684176862138118817367066494869393494274783880447339843717996563382163956150672906821404597658562589543801065495963894323168124620435108355068741788022153704876207355787873171237620360350015436680204756119712795879795153546119920216229
// Code used to find the proof
#include <algorithm>
#include <cmath>
#include <functional>
#include <iostream>
#include <map>
#include <set>
#include <vector>
import math
import scipy.misc
from manimlib.imports import *
class NewtonRaphson(GraphScene):
CONFIG = {
"func": lambda x: ((x - 2)**2) * math.sin(2 * x) / 3 + 10,
"initial_guess": 5,
"num_iters": 7,

Creating a systemd service

Format of systemd service files

service files for systemd are writtern in a format similar to toml and ini

Sections in the service file

  • [Unit] and [Install] - carries generic information about the unit that is not dependent on the type of unit
  • [Service] - carries information about the process the service files executes