Skip to content

Instantly share code, notes, and snippets.

@lnksz
lnksz / add-user-docker.md
Last active June 27, 2024 08:26
Add host user alter ego in tmp docker container

E.g. in a docker container which is mapped into host via volumes, but has root user only Start tmp container with linked in current folder

id
docker run -it --rm -v "$PWD":"$PWD" -w "$PWD" ubuntu /bin/bash

In container add user with the id which is present on host as well, e.g. builder:builder with 1001:1001 if uid is defined, the user-group GID will be the same

@lnksz
lnksz / update-sched-task.bat
Last active November 27, 2023 09:22
Windows 10/11 unattended updates
echo %date% %time% Updating >> C:\SOMEPATH\unattended-updates\log.txt
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "C:\SOMEPATH\unattended-updates\upmyms.ps1" 1>>C:\SOMEPATH\unattended-updates\log.txt 2>&1
echo %date% %time% DONE >> C:\SOMEPATH\unattended-updates\log.txt
@lnksz
lnksz / hk
Created February 6, 2023 06:04
Havasi custom keyboard layout
default partial alphanumeric_keys modifier_keys
xkb_symbols "basic" {
include "us(intl)"
name[Group1]= "Havasi (US)";
// From altgr-intl
key <TLDE> { [ grave, asciitilde, dead_grave, dead_tilde ] };
key <AC11> { [apostrophe,quotedbl, dead_acute, dead_diaeresis ] };
@lnksz
lnksz / rebase-from-to.md
Last active May 12, 2022 13:36
Update a modified LTS kernel branch to a newer tag in linux-A.B.y

Illustrated git commands

Go to branch which we want to rebase

$ git checkout patched-v5.4.y

Where are we at?

$ git describe
v5.4.175-44-g5deadbeef
@lnksz
lnksz / roundmail.py
Created October 21, 2021 04:38
round-mail
#!/bin/env python
# -*- encoding: utf-8 -*-
# Send out "personalised" text mails to a list of people,
# without Cc hacks and without sharing the addresses.
# Uses a gmail account, with "less secure apps" enabled.
# Awaits own address in environment var "U" and password in environment var "P"
# $ U=me@gmail.com P=secret ./thisscript.py
# Note: leading space in the terminal should exlude the command from history
import smtplib, ssl
@lnksz
lnksz / todo.vim
Created October 20, 2021 14:28
mini vim syntax for todos
" This goes into ~/.vim/syntax/todo.vim
" Auto registration: $MYVIMRC << au BufRead,BufNewFile TODO set filetype=todo
if exists("b:current_syntax")
finish
endif
" # Header
syn match headLine '\v#.*$'
" > doing
@lnksz
lnksz / korigyo.py
Created June 25, 2021 22:07
cli snake start
import readchar
import time
from os import system, name
def clearscreen():
# for windows
if name == 'nt':
_ = system('cls')
# for mac and linux(here, os.name is 'posix')
else:
@lnksz
lnksz / jira-server-hide-done-in-epic.js
Last active April 2, 2021 10:21
Hide "done" tickets in an epic. (Jira server only)
var rs = document.getElementsByClassName("issuerow");
for (let i = 0; i < rs.length; i++)
if (rs[i].firstElementChild.firstElementChild)
rs[i].hidden = true;
@lnksz
lnksz / hun-key-4level.md
Last active November 26, 2020 21:02
Type out 4 levels of hungarian standard keyboard
  1. printed keys
  2. Shift
  3. AltGr
  4. Shift+AltGr
0123456789öüó
§'"+!%/=()ÖÜÓ
¬~ˇ^˘°˛`˙´˝¨¸
¬~ˇ^˘°˛`˙´˝¨¸
{
"folders":
[
],
"rulers":
[
79,
100
],
"tab_size": 4,