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 / export.bat
Last active May 5, 2022 08:22
Scoop setup/daily scripts
@SETLOCAL
@CD "%~dp0"
:: WARNING scoop force exit of batch
powershell -C "%~dp0\export.ps1"
@IF "x%~1"=="xbatch" GOTO :EOF
@:: Pause if not interactive
@ECHO %cmdcmdline% | FIND /i "%~0" >NUL
@IF NOT ERRORLEVEL 1 PAUSE
@lboulard
lboulard / run-as-busybox.bat
Created June 2, 2020 09:33
Run ash/busybox shell script inside dos batch file
:<<"::EOF"
@busybox sh "%~f0"
@EXIT /B
::EOF
set -x
echo "$SHELL"
echo "running in busybox"
exit $?
@lboulard
lboulard / Native window IntelliJ.md
Created May 13, 2020 10:52
Native window IntelliJ
@lboulard
lboulard / getsha256.cmd
Last active December 7, 2023 19:10
Quick get SHA1 and SHA256 from remote file URL #python
0<0# : ^
"""
:: Keep a python script inside a bat file
:: Source https://stackoverflow.com/a/41651933
@py -3 -x -B "%~f0" %*
@EXIT /B
"""
import sys
from os.path import basename
from urllib.parse import urlparse
@lboulard
lboulard / py-script-inside.bat
Last active April 11, 2020 12:46
Python script inside dosbatch file
0<0# : ^
'''
:: Keep a python script inside a bat file
:: Source https://stackoverflow.com/a/41651933
@SETLOCAL ENABLEEXTENSIONS
@py -3 -x -B "%~f0" %*
@SET ERR=%ERRORLEVEL%
@:: Pause if not interactive
@ECHO %cmdcmdline% | FIND /i "%~0" >NUL
@IF NOT ERRORLEVEL 1 PAUSE
@lboulard
lboulard / .gitattributes
Last active February 16, 2025 12:46
Silent install of multiple python versions #windows #pythin #silent #installation
*.bat eol=crlf
*.xml eol=crlf
@lboulard
lboulard / init_env
Created July 11, 2019 12:19 — forked from derkling/init_env
A set of repo related functions to speedup AOSP related development
# Export repo path
export PATH=/mnt/data/src/aosp:$PATH
export REPO_MIRROR=isilon.cambridge.arm.com:/ifs/arm/scratch/aosp_mirror
export REPO_MOUNT=/mnt/data/src/aosp_mirror
# Mount AOSP Cambridge mirror (if required)
function repo_mount {
mount | grep "$REPO_MOUNT" &>/dev/null
[[ $? -eq 1 ]] || return
@lboulard
lboulard / 99-lboulard.rules
Created June 21, 2019 14:30
udev rules for changing external SSD to noop io scheduler
# vim /etc/udev/rules.d/99-lboulard.rules
ACTION!="add|change", GOTO="lboulard_end"
SUBSYSTEM!="block", GOTO="lboulard_end"
ENV{ID_VENDOR}!="JMicron", GOTO="lboulard_end"
ENV{ID_MODEL_ID}!="0562", GOTO="lboulard_end"
ATTR{queue/scheduler}="none"
LABEL="lboulard_end"
# udevadm control --reload
@lboulard
lboulard / pip-upgrade-all-windows.md
Last active February 2, 2020 10:47
Manage python packages on windows

Upgrade all

Upgrade pip before in case of very old version on system:

py -3 -m pip install --user -U pip

Upgrade all root packages in one go (avoid generating broken dependencies between root projects):

DEL "%TMP%\pip-upgrade.txt"
FOR /F "delims==" %i IN ('py -3 -m pip list --user --not-required --format=freeze') DO @ECHO %i &gt;&gt;"%TMP%\pip-upgrade.txt"
@lboulard
lboulard / install-vim.sh
Last active January 24, 2024 05:06
Compile Vim 8 on Centos 7
# Source: https://www.netroby.com/view/3891
yum groupinstall "Development Tools"
yum install ncurses-devel git-core
git clone [email protected]:vim/vim.git
./configure --prefix=/usr --with-features=huge --enable-multibyte --with-python-config-dir=/usr/lib/python2.7/config --enable-pythoninterp=yes
make -j4
make install