Skip to content

Instantly share code, notes, and snippets.

View gmolveau's full-sized avatar

Grégoire MOLVEAU gmolveau

View GitHub Profile
@gmolveau
gmolveau / wsl_setup.md
Last active March 21, 2025 14:51
WSL install and setup + vscode

WSL setup

  • Open powershell with admin and run wsl --install
  • Enable virtualization in the BIOS if needed
  • Open the windows store and install Ubuntu 24
  • Run Ubuntu, create your user + password
  • Run mkdir dev
  • Run explorer.exe . to open an explorer window, create a shortcut of the dev folder and place it in My Documents
  • Install Windows Terminal
  • Run Windows Terminal, go to Settings and change the Default profile to Ubuntu 24, change the
@gmolveau
gmolveau / cli_best_practices.md
Created February 27, 2025 20:12
cli best practices #linux

CLI best practices

  • use the most common flags

    • the help flag : --help | -h | -?
     $ git --help
     usage: git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]
                [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]

[-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]

@gmolveau
gmolveau / lit_palettes_europe.pdf
Last active February 10, 2025 20:24
Réaliser un sommier de lit en palettes europe pour matelas 140x200
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gmolveau
gmolveau / openshot_installer.sh
Created December 17, 2024 09:35
Openshot appimage installer
#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o nounset
# set -o xtrace
APPIMAGE_URL="https://github.com/OpenShot/openshot-qt/releases/download/v3.2.1/OpenShot-v3.2.1-x86_64.AppImage"
APPIMAGE_NAME="OpenShot-v3.2.1-x86_64.AppImage"
ICON_SOURCE="squashfs-root/usr/share/icons/hicolor/scalable/apps/openshot-qt.svg"
@gmolveau
gmolveau / singlefile_config.json
Created November 30, 2024 08:40
Singlefile personal config (remove characters, FS friendly)
{
"profiles": {
"__Default_Settings__": {
"removeHiddenElements": true,
"removeUnusedStyles": true,
"removeUnusedFonts": true,
"removeFrames": false,
"blockScripts": true,
"blockVideos": true,
"blockAudios": true,
@gmolveau
gmolveau / python_312_pip.md
Created September 23, 2024 13:40
python3.12 ModuleNotFoundError: No module named 'distutils'

If you have this error using python3.12

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/lib/python3/dist-packages/pip/__main__.py", line 16, in <module>
    from pip._internal.cli.main import main as _main  # isort:skip # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pip/_internal/cli/main.py", line 10, in <module>
@gmolveau
gmolveau / set-thunar.sh
Created September 18, 2024 06:56
Set thunar as default file-manager on ubuntu
sudo apt-get install -y --no-recommends thunar
xdg-mime default thunar.desktop inode/directory application/x-gnome-saved-search
@gmolveau
gmolveau / pip_upgrade_all_dependencies.sh
Created September 3, 2024 08:48
bash script to upgrade all outdated dependencies with python/pip
pip list --disable-pip-version-check --outdated --format=columns | tail -n +3 | awk '{print $1}' | xargs -n1 pip install -U || true
# explanations :
# pip list --disable-pip-version-check --outdated --format=columns : print as a column format only the outdated dependencies, and suppress the warning if pip is outdated as it messes up the output
# tail -n +3 : keep only the lines after the first two
# awk '{print $1}' : keep only the first column
# xargs -n1 pip install -U || true : install each dependency, never fails via the || true (to use in a CI or script env)
@gmolveau
gmolveau / flask_gunicorn_download_fails_30s.md
Created May 3, 2024 08:24
flask/gunicorn/apache2 download/upload fails/closes/stops after 30 seconds

flask/gunicorn/apache2 download/upload fails/closes/stops after 30 seconds

Keywords : flask, gunicorn, apache2, send_file, werkzeug, requests, httpx, curl

Errors encountered

  • curl: (18) transfer closed with 9895632 bytes remaining to read
  • urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(206700544 bytes read, 789007589 more expected)', IncompleteRead(206700544 bytes read, 789007589 more expected))
  • httpcore.RemoteProtocolError: peer closed connection without sending complete message body (received 290521088 bytes, expected 995708133)
@gmolveau
gmolveau / configure_firefox.sh
Last active April 30, 2024 12:58
Configure firefox profile with bash cli
#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o nounset
# set -o xtrace
if [ -d "${HOME}/.mozilla/firefox" ]; then
FIREFOX_PROFILES="${HOME}/.mozilla/firefox"
elif [ -d "${HOME}/snap/firefox/common/.mozilla/firefox" ]; then
FIREFOX_PROFILES="${HOME}/snap/firefox/common/.mozilla/firefox"