Skip to content

Instantly share code, notes, and snippets.

@jdevries3133
jdevries3133 / alacritty-tmux-vim_truecolor.md
Created July 26, 2023 01:18 — forked from andersevenrud/alacritty-tmux-vim_truecolor.md
True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

This should make True Color (24-bit) and italics work in your tmux session and vim/neovim when using Alacritty (and should be compatible with any other terminal emulator, including Kitty).

Testing colors

Running this script should look the same in tmux as without.

curl -s https://gist.githubusercontent.com/lifepillar/09a44b8cf0f9397465614e622979107f/raw/24-bit-color.sh >24-bit-color.sh
@jdevries3133
jdevries3133 / difference.diff
Last active April 3, 2022 00:43
re:Cannot modify ingress for arbitrary TCP services per microk8s docs
diff --git a/mailu/tmp.yml b/mailu/tmp.yml
index dd56e40..540eed2 100644
--- a/mailu/tmp.yml
+++ b/mailu/tmp.yml
@@ -81,6 +81,9 @@ spec:
- containerPort: 10254
hostPort: 10254
protocol: TCP
+ - containerPort: 25
+ hostPort: 25
def shortest_containing(s, c):
"""Given a string `s` and collection of characters `c`, return the shortest
substring of `s` characters containing all of the characters in `c`"""
# str.find returns -1 if there is not a match
NO_MATCH = -1
# `current` is the set of indices under consideration now. It is initialized
# to the indicies of the first occurance of each item in `c` within `s`.
current = set(s.find(char) for char in c)
@jdevries3133
jdevries3133 / dump.txt
Created August 18, 2021 14:47
Hexdump of original example from jvoisin
00000000: 1f8b 0800 5328 ee5d 0003 edd3 410e 8230 ....S(.]....A..0
00000010: 1005 d0ae 3945 4f80 9de9 94c2 82bd 4baf ....9EO.......K.
00000020: d004 626a 8290 520c de5e 94a0 8925 e80e ..bj..R..^...%..
00000030: 620c 7d9b 26ed 2c7e 33f9 07d3 ef4b 5394 b.}.&.,~3....KS.
00000040: 6ee7 cbd6 c7be f76c 7142 8884 8833 fdc0 n......lqB...3..
00000050: 192a ad50 f2fb fd48 0107 a9b4 2424 310c .*.P...H....$$1.
00000060: 0ad0 2088 f17e f928 735d eb8d 1ba2 9c2e .. ..~.(s]......
00000070: b56d edf9 eb5c e36c 65dc f5e8 eaae f9f4 .m...\.le.......
00000080: 3efe 843f cf3f 01c4 3b5b e409 82a6 3442 >..?.?..;[....4B
00000090: 8d2b 6fab 3287 6145 699a 6612 e32c 4395 .+o.2.aEi.f..,C.

There is a ton of (very poorly written and jarbled) code in here, but this is a a summary of what I have tried to try to reproduce the corrupt file that jvoisin originally posted on the bpo. I've had no luck, so any ideas about what to do next are much appreciated.

What I have Tried

corruption techniques

  • remove first few bytes, which I thought would affect
import traceback
import random
import tarfile
from pathlib import Path
def bad_byte_order_mark(p):
"""Chop off the byte order mark from the file."""
with open(p, 'rb') as f:
f.seek(5)
@jdevries3133
jdevries3133 / Mystery Int.py
Created March 1, 2021 01:54
Help for /u/Ok-Design-3218 (reddit)
mystery_int_1 = 3
mystery_int_2 = 4
mystery_int_3 = 5
#You may modify the lines of code above, but don't move them!
#When you Submit your code, we'll change these lines to
#assign different values to the variables.
#Above are three values. Run a while loop until all three
#values are less than or equal to 0. Every time you change