Skip to content

Instantly share code, notes, and snippets.

View davidlj95's full-sized avatar

David LJ davidlj95

View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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 / class_registry.py
Last active August 27, 2018 13:39
Python 3: Class registry
"""Implements a class registry based on its name using Python 3 metaclasses
**Source:**
- https://effectivepython.com/2015/02/02/\
register-class-existence-with-metaclasses/
"""
REGISTRY = {}
"""
@davidlj95
davidlj95 / pip-update.sh
Last active June 18, 2018 17:52
Updates all outdated Python packages using `pip`
#!/bin/bash
# Name: `pip` package updater
# Description: checks `pip` outdated packages and updates them all at once
# Source:
# https://stackoverflow.com/questions/2720014/upgrading-all-packages-with-pip
pip list --outdated --format=freeze | \
grep -v '^\-e' | \
cut -d = -f 1 | \
xargs -n1 pip install -U
@davidlj95
davidlj95 / bitcoin-cli wrapper
Created April 8, 2018 18:27
Extends the functionality of the bitcoin-cli tool allowing to select multiple configurations with the first parameter and other extra cool funcs
#!/bin/bash
# Description: Allows to switch between RPC
# client configurations inside
# ~/.bitcoin folder. If no
# config found, takes default
# Usage:
# bitcoin-cli <node_config> [args]
#
# Passes ~/.bitcoin/<node_config>.conf as
# the configuration file to bitcoin-cli
@davidlj95
davidlj95 / [email protected]
Last active March 20, 2018 22:08
bitcoind Systemd Unit service (with templates)
[Unit]
Description=Bitcoin's [%i] distributed currency daemon
After=network.target
[Service]
User=bitcoin-%i
Group=bitcoin-%i
Type=forking
PIDFile=/var/blockchain/bitcoin/bitcoind_%i.pid