Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# https://github.com/mpv-player/mpv/issues/351
# set this option in config:
# title=mpv351: ${filename}
# requirements:
# https://github.com/baskerville/xtitle
# https://github.com/ierton/xkb-switch
@whoizit
whoizit / keycodes
Last active March 29, 2019 00:11
sway #2999 workaround
# sway workaround
# https://github.com/swaywm/sway/issues/2999
# https://github.com/swaywm/sway/issues/3988
# .config/sway/keycodes
# include ~/.config/sway/keycodes
# switch bindsym to bindcode like that
# from: bindsym $mod+Shift+c reload
# to: bindcode $mod+$C reload
#!/usr/bin/env python3.7
# requirements:
# python3.7
# pip3.7 install shell-scripting
# fping
#
# instruction:
# git clone https://github.com/yggdrasil-network/public-peers
# cd public-peers
# path/to/yggdrasil-ping-public-peers <region> | sort -rn
@whoizit
whoizit / tiling-weather.py
Last active August 14, 2019 15:26
18°(18°) broken clouds, 4m/s, 63%, {}, 756mmHg
#!/usr/bin/env python3
# pip install --user -U python-dotenv pyowm meteocalc
# get API key in https://openweathermap.org
# create file .env
# OWM_API_KEY=1a1a1a1a1a1a1a1a1
# OWM_PLACE='Saint Petersburg,RU'
# https://github.com/theskumar/python-dotenv
# https://github.com/csparpa/pyowm
# https://github.com/malexer/meteocalc
@whoizit
whoizit / gist:5b37a986204946a95b07fb90343736dc
Last active September 4, 2019 17:17
kiss minimal install
### Partitioning
fdisk /dev/sda
(o) New DOS table
(n) All free space, Linux filesystem
(w) write and exit
mkfs.ext4 /dev/sda1
mount /dev/sda1 /mnt
# getkiss.org not available in Russia, so I make short urls for github links
#!/usr/bin/env python3
# pip install -U python-dotenv requests
# https://developer.accuweather.com/accuweather-current-conditions-api/apis/get/currentconditions/v1/%7BlocationKey%7D
import os
import operator
import functools
import requests
import dotenv
#!/usr/bin/env python3
# http://who.int/gpsc/5may/Guide_to_Local_Production.pdf
from sys import argv, exit
if len(argv) == 1:
print(
'''\
{} bottle_volume want_alcohol% have_alcohol% have_peroxide% have_glycerol%
Example: {} 250 60 99.7 3 86\
[tool.poetry]
name = "test-poetry1"
version = "0.1.0"
description = ""
authors = ["whoizit <whoami@systemli.org>"]
[tool.poetry.dependencies]
python = "^3.8"
django = "^3.0.6"
@whoizit
whoizit / encryptedNixos.md
Last active December 7, 2020 06:44 — forked from ladinu/encryptedNixos.md
NixOS install with encrypted /boot /root with single password unlock

Requirements

  1. Encrypt everthing including /boot and /root
  2. Enter password once

Installation media setup

Download unstable NixOS graphical live iso (cause vim on graphical live iso and easier to read this guide in browser) and write to USB stick.

lsblk
umount /dev/sdX1
dd if=path/to/nixos-graphical-unstable-x86_64-linux.iso of=/dev/sdX bs=10M oflag=direct status=progress
@whoizit
whoizit / yt2text
Created July 10, 2021 06:12
get text from youtube video
#!/usr/bin/env python3
from youtube_transcript_api import YouTubeTranscriptApi as ytta
from youtube_transcript_api.formatters import TextFormatter as tf
import sys
yt_id = (
sys.argv[1]
.removeprefix('https://www.youtube.com/watch?v=')
.removeprefix('https://youtu.be/')
)