Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / passgenvimb
Last active November 17, 2020 21:35
Autofill password field on vimb with the password from pasword-store
#!/bin/sh
# Desccription: autofill password field on vimb with the password from pasword-store
# Dependencies: password-store, vimb
# Installation:
# 1. copy this file in you local bin : ~/.local/bin
# 2. add this line in your vimb conf : nmap ,,; ::sh! ~/.local/bin/passgenvimb<CR>
# Last rev: 18-10-2020
# License: WTFPL
# GistID: 52f7443b52fce7270066095101c93099
@tyjak
tyjak / agnoster.zsh-theme
Last active October 11, 2020 12:46
customize prompt option for oh-my-zsh agnoster theme
# vim:ft=zsh ts=2 sw=2 sts=2
# Gist: 9f9569d9fc118c88ad3a758fc2b26502
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://gist.github.com/1595572).
@tyjak
tyjak / dmenu-webnav
Last active October 7, 2020 12:16
Dmenu to search web history or bookmark or default search engine with vimb
#!/bin/sh
# dmenu scripts to search in history and bookmark or in default vimb search engine
# mark the window where searched was launch
i3-msg 'mark websearch'
# go to web marked if possible
i3-msg '[con_mark="web"] focus'
<?xml version="1.0" ?>
<!DOCTYPE service-group SYSTEM 'avahi-service.dtd'>
<service-group>
<name replace-wildcards="yes">AirPrint HL-2030 @ %h</name>
<service>
<type>_ipp._tcp</type>
<subtype>_universal._sub._ipp._tcp</subtype>
<port>631</port>
<txt-record>txtvers=1</txt-record>
<txt-record>qtotal=1</txt-record>
@tyjak
tyjak / popup
Last active March 12, 2025 11:42
window
#!/bin/sh
#set -e
#set -u
#set -o pipefail
export LC_ALL=C
POPUP_DEFAULT_WIDTH=800
POPUP_DEFAULT_HEIGHT=600
# TODO refacto
@tyjak
tyjak / dmenu-ssh
Last active October 6, 2023 06:53
dmenu-ssh simple dmenu to connect to your ssh server listed in .ssh/config file
#!/bin/sh
# Dmenu for ssh connection
# Take two ssh config files, the default user and a config file for work serveur via $SSH_WORK_CONFIG_FILE
hosts_menu=$(grep '^Host\b [^*]\+\b' $HOME/.ssh/config $SSH_WORK_CONFIG_FILE | awk '{$1=""; print $0}' | dmenu -p "SSH servers:" -l 10 -i -nb '#b58900' -nf '#eee8d5' -sb '#002b24' -fn 'MesloLGSDZ Nerd Font-10' -h ${DMENUHEIGHT:-36})
host_target=$(echo $hosts_menu | cut -d' ' -f1)
unset SSH_AGENT_PID
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then