Skip to content

Instantly share code, notes, and snippets.

View lboulard's full-sized avatar

Laurent Boulard lboulard

  • Versailles, France
View GitHub Profile
@lboulard
lboulard / README.md
Last active December 7, 2023 19:09
slice.go #go #bugreport

Go playground: https://go.dev/play/p/9HKvgvSWqH3

start=0xc000100000   len=65536  cap=65536  end=0xc000110000   (start == nil) is false, (end == nil) is false, (buf == nil) is false
start=0xc000108000   len=   32  cap=32768  end=0xc000110000   (start == nil) is false, (end == nil) is false, (buf == nil) is false
start=0xc00010fff0   len=   16  cap=   16  end=0xc000110000   (start == nil) is false, (end == nil) is false, (buf == nil) is false
start=0xc00010ffff   len=    1  cap=    1  end=0xc000110000   (start == nil) is false, (end == nil) is false, (buf == nil) is false
start=0xc000100000   len=    0  cap=    0  end=0xc000100000   (start == nil) is false, (end == nil) is false, (buf == nil) is false
start= len= 0 cap= 0 end= (start == nil) is false, (end == nil) is false, (buf == nil) is true 
@lboulard
lboulard / restic-windows-vss.ps1
Created January 13, 2023 21:55 — forked from rstanleyhum/restic-windows-vss.ps1
Restic Backup Windows Volume Shadow Copy Service script taken from https://github.com/restic/restic/issues/340
# Windows PowerShell Script to use restic to backup files using the Volume Shadow Copy Service, allowing
# that are in use to be backed up. The script must be run with elevated privileges.
# The Volume Shadow Copy Service must be enabled for the disk volume that contains the files to be backed up.
#
# Parameters
$resticExe = 'C:\Users\Username\go\bin\restic.exe'
$resticRepository = '\\SYNOLOGY212J\backups\restic-workstation'
$rootVolume = "C:\"
# List of folders to backup, separated by commas
$foldersToBackup = @(
@lboulard
lboulard / age-public-key.txt
Created January 13, 2023 10:30
age public key
age1j6h4fu8f5ssz0ap7jpy5tla024z7hjzl0wy2gvcunafqrgu8249sy4g0tz
@lboulard
lboulard / source2clip.bat
Created December 15, 2022 08:15
Copy highlighted source code to clipboard
0<0# : ^
"""
:: Keep a python script inside a bat file
:: Source https://stackoverflow.com/a/41651933
@%USERPROFILE%\.virtualenvs\scratch\Scripts\python.exe -x -B "%~f0" %*
@EXIT /B
"""
"""
Requires pywin32, Pygments, Pillow
@lboulard
lboulard / OUTPUT.png
Last active November 20, 2022 18:44
RGB to xterm/oklch
OUTPUT.png
@lboulard
lboulard / kelbt-0.16.tar.gz
Last active October 16, 2022 09:01
Build Ragel 6.10 on windows with MSYS2/MINGW64
@lboulard
lboulard / README.md
Last active December 7, 2023 19:13
Fancy clink #windows #dotfiles
@lboulard
lboulard / no_sleep_display.py
Last active December 7, 2023 19:12
Prevent windows from powering off screen #windows
#!/usr/bin/env python3
import ctypes
import signal
import threading
if __name__ == "__main__":
SetThreadExecutionState = ctypes.windll.kernel32.SetThreadExecutionState
SetThreadExecutionState.argtypes = [ctypes.c_uint32]
@lboulard
lboulard / Git-as-carrier.md
Last active March 24, 2022 11:54
Git as carrier

Git as carrier

Using a Git tag

Create a tag tar with file-others content to save.

$ git tag tar "$(tar cf - $(git ls-files -o --exclude-standard) | git hash-object -t blob -w --stdin --no-filters)"
@lboulard
lboulard / .gitignore
Last active December 7, 2023 19:19
[Pushover] Pushover notification in ruby program #ruby #notification
*~
*.bak
*.orig
*.sw[a-z]
\#*\#
vendor