A useful script to work offline, in the train, to run in a local git clone of the target repository :
gh issue list --json number --jq .[].number | while read nb; do
gh issue view $nb > $nb.md
gh issue view $nb --comments >> $nb.md
done
Un court article pour partager une méthode bien pratique pour mettre à jour la page d'acceuil d'un forum ForumActif :
Contexte
Une association de jeux de rôle a mis en place un site ForumActif. Cet hébergeur inclus dans ses forums phpBB la possibilité de créer des pages HTML statiques, et de …
Script to install Datalogics PDF Checker CLI on a Linux system:
curl https://raw.githubusercontent.com/Lucas-C/dotfiles_and_notes/master/bin/install-pdfchecker.sh | bash
PDF_Checker/pdfchecker --profile PDF_Checker/CheckerProfiles/everything.json --input $pdf
bash -n
is a basic but useful builtin syntax linter.
If you do not use the pre-commit
Python command & hook manager (check it out, it's great!), you can define a git
pre-commit hook "manually" by putting the following in a file at .git/hooks/pre-commit
:
#!/bin/sh
# Redirect output to stderr:
exec 1>&2
echo "Executing bash native syntax linter on all modified .sh files:"
if ! git diff --cached --name-only --diff-filter=AM HEAD | grep '.sh$' | xargs -n 1 bash -n
then
echo "Error : syntax issues were detected"
exit 1
fi
I love reveal.js. I've been using it for years. But the other day, I was badly bitten by its requirement on a local HTTP server.
What happenned was that I was invited to make a short presentation in a youth and cultural center. I had prepared some slides with …
Due to a long standing bug, no history file will be kept of the commands you enter in an interactive shell when using a Python 3 virtualenv.
I found out a simple workaround. Simply put the following in your ~/.pythonrc
:
import atexit, os, readline, sys
if sys.version_info >= (3, 0 …
First, lets mention Git Bash (aka msysgit) : the old version was a PITA to extend with additional packages (e.g. adding common C libs like libxml), and the new one (renamed Git for Windows), is based on MSYS2, but does not include a package manager.
Hence, we were left with …
Die shell script, DIE !
In this post, I'll show how easy it ease to convert fragile shell scripts to Python scripts, using sh.py. I'll use as an example a simple script to check your HTML code from the command-line, using the W3C validator.
Now you ask me, why the …
Under Windows, CPython is shipped with a very useful py
command.
PEP-397 describes in details its behaviour, and its C implementation can be found in the CPYthon Mercurial repository.
There has already been a lenghty discussion in the "python-ideas" mailing list to write a Linux equivalent. I agree with what …
To illustrate my previous post and keep images at a reasonable size, I had to shrink down the top GIF from 14Mb to 3.2Mb.
Usually, online GIF converters will provide the ability to lower down the image dimensions. Another solution to reduce its size is to simply skip some …
Do you know the pv
command ? It's really nifty.
There are a few use cases:
echo "You can simulate on-screen typing just like in the movies" | pv -qL 10
# Show the incoming TCP packets rate:
tcpdump tcp -w - | pv -btr >/dev/null
# Show the maximum throughput between two machines:
# (provided …
Just relaying the information about this "ShellShock" vulnerability:
This seems to affect Apache, sshd
, DHCP clients and even potentially git
.
TL;DR here is how to check your Bash version
env x='() { echo Never called; }; echo YOUR BASH IS VULNERABLE …
I often find myself grep
-ing for information in system or application log files. And often, by combining pipes, I end up generating a flow of values that is sometimes difficult to interpret.
In this post I'll show you a quick-and-dirty but handy solution to get basic statistical quantities from …
Malgré leurs nombreux défauts [1], les scripts shell restent bien pratiques. Pourquoi ? Parce qu'ils fonctionnent exactement comme l'interpréteur de ligne de commande de votre terminal Linux. Ils sont donc la solution la plus simple et rapide pour automatiser des enchaînement de commandes [2].
Comme les scripts shell sont très sujets …