Skip to content

Instantly share code, notes, and snippets.

View iacchus's full-sized avatar

Iacchus Mercurius iacchus

View GitHub Profile
@iacchus
iacchus / install_fonts.sh
Last active April 24, 2024 23:28
Install all Google Fonts on Linux (Debian/Ubuntu etc.)
#!/usr/bin/env sh
# Original author: Michalis Georgiou <mechmg93@gmail.comr>
# Modified by Andrew http://www.webupd8.org <andrew@webupd8.org>
# Current version by Kassius Iacchus https://github.com/iacchus/
# Depends on: `wget`
#
# Install `wget` on Debian/Ubuntu with:
# apt install wget
#!/usr/bin/env python
import sys
# DOT = '.'
DOT = '·'
args = sys.argv[1:]
dotted = [DOT.join(arg).upper() for arg in args]
@iacchus
iacchus / nostr-npub-to-hex.ipynb
Last active November 29, 2023 20:51
How to convert Nostr npub (bech32) key to base16 (hexadecimal) using python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iacchus
iacchus / zbell.sh
Created November 24, 2023 10:49 — forked from jpouellet/zbell.sh
Makes Zsh print a bell when long-running commands finish. I use this in combination with i3 and throw big compile jobs (or whatever it may be) into another workspace to get a nice visual notification (workspace indicator turns red) when it's done so I don't need to waste time regularly checking on it.
#!/usr/bin/env zsh
# This script prints a bell character when a command finishes
# if it has been running for longer than $zbell_duration seconds.
# If there are programs that you know run long that you don't
# want to bell after, then add them to $zbell_ignore.
#
# This script uses only zsh builtins so its fast, there's no needless
# forking, and its only dependency is zsh and its standard modules
#
@iacchus
iacchus / Show_Images_in_Terminal_Emulator.md
Last active October 6, 2023 04:16
Show Images in terminal emulator
@iacchus
iacchus / termux-keys-tab
Created June 21, 2023 17:06
Termux keyboard
## Configuration with additional popup keys (swipe up from an extra key)
extra-keys = [[ \
{key: KEYBOARD, popup: {macro: "CTRL d", display: exit}}, \
{key: ESC, popup: {macro: "CTRL f d", display: "tmux exit"}}, \
{key: CTRL, popup: {macro: "CTRL f BKSP", display: "tmux ←"}}, \
{key: ALT, popup: {macro: "CTRL f TAB", display: "tmux →"}}, \
{macro: "ALT c", display: "cd", popup: {macro: "ALT g", display: A-g}}, \
{macro: "vim SPACE $(fzf) ENTER", display: "vim", popup: {macro: "ALT g", display: A-g}}, \
{macro: "ESC :w ENTER", display: ":w", popup: {macro: "ALT g", display: A-g}}, \
{macro: "ESC :q ENTER", display: ":q", popup: {macro: "ALT g", display: A-g}}, \
# https://wiki.archlinux.org/title/android
# Command-Line Tools - https://developer.android.com/studio/releases/cmdline-tools
export PATH="~/Android/Sdk/tools/bin/:$PATH"
# SDK Build-Tools - https://developer.android.com/studio/releases/build-tools
export PATH="~/Sdk/build-tools/30.0.3/:$PATH"
# SDK Platform-Tools - https://developer.android.com/studio/releases/platform-tools
export PATH="~/Sdk/platform-tools/:$PATH"
@iacchus
iacchus / socket.io-1-0-apache-2.4-ssl.conf
Last active September 21, 2022 18:45
Set reverse proxy websockets in Apache 2.4 using socket.io 1.0. Needs mod_rewrite module, this version uses SSL. As seen here https://serverfault.com/questions/616370/configuring-apache-2-4-mod-proxy-wstunnel-for-socket-io-1-0
<VirtualHost *:80>
ServerName forum.example.com
Redirect permanent / https://forum.example.com
</VirtualHost>
<VirtualHost *:443>
ServerName forum.example.com
@iacchus
iacchus / apache-vite-docker.conf
Created July 22, 2022 06:28
Vite with Apache Reverse Proxy Inside Docker Fully functional
# you don't need to change anything in the default `vite.config.js`, only proxy / for the web and for the websockets.
<VirtualHost *:80>
ServerName my.site.org
ServerAdmin webmaster@localhost
RewriteEngine on
RewriteCond %{SERVER_NAME} =my.site.org
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
@iacchus
iacchus / run-toggle.sh
Created June 23, 2022 04:31
Shell script that toggles a program on/off
#!/usr/bin/env zsh
# USAGE:
# $ chmod + x run-toggle.sh
# ./run-toggle.sh <program binary path>
export FULL_COMMAND=${@:1}
export PROGRAM_NAME=$1
export PROGRAM_PID=$(pgrep -u $USER -x $PROGRAM_NAME)