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 / docker-compose.yaml
Created November 9, 2024 17:04
Quick and dirty docker Gitea rootless server
# Quick and dirty docker Gitea rootless server
#
# Prepare host with a "git" account for gitea inside docker
#
# $ useradd -d /data/gitea/git -M --system git
# $ getent passwd git
# gitea:x:995:992::/data/gitea/git:/bin/sh
#
# $ install -d -o git -g git -m 750 /data/gitea /data/gitea/config /data/gitea/data
#
@lboulard
lboulard / .clang-format
Last active October 30, 2024 06:51
Symbolic link on Windows 10
# .clang-format
# Base style
BasedOnStyle: Google
# Indentation
IndentWidth: 4 # Use 4 spaces for indentation
TabWidth: 4 # Set tab width to 4 spaces
UseTab: Never # Always use spaces instead of tabs
@lboulard
lboulard / path-android.bat
Last active September 28, 2024 16:23
PATH manipulations for Windows in CMD.EXE and PowerShell
@IF NOT DEFINED ANDROID_HOME SET "ANDROID_HOME=%LOCALAPPDATA%\Android\sdk"
@IF NOT DEFINED ANDROID_NDK_HOME SET "ANDROID_NDK_HOME=%ANDROID_HOME%\ndk-bundle"
@SET ANDROID_HOME
@SET ANDROID_NDK_HOME
@FOR %%x in (cecho.exe) DO @(
SET "ECHO=%%~$PATH:x"
IF DEFINED ECHO (
SET "GREEN={0A}"
SET "YELLOW={06}"
)
@lboulard
lboulard / Get_GitHub_APIToken.ps1
Created May 22, 2024 12:47
Get GitHub API from Windows Credential Store
Add-Type -TypeDefinition @"
using System;
using System.Runtime.InteropServices;
using System.Text;
public class CredentialManager {
[DllImport("advapi32", SetLastError = true, CharSet = CharSet.Unicode)]
public static extern bool CredRead(string target, int type, int reservedFlag, out IntPtr credentialPtr);
[DllImport("advapi32", SetLastError = true)]
@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