Skip to content

Instantly share code, notes, and snippets.

@ad2ien
ad2ien / Gihub-scripts_accept_pr.sh
Last active January 5, 2023 07:24
Create a PR adding a file in several projects
#! /bin/bash
set -eu
BRANCH=''
ORG='okp4'
USER=ad2ien
REPOS=$(gh repo list ${ORG} --source --limit 150 --no-archived --json name --template '{{range .}}{{ .name }} {{end}}')
echo $REPOS
@ad2ien
ad2ien / distribute-Cosmos-wallets.sh
Last active September 5, 2022 06:50
Generate address / mnemonics CSV for a cosmos blockchain
#!/bin/bash
source .env
# create some wallets, strore address and mnemonics in a file
# use stargaze tool with airdrop_file
# distribute 0.5 Stars on each wallet
# make crypted files with mnemonics
# affect an email to each wallet
# send mails with attached mnemonics
@ad2ien
ad2ien / aliases.sh
Last active June 16, 2026 14:18
Station conf
alias pw="pwgen -cnyB1 16 | tee /dev/tty | xclip -selection clipboard"
alias chx="chmod +x $1"
alias wgup="sudo wg-quick up /etc/wireguard/wg0.conf"
alias wgdown="sudo wg-quick down /etc/wireguard/wg0.conf"
alias dc="docker compose"
# unique entries in history
hist() {
history | grep "$1" | tac | awk '{cmd=$0; sub(/^[0-9]+[[:space:]]+/, "", cmd)} !seen[cmd]++'
}
@ad2ien
ad2ien / signing-commits.sh
Created January 18, 2023 14:29
configure git and github to sign commits
#! /bin/bash
set -euo pipefail
# Interactively generate a new GPG key
gpg --default-new-key-algo rsa4096 --gen-key
# Get key id
KEY=$(gpg --list-secret-keys --keyid-format=long \
| grep '^sec.*$' \
@ad2ien
ad2ien / 1_gh-md-report.py
Last active June 26, 2024 15:17
A markdown Github report about closed issues
from datetime import datetime
from github import Github
start_date = datetime.strptime('2023-12-01', '%Y-%m-%d')
end_date = datetime.strptime('2023-12-01', '%Y-%m-%d')
project = 'org/repo'
output_file = './gh-report.md'
escaped_triple_backquotes = '\\```'
[
{
"input_combination": [
{
"type": 1,
"code": 41,
"origin_hash": "3ec1d6855bcbfeb40a349959fe9c5b73"
}
],
"target_uinput": "keyboard",
@ad2ien
ad2ien / github.ad2ien.css
Created January 14, 2026 08:22
Typora css
/* light CSS for pdf */
/** initialize css counter */
h1 {
counter-reset: h2
}
h2 {
counter-reset: h3
}
@ad2ien
ad2ien / startup-stuff.sh
Created January 28, 2026 10:25
Start stuff needing connection at boot (@reboot in crontab)
#!/bin/bash
# Start stuff needing connection at boot (@reboot in crontab)
set -e
TIMEOUT_INTERVAL_S=5
echo "Start frpc"
do_stuff(){
# cd
@ad2ien
ad2ien / setup-gestures.sh
Created August 22, 2026 17:58
trackpad gesture for POP OS COSMIC
#!/bin/bash
# With POP OS COSMIC desktop, trackpad gestures are not working (08-2026)
# This script sums up everything needed to add the feature
set -e
echo "=== Installing ydotool and libinput-gestures ==="
# Install packages