Skip to content

Instantly share code, notes, and snippets.

@mpkopec
mpkopec / fold-children.vim
Created January 20, 2026 17:00
Vim fold children recursively (without closing parent)
function! CloseFoldsInnerFirst() abort
let lnum = line('.')
let L = foldlevel(lnum)
if L <= 0
return
endif
" Helper: move left boundary across closed folds correctly
let s = lnum
while s > 1
@mpkopec
mpkopec / noroot_tcpdump.sh
Created May 13, 2024 11:07 — forked from srugano/noroot_tcpdump.sh
Enable tcpdump for non-root users on Debian/Ubuntu.
#!/usr/bin/env bash
# NOTE: This will let anyone who belongs to the 'pcap' group
# execute 'tcpdump'
# NOTE2: User running the script MUST be a sudoer. It is
# convenient to be able to sudo without a password.
sudo groupadd pcap
sudo usermod -a -G pcap $USER
@mpkopec
mpkopec / noroot_tcpdump.sh
Created April 4, 2022 10:00
Enable tcpdump for non-root users on Debian/Ubuntu.
#!/usr/bin/env bash
# NOTE: This will let anyone who belongs to the 'pcap' group
# execute 'tcpdump'
# NOTE2: User running the script MUST be a sudoer. It is
# convenient to be able to sudo without a password.
sudo groupadd pcap
sudo usermod -a -G pcap $USER