Skip to content

Instantly share code, notes, and snippets.

View vbrozik's full-sized avatar
☮️
Ukraine stay strong

Václav Brožík vbrozik

☮️
Ukraine stay strong
  • NTT Czech Republic
  • Czech Republic
  • 13:30 (UTC +02:00)
View GitHub Profile
@ELLIOTTCABLE
ELLIOTTCABLE / lessf.sh
Last active March 10, 2025 12:52
Use `less +F` on multiple files merged into a single stream, just like `tail -f`
# lessf: `less +F` for multiple files, ala `tail -f`
#
# Usage:
# lessf file1.log file2.log ...
#
# - should work on dash, bash, and zsh;
# - works on macOS and the Linuxes I've tested it on;
# - requires the minimal tools that seem to be available nearly everywhere (`awk`, `mktemp`), and of course `less`
# - you may want `unbuffer` or `stdbuf` to avoid the 4kb of buffering (i.e. no output until enough loglines have been added.)
#
@vbrozik
vbrozik / README.md
Last active October 19, 2023 14:41
jq JSON query
@vbrozik
vbrozik / wsl-ubuntu-prep.sh
Last active May 17, 2022 22:22
WSL Ubuntu preparation
#!/bin/sh
# Prepares freshly installed WSL
# Written for:
# WLS2, Ubuntu 22.04
sudo apt update
sudo apt install wslu
# TODO:
@backerman
backerman / profile-snippet-sshargcomplete.ps1
Last active March 4, 2025 22:45
Enable tab completion for ssh hostnames in PowerShell
using namespace System.Management.Automation
Register-ArgumentCompleter -CommandName ssh,scp,sftp -Native -ScriptBlock {
param($wordToComplete, $commandAst, $cursorPosition)
$knownHosts = Get-Content ${Env:HOMEPATH}\.ssh\known_hosts `
| ForEach-Object { ([string]$_).Split(' ')[0] } `
| ForEach-Object { $_.Split(',') } `
| Sort-Object -Unique
# For now just assume it's a hostname.
@shaybensasson
shaybensasson / pprint_color.py
Last active March 16, 2021 08:18 — forked from EdwardBetts/pprint_color.py
Python pprint with color syntax highlighting for the console (adapted for python3.6)
from pprint import pformat
from pygments import highlight
from pygments.formatters.terminal256 import Terminal256Formatter
from pygments.lexers.python import PythonLexer
def pprint_color(obj):
print(highlight(pformat(obj), PythonLexer(), Terminal256Formatter()))
@discdiver
discdiver / jupyterlab_shortcuts.md
Last active April 17, 2025 23:13
Common Jupyter Lab Keyboard Shortcuts

If you are on a Mac, substitute command for control. Don't type the + (it means press both keys at once).

Shortcuts when in either command mode (outside the cells) or edit mode (inside a cell):

  • Shift + Enter run selected cell or cells - if no cells below, insert a code cell below

  • Ctrl + B toggle hide/show left sidebar

  • Ctrl + S save and checkpoint

  • Ctrl + Shift + S save as

@vees
vees / Lenovo Thinkcentre M92P.txt
Last active September 25, 2024 04:13
Ubuntu and UEFI on Lenovo Thinkcentre M92P
Lenovo Thinkcentre M92P
When booting to USB installer disk installation proceeds as expected
1962 no operating system found
When booting into preview mode all disks load without issue, so its not the cable
Secure Boot option either not present or disabled
Last time I fixed this by adding a fake line to the boot loader from instructions on the web
Got a warning during installation about UEFI mode
Windows Fast Startup disabled
jfly comment below:
@strarsis
strarsis / howto.md
Last active March 26, 2025 16:51
KeeAgent (for KeePass) on Bash on Windows / WSL (2)

Update (March 2023) (Last checked: Oktober 2024)

Side note: The latest edge build of KeeAgent plugin offers an option for creating a WSL compatible socket. This would be very handy. I already tried to use that socket, but the socket file is currently empty and ssh inside WSL 2 is unable to use it. This appears to be a very new, unreleased and unstable feature. I will follow the development of it and when it finally works (well, for me) I will update this HOWTO. But until then, please use the proven wsl-ssh-agent/npiperelay.exe approach below.

Thanks to the instructions for WSL 2 of the wsl-ssh-agent project, KeeAgent works great in WSL 2 now: https://github.com/rupor-github/wsl-ssh-agent#wsl-2-compatibility The approach uses minimal and well-maintained tools.

Mini-changelog

@timbennett
timbennett / expose.py
Last active June 11, 2023 00:36
Create 'long exposure' images from a video file.
# This script takes a video's individual frames and overlays them to produce a composite "long exposure" image.
#
# Usage: python expose.py video.mp4 width height
#
# IMPORTANT: you'll need to edit this script to set the value of 'alpha' appropriate for your video's length and desired brightness.
from __future__ import division
import subprocess as sp
import numpy
from PIL import Image, ImageDraw
@ygra
ygra / Get-SpotlightImages.ps1
Created November 16, 2016 10:05
A small PowerShell script to save Windows 10 lock screen images to a more accessible location.
$files = gci $Env:LocalAppData\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets |
where Length -gt 1kb
if ($files) {
$shell = New-Object -ComObject Shell.Application
$folder = "$Env:USERPROFILE\Pictures\Spotlight"
if (!(Test-Path $folder)) { mkdir $folder }
$files | % {
$_ | Copy-Item -Destination $folder\$_.jpg
Get-Item $folder\$_.jpg
} | % {