Skip to content

Instantly share code, notes, and snippets.

@tyjak
tyjak / vimb_adblock
Last active October 25, 2020 10:23
update adblock and install adblock in vimb if need it
#!/bin/sh
# install and update adblock as https://github.com/Docbroke did it here https://github.com/fanglingsu/vimb/issues/430#issuecomment-367570464
# Gist: 5e4649253bd023e5af4cdb5fefa541d2
if [ ! -L /usr/lib/vimb/adblock.so ]; then
notify-send --urgency=normal "installing adblock plugin"
sudo ln -s /lib/wyebrowser/adblock.so /lib/vimb
fi
@tyjak
tyjak / passdmenu.py
Last active November 19, 2020 23:17
#!/usr/bin/env python3
# GistID:1bd94853d6958a897d7c3a1ed140ed90
import sys
import os
import os.path as path
import subprocess
import shutil
import argparse
import re
@tyjak
tyjak / R0
Last active January 24, 2021 01:40
affiche le dernier R0 connu de la covid19
#!/bin/sh
# affiche le dernier R0 connu du la COVID19
python -c "import csv,codecs,json,urllib.request;print(json.dumps(list(csv.reader(codecs.iterdecode(urllib.request.urlopen('https://www.data.gouv.fr/fr/datasets/r/381a9472-ce83-407d-9a64-1b8c23af83df'), 'utf-8')))))" | jq '.[] | .[2]' | grep -v "NA" | tail -1 | tr -d '"'
@tyjak
tyjak / update-app-and-aur.sh
Last active March 13, 2021 16:07
Update binance app and AUR pkg
#!/bin/zsh
#
# Script to update binance app + aur package
#
# GistID:58d0769588db7a673c5a66843c3cc6db
echo "Loading Binance binary"
curl -sO https://ftp.binance.com/electron-desktop/linux/production/binance-amd64-linux-deb.deb
@tyjak
tyjak / gist:mine
Last active September 10, 2021 22:07
Simple wrapper to have website embeded in an i3 floating window
#!/bin/zsh
#
# Simple wrapper to havce website embedded in a vimb floating window
# depends on i3 and vimb
# GistID:e8e5001619c9d8755b08be2ae4f0516d
URI=$1
NAME=${2:-$1}
@tyjak
tyjak / handbrake-all.sh
Last active May 23, 2021 09:34
copy all title of a dvd with handbrakecli
#!/bin/zsh
set -e
# copy all titles of dvd
# GistID:48c17774a5adb5c1bd45def1a21bd16e
dirpath="${1:-$(pwd)}"
title=$(HandBrakeCLI -i /dev/sr0 -t 0 2>&1 | grep "DVD Title:" | sed -E 's/.*DVD Title: (.*)$/\1/')
HandBrakeCLI -i /dev/sr0 -t 0 -v 2>&1 | grep '+ title' | sed -E "s@[^0-9]*([0-9]+):\$@HandBrakeCLI -i /dev/sr0 -m -t \1 -o \"${dirpath}/${title}_\1.mp4\"@" > /tmp/handbrake-tasks.sh
sh /tmp/handbrake-tasks.sh
#more ~/handbrake-sample.txt | grep '+ title' | sed -E "s@[^0-9]*([0-9]+):\$@HandBrake -t \1 -o \"$1 \1.mp4\"@"
version: '3.7'
services:
reverse-proxy:
image: nginx
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf
- /etc/letsencrypt/:/etc/letsencrypt/
ports:
- 443:443
networks:
# duniter reverse proxy conf
# GistID: 73fb5272f602c5011aeaaf6b4f8b00d0
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
{
"currency": "g1",
"endpoints": [],
"rmEndpoints": [],
"upInterval": 3600000,
"c": 0.0488,
"dt": 86400,
"dtReeval": 15778800,
"ud0": 1000,
"stepMax": 5,
#!/bin/zsh
# GistID: e4eb7bf3ed820cbd24b2be1da71f1068
# Get text of the first result of a wikipedia search as argument
# Dependencies: http, jq, sed
http https://fr.wikipedia.org/w/api.php\?format\=json\&action\=query\&generator\=search\&gsrsearch\=$1\&gsrlimit\=1\&prop\=extracts\&explaintext\=1 | jq '.query.pages | map(values) | .[0].extract' | sed 's/\\n/\n/g'