Skip to content

Instantly share code, notes, and snippets.

View davidlj95's full-sized avatar

David LJ davidlj95

View GitHub Profile
@davidlj95
davidlj95 / ip2chainparamsseeds.py
Last active September 26, 2018 12:27
Converts an IPv4 address to a line of chainparamsseeds.h to check if your node is a seed of Bitcoin Core client
#!/usr/bin/python3
#
# Converts an IPv4 address to the format of the file ``chainparamsseeds.h``
# to know if your node is a seed in Bitcoin Core client's seeds.
#
# This file is automatically created by ``generate-seeds.py``
#
# Sources:
# https://github.com/bitcoin/bitcoin/blob/v0.16.3/src/chainparamsseeds.h
# https://github.com/bitcoin/bitcoin/tree/v0.16.3/contrib/seeds
@davidlj95
davidlj95 / BlockstackID.txt
Created October 10, 2018 11:28
Blockstack ID verification
Verifying my Blockstack ID is secured with the address 1MUuyMPU3fEoqsL7ioo5S1MSKAVHqE4Wa5 https://explorer.blockstack.org/address/1MUuyMPU3fEoqsL7ioo5S1MSKAVHqE4Wa5
@davidlj95
davidlj95 / tgm
Last active November 7, 2018 21:33
Telegram file sender via CLI
#!/bin/sh
# tgm: TeleGram send Message
# Sends a message via Telegram (using telegram-cli)
# Author: davidlj95
#
# Telegram CLI:
# https://github.com/vysheng/tg
# yay -S telegram-cli-git
# Constants
@davidlj95
davidlj95 / pyenv-install.sh
Last active September 10, 2023 04:10
Install pyenv on cygwin
#!/bin/sh
# devel-env are needed to install Python versions
cyg-get.bat bash curl make automake gcc-core gcc-g++ zlib zlib-devel libffi-devel
curl https://pyenv.run | bash
@davidlj95
davidlj95 / github_make_private_by_grep_expression.sh
Created June 13, 2019 22:37
GitHub make private repos whose name matches grep expression
#!/bin/sh
#
# Uses GitHub API to make private all repositories whose name matches the
# given grep expression
#
set -e
# Arguments
REPO_FILTER="$1"
API_BASE_URL="https://api.github.com"
@davidlj95
davidlj95 / tickers-kraken.30s.sh
Last active June 28, 2019 01:32
Retrieves Kraken ticker information to be used with argos
#!/bin/sh
# <bitbar.title>Kraken.com price tickers</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>davidlj95</bitbar.author>
# <bitbar.author.github>davidlj95</bitbar.author.github>
# <bitbar.desc>Last selected tickers from Kraken.com</bitbar.desc>
# <bitbar.image>https://i.imgur.com/iGX2yjR.png</bitbar.image>
# <bitbar.dependencies>jq,curl</bitbar.dependencies>
#
@davidlj95
davidlj95 / fix-paperkey.sh
Created July 2, 2022 03:43
Helps fixing a GPG paperkey using checksums & vim
#!/bin/bash
#
# So you have backed up your GPG key using paperkey, and have scanned it
# using OCR techniques. However, it's not perfect and some checksums do not match
# Some 8s are Bs, 0s are Os... This script will try to spot errors so you
# can compare those lines and fix them
#
# Given a secret key exported using paperkey, tries to decode it.
#
# In case a CRC checksum wrong is found, a vim editor will be opened
@davidlj95
davidlj95 / flaixfm-podcast-urls-extractor.js
Last active May 4, 2023 02:21
FlaixFm podcast URL extractor
function getNextButton() {
return document.querySelector('.podcast-pagination .right_arrow');
}
function hasNextButton() {
const nextButtonStyle = window.getComputedStyle(getNextButton());
return nextButtonStyle.opacity !== '0'
}
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
@davidlj95
davidlj95 / seo-tags.html
Last active August 17, 2023 16:46
HTML SEO tags: Jekyll SEO tag generated & @ngaox/seo compatible
<!--
SEO HTML data
The list below is copy/pasted from generated SEO data using Jekyll SEO tag v2.8.0
Next to it if `@ngaox/seo` supports it built-in (✅), can be set via custom meta tags (✅🛠️) or is not supported (❌)
-->
<title>David LJ 🔗 @davidlj95</title> <!-- ✅ -->
<meta property="og:title" content="David LJ 🔗 @davidlj95"/> <!-- ✅ -->
<meta name="author" content="davidlj95"/> <!--✅🛠️ -->
<meta property="og:locale" content="en"/> <!-- ✅🛠️ -->
<meta name="description" content="/dev/random software engineer. Connecting technology &amp; RealLife™"/> <!-- ✅ -->
@davidlj95
davidlj95 / gh-repos-with-pages.sh
Last active September 6, 2023 22:26
GitHub repositories with GitHub Pages enabled
#!/bin/sh
repos=$(gh repo list --limit 100 --json nameWithOwner | jq -r '.[].nameWithOwner')
count=0
echo "{"
for repo in $repos; do
has_pages="$(gh api repos/"$repo" --jq '.has_pages')"
echo " \"$repo\": $has_pages,"
if [ "$has_pages" = "true" ]; then
: $((count+=1))
fi