Skip to content

Instantly share code, notes, and snippets.

View lboulard's full-sized avatar

Laurent Boulard lboulard

  • Versailles, France
View GitHub Profile
--- 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) }
#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>
@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__))
@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 / 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 / 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 / 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 / packages.txt
Created July 30, 2018 14:29
Different representation for packages.txt in vim-win32-build
Package: upx
Version: 391w
Architecture: all
Source: http://upx.sourceforge.net/download/upx391w.zip (upx_bin.zip)
Checksum:
sha256:d7d4817f46d2616c209c46fb8bce44e4bec93ab5adef5e4dfc93ee879527be1b
Install: upx${Version}
Package: nsis
Version: 3.02.1
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\Shell\Vim]
@="Edit with &Vim"
"Icon"="\"C:\\Vim\\vim81\\gvim.exe\""
[HKEY_CLASSES_ROOT\*\Shell\Vim\command]
@="\"C:\\Vim\\vim81\\gvim.exe\" \"%1\""
@lboulard
lboulard / sddm-theme-chili.md
Last active August 12, 2021 17:01
Install chili sddm theme on Debian