Skip to content

Instantly share code, notes, and snippets.

View webknjaz's full-sized avatar
🇺🇦
#StandWithUkraine: https://github.com/vshymanskyy/StandWithUkraine

Sviatoslav Sydorenko (Святослав Сидоренко) webknjaz

🇺🇦
#StandWithUkraine: https://github.com/vshymanskyy/StandWithUkraine
View GitHub Profile
@oguzalb
oguzalb / arrowfunc.patch
Created July 21, 2023 14:08
adding arrow functions to Python grammar
diff --git a/Grammar/Tokens b/Grammar/Tokens
index 618ae81..29bcfeb 100644
--- a/Grammar/Tokens
+++ b/Grammar/Tokens
@@ -11,6 +11,7 @@ RPAR ')'
LSQB '['
RSQB ']'
COLON ':'
+FUNC_SIGN '=>'
COMMA ','
@NeverBehave
NeverBehave / port-forwarding.py
Last active February 26, 2024 15:39 — forked from WangYihang/port-forwarding.py
Access devices with IPv6 Link-local address --- port forwarding via python socket
#!/usr/bin/env python3
# Tcp Port Forwarding (Reverse Proxy)
#
# For link-local IPv6 address, such as router emergency recovery, etc.
# Workaround for https://stackoverflow.com/questions/45299648/how-to-access-devices-with-ipv6-link-local-address-from-browserlike-ie-firefox
#
# Usage: python3 forward.py --listen-host 127.0.0.1 --listen-port 8443 --connect-host 'fe80::abcd:abcd:beef:beef%enp0s0' --connect-port 443
import socket
import threading
@stormwild
stormwild / git-partial-shallow-clone.md
Last active August 4, 2023 15:57
Git Partial and Shallow Clone

Git

Partial and Shallow Clone

Get up to speed with partial clone and shallow clone

There are many different types of clones beyond the default full clone. If you truly need to have a distributed workflow and want all of the data in your local repository, then you should continue using full clones. If you are a developer focused on a single repository and your repository is reasonably-sized, the best approach is to do a full clone.

You might switch to a blobless partial clone if your repository is very large due to many large blobs, as that clone will help you get started more quickly. The trade-off is that some commands such as git checkout or git blame will require downloading new blob data when necessary.

@phoe
phoe / forever.md
Last active February 22, 2024 23:50
Forever Stable Branch

Forever Stable Branch

Stable branch, I can see you in the stable branch
See you again, I see you again
In my dreams, in my dreams, in my dreams, in my dreams

Morning light, I remember the morning li-i-i-i-ight
Outside my door (outside my door), I'll see you no more (see you no more)
In my dreams, in my dreams, in my dreams, in my dreams
>

@webknjaz
webknjaz / wifi-6-mesh.md
Last active March 9, 2024 01:48
My research on building a well-covered high-speed network for the future new house with focus on effortless Wi-Fi client roaming with 802.11ax (tri-band WiFi 6E with 8x8 MU-MIMO capabilities), 3 APs, 802.11r, 802.11k, 802.11v, 802.11s, 802.11w and 10GB-compatible CAT6 Ethernet backchannel

💭 Thoughts

I want to have:

  • 3 APs that would approximately evenly cover:
    • ground floor
    • second floor
    • garage space
    • bonus: reach some of the backyard/garden
  • Multipath connections between the APs
  • Bonded channels between the APs and the managed network switches (LACP 1+1 = 2Gbps)
@webknjaz
webknjaz / predictable-build-constraints.md
Last active November 28, 2021 08:17
A few thoughts on enabling reproducible builds with PEP 517

Huh?

I've got an idea to fill the void of the non-existent PEP 517 build requirements provisioning. The problem is that currently there's no first-class citizen support for reproducible builds in the PEP 517 world. People usually set lower bounds on their build backend of choice and that's about it. Even if some will set exact pins in their pyproject.toml, it's not enough because those entries may contain unpinned (transitive) dependencies. One way to do this with python -m build is to set PIP_CONSTRAINTS environment variable (I haven't actually tested this yet but I expect it to work).

That workaround is suboptimal and leaves the users with no answer on how to manage the invocations and the

@Gowee
Gowee / uacme-cloudflare-hook.sh
Last active March 9, 2024 01:29
DNS-01 challenge hook script of uacme for Cloudflare
#!/bin/sh
# Copyright (C) 2020 Michel Stam <michel@reverze.net>
# Copyright (C) 2021 Hung-I Wang <whygowe@gmail.com>
#
# The script is adatped from:
# https://github.com/ndilieto/uacme/blob/5edec0eea1bcf6f454ec1787297c2408c2f2e97a/nsupdate.sh
#
# Licensed under the the GNU General Public License <http://www.gnu.org/licenses/>.
# The script is meant to be used as a hook script of uacme to update TXT records for acme challenges.

The Freenode resignation FAQ, or: "what the fuck is going on?"

IMPORTANT NOTE:

It's come to my attention that some people have been spamming issue trackers with a link to this gist. While it's a good idea to inform people of the situation in principle, please do not do this. By all means spread the word in the communities that you are a part of, after verifying that they are not aware yet, but unsolicited spam is not helpful. It will just frustrate people.

Update 3 (May 24, 2021)

A number of things have happened since the last update.

@andrebrait
andrebrait / keychron_linux.md
Last active April 25, 2024 13:24
Keychron keyboards on Linux + Bluetooth fixes

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Note: many newer Keychron keyboards use QMK as firmware and most tips here do not apply to them. Maybe the ones related to Bluetooth can be useful, but everything related to Apple's keyboard module (hid_apple) on Linux, won't work. As far as I know, all QMK-based boards use the hid_generic module instead. Examples of QMK-based boards are: Q, Q-Pro, V, K-Pro, etc.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work (NOT FOR QMK-BASED BOARDS)

Older Keychron keyboards (those not based on QMK) use the hid_apple driver on Linux, even in the Windows/Android mode, both in Bluetooth and Wired modes.

@probonopd
probonopd / Wayland.md
Last active May 3, 2024 23:46
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.

Wayland proponents make it seem like Wayland is "the successor" of Xorg, when in fact it is not. It is merely an incompatible alternative, and not even one that has (nor wants to have) feature parity (missing features). And unlike X11 (the X Window System), Wayland protocol designers actively avoid the concept of "windows" (making up incompr