Skip to content

Instantly share code, notes, and snippets.

Дисклеймер: проверено на свежем ArchLinux с systemd-networkd. Скрипт достаточно наивен и работа на иных конфигурация может быть под вопросом. Отлаживать через ip rule, ip route show table 10032590.

[опционально] Определите ваш MTU для маршрута к Valve

$ curl https://gist.githubusercontent.com/PtaxLaine/2d4115a3c4004884a36d7f6f07bda666/raw/mtu_probe.sh | bash

Установка

@PtaxLaine
PtaxLaine / semantic-commit-messages.md
Last active January 12, 2024 01:16 — forked from joshbuchea/semantic-commit-messages.md
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@PtaxLaine
PtaxLaine / checker.sh
Last active March 21, 2023 15:51
check pacman repository integrity
#!/usr/bin/bash
set -e
find . -name "*.db" -print0 | xargs -0 -n1 sh -c "/usr/bin/pacman-check.py $1 \$0 || exit 255"
@PtaxLaine
PtaxLaine / freeotp_backup.md
Created June 22, 2020 10:46 — forked from kontez/freeotp_backup.md
A guide to back up and recover 2FA tokens from FreeOTP (Android)

Backing up and recovering 2FA tokens from FreeOTP

Backing up FreeOTP

Using adb, create a backup of the app using the following command:

adb backup -f freeotp-backup.ab -apk org.fedorahosted.freeotp
@PtaxLaine
PtaxLaine / humanize.py
Created April 20, 2019 08:30
python_utils
def humanize(bytes):
bytes = int(bytes)
if bytes >= 1024 * 1024 * 1024:
return '{:.2f} GiB'.format(bytes / 1024 / 1024 / 1024)
elif bytes >= 1024 * 1024:
return '{:.2f} MiB'.format(bytes / 1024 / 1024)
elif bytes >= 1024:
return '{:.2f} KiB'.format(bytes / 1024)
else:
return '{:.2f} B'.format(bytes)
@PtaxLaine
PtaxLaine / main.js
Last active April 17, 2019 16:54
search blocklist
// ==UserScript==
// @name SEARCH Blocklist
// @version 0.1
// @match https://duckduckgo.com/?*
// @match https://www.google.com/search?*
// @match https://google.com/search?*
// @match https://www.google.ru/search?*
// @match https://google.ru/search?*
// @grant none
// ==/UserScript==
[Engine.PlayerInput]
Bindings=(Name="PageUp",Command="fov 100")
Bindings=(Name="PageDown",Command="fov 71")
MoveForwardSpeed=1200
MoveStrafeSpeed=1200
LookRightScale=300
LookUpScale=-250
MouseSensitivity=60.0
DoubleClickTime=0.250000
bEnableMouseSmoothing=true
@PtaxLaine
PtaxLaine / pre-commit
Last active October 7, 2018 03:54 — forked from zofrex/pre-commit
A git pre-commit hook to make sure your Rust code is properly formatted and the tests pass, so you never commit bad code
#!/bin/bash
check_char='\xE2\x9C\x93'
cross_char='\xE2\x9D\x8C'
green='\033[0;32m'
red='\033[0;31m'
nc='\033[0m'
check="$green$check_char$nc"
cross="$red$cross_char$nc"
errors=0
#!/usr/bin/env python
#===============================================================================
# title :NowPlaying.py
# description :This script will create a NowPlaying.txt file that contains
# the info for the song that is currently being played via VLC
# author :Tipher88
# contributors :AbyssHunted, Etuldan
# date :20161711
# version :1.6.0
# usage :python NowPlaying.py