Skip to content

Instantly share code, notes, and snippets.

View sputnick-dev's full-sized avatar
🚀
Open to opportunities

Gilles Quénot sputnick-dev

🚀
Open to opportunities
View GitHub Profile
{
"defaultAction": "SCMP_ACT_ERRNO",
"syscalls": [
{
"name": "accept",
"action": "SCMP_ACT_ALLOW",
"args": null
},
{
"name": "accept4",
#!/bin/bash
# https://unix.stackexchange.com/questions/385023/firefox-reading-out-urls-of-opened-tabs-from-the-command-line
if [[ $1 == *jsonlz4 ]]; then
export opentabs="$1"
elif pgrep -f waterfox &>/dev/null; then
export opentabs=$(ls -t ~/.waterfox/*/sessionstore-backups/recovery.jsonlz4 | sed q)
else
export opentabs=$(ls -t ~/.mozilla/firefox*/*/sessionstore-backups/recovery.jsonlz4 | sed q);
#!/usr/bin/env python
user = 'xxxxxxx'
password = 'xxxxxxxx'
import requests
from lxml import html
login_url = 'https://forum.ubuntu-fr.org/login.php'
#!/usr/bin/env sh
# sputnick 2023 (copyleft)
# cURL: https://curl.se/docs/httpscripting.html
# xidel: https://github.com/benibela/xidel
# xidel x86_64: https://sourceforge.net/projects/videlibri/files/Xidel/Xidel%20development/xidel_0.9.9-1_amd64.deb/download
user=toi password='xxxxxxxxxxxxxxxxxxxx'
trap 'rm -f /tmp/ubuntu-fr.html' EXIT
#!/bin/sh
# Know which signal is caught
# man 7 signal
# The signals SIGKILL and SIGSTOP cannot be caught, blocked, or ignored. (9, 19]
trap "echo 'SIGHUP 1 Term Hangup (disconnection) or control process termination.'" 1
trap "echo 'SIGINT 2 Term Interrupt from keyboard.'" 2
trap "echo 'SIGQUIT 3 Core Quit request from keyboard.'" 3
trap "echo 'SIGILL 4 Core Illegal instruction.'" 4
trap "echo 'signal 5 not referenced'" 5
trap "echo 'SIGABRT 6 Core Abort signal from abort(3).'" 6
#!/bin/bash
min_number=1
max_number=10
my_number=$(( RANDOM % max_number + min_number ))
read -p "Guess a number between $min_number and $max_number >>> " number_guess
case $number_guess in
#!/bin/bash
# https://stackoverflow.com/a/13401143/465183
# Decimal ASCII codes (see man ascii)
ARR=( {48..57} {65..90} {97..122} )
# Array count
arrcount=${#ARR[@]}
sudo apt-get update && apt-get install openjdk-11-jre perl libxml2 libxml2-dev libxml-libxml-perl libwww-perl liblwp-protocol-https-perl
git clone https://github.com/sputnick-dev/saxon-lint.git
cd saxon-lint*
chmod +x saxon-lint.pl
./saxon-lint.pl --help
$ cd /tmp
$ cat file
foobar
123
$ sed 's/\w//g' file
$ sed 's/\d//g' file
foobar
123
$ printf '%s\n' a 2 z s 0.1 1.1 | sort -n
0.1
a
s
z
1.1
$ printf '%s\n' a 2 z s 0.1 1.1 | sort -V
0.1
1.1
2