Skip to content

Instantly share code, notes, and snippets.

View lboulard's full-sized avatar
💭
Be patient. I enjoy real world.

Laurent Boulard lboulard

💭
Be patient. I enjoy real world.
  • Versailles, France
View GitHub Profile
@lboulard
lboulard / Capslock-to-Control.ps1
Last active December 7, 2023 19:15
Capslock to Control key #windows #ps1
$hexified = "00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00".Split(',') | % { "0x$_"};
$kbLayout = 'HKLM:\System\CurrentControlSet\Control\Keyboard Layout';
New-ItemProperty -Path $kbLayout -Name "Scancode Map" -PropertyType Binary -Value ([byte[]]$hexified);
@lboulard
lboulard / 20-siji.conf
Last active February 19, 2018 16:24
Compile polybar on trusty
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- ~/.config/fontconfig/conf.d/20-siji.conf -->
<fontconfig>
<!-- Restore Fixed bitmap font for terminal usage -->
<selectfont>
<acceptfont>
<pattern>
<patelt name="family">
<string>Siji</string>
@lboulard
lboulard / config.txt
Created December 3, 2017 20:13
Configuration file for youtube-dl on Windows (%APPDATA%\youtube-dl\config.txt)
--ffmpeg-location C:/msys64/mingw64/bin
-f bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4
--embed-thumbnail
--add-metadata
--keep-video
# Thumbnail support
# https://bitbucket.org/jonhedgerows/atomicparsley/downloads/
@lboulard
lboulard / README.md
Last active July 12, 2022 07:35
Command line ANDROID SDK in Linux

Android SDK will be installed in $HOME/.local/share/android/sdk.

On page https://developer.android.com/studio/index.html#downloads, got to section "Get just the command line tools" at page end and download Linux package. With last edition of this document, this is commandlinetools-linux-8092744_latest.zip.

export ANDROID_SDK_ROOT=$HOME/.local/share/android/sdk
export ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk-bundle
mkdir -p $ANDROID_SDK_ROOT
@lboulard
lboulard / pwned-find.py
Created August 6, 2017 22:16
Find presence of password in pwned SHA1 files
#!/usr/bin/env python3
# SHA1 files can be found here: https://haveibeenpwned.com/Passwords
import sys
import os, os.path
from hashlib import sha1
import codecs
HERE=os.path.dirname(os.path.abspath(__file__))
#define _GNU_SOURCE /* for pipe2 support */
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <time.h>
#include <errno.h>
#include <pthread.h>
--- lib/Win32/Console/ANSI.rb~ Thu Aug 26 15:09:18 2010
+++ lib/Win32/Console/ANSI.rb Thu Aug 26 15:27:17 2010
@@ -132,7 +132,7 @@
# For Ruby applications, this means requiring Win32Conole again.
def write(*s)
if redirected?
- s.each{ |x| @Out.WriteFile(x.dup.to_s) }
+ s.each{ |x| @Out.WriteFile(x.to_s.dup) }
else
s.each{ |x| _PrintString(x) }