Skip to content

Instantly share code, notes, and snippets.

@koiralakiran1
koiralakiran1 / enabled.js
Last active June 15, 2022 03:58
ENABLED
// enabled.js
@koiralakiran1
koiralakiran1 / setup_github_ssh_keys.sh
Last active March 26, 2024 13:08
Helper script to setup github ssh as mentioned in github documentation
#!/usr/bin/env bash
# Script for "Connecting to github with ssh"
# Ref: https://docs.github.com/en/authentication/connecting-to-github-with-ssh
# Author: Kiran Koirala
# Github: koiralakiran1
#
# Asks for <filename> and <email>.
# Doesn't check for existing ssh keys.
# Uses "ed25519" key type (hardcoded).
@koiralakiran1
koiralakiran1 / MANJARO_ENCRYPTED_INSTALL.md
Last active September 17, 2023 14:41
My device setup process
@koiralakiran1
koiralakiran1 / yay_remember.py
Last active April 26, 2024 07:26
Wrap yay on arch distros to remember installed packages to a file
#!/usr/bin/env python
# pylint: disable=line-too-long,missing-module-docstring
import os
import sys
import logging
import subprocess
class YayRemember():
"""Wraps yay to save packages to packagelist"""
@koiralakiran1
koiralakiran1 / setup_device.py
Last active April 26, 2024 07:29
How I used to setup my device.
#!/usr/bin/env python
# pylint: disable=line-too-long,missing-module-docstring
import os
import sys
import logging
import platform
import subprocess
class SetupDevice():
@koiralakiran1
koiralakiran1 / install_fonts.sh
Last active April 26, 2024 07:36
Install fonts on linux distros systemwide
#!/bin/env bash
# Installs fonts system wide. Default install directory is /usr/share/fonts/my-installed-fonts.
# All fonts in /usr/share/fonts directory are recursively added by fc-cache, so we can install in custom directory
# Why this?
# Because some font installers like font-manager installs fonts only for current user
# i.e. in ~/.local/share/fonts which some applications like vscode didn't detect.
# Usage
# install-fonts a.ttf b.ttf c.ttf
@koiralakiran1
koiralakiran1 / git_recent_checkouts.awk
Last active April 26, 2024 07:45
Git recent branches
#!/usr/bin/awk -f
BEGIN {
FS=" ~~ "
print "\033[1;31mYour recent checkouts:\n"
}
{
print "\033[1;32m"$1"\033[0;32m ("substr($2,7,index($2,"}")-7)") [\033[1;33mCommitted by:\033[1;34m",$4"\033[0;32m on "$5"\033[0m] \n ",
$3"\n"
#print "\033[1;32m"$1"\033[0;32m ("substr($2,7,index($2,"}")-7)")\033[0m | "$3,