Skip to content

Instantly share code, notes, and snippets.

View abiiranathan's full-sized avatar
🎯
Focusing

Dr. Abiira Nathan abiiranathan

🎯
Focusing
  • Yo Medical Files(U) Ltd
  • Uganda
  • 03:41 (UTC +03:00)
  • X @abiiranathan
View GitHub Profile
@abiiranathan
abiiranathan / filc-libpq.sh
Created November 3, 2025 15:05
Build libpq with Fil-C compiler
#!/usr/bin/env bash
# Exit on error, undefined variables, and pipe failures
set -eup
POSTGRES_VERSION="18.0"
ARCHIVE_NAME="postgresql-${POSTGRES_VERSION}.tar.gz"
EXTRACT_DIR="postgresql-${POSTGRES_VERSION}"
# Skip download if archive already exists
@abiiranathan
abiiranathan / install-poppler.sh
Created September 27, 2025 00:20
Script to Statically Compile Poppler-Glib
#!/bin/bash -eux
# This script builds a static version of poppler and its dependencies.
# The script is based on the instructions and examples provided in the article:
# https://fasterthanli.me/series/dont-shell-out/part-3
# Get the absolute path of the script.
SCRIPT_PATH=$(readlink -f "$0")
# Get the directory where the script is located.
# Install comprehensive firmware packages
sudo pacman -S linux-firmware-marvell linux-firmware-qlogic linux-firmware-liquidio linux-firmware-bnx2x
# For the console font warning
sudo pacman -S terminus-font
# Optional: Install AUR firmware packages for more complete coverage
yay -S wd719x-firmware upd72020x-fw
@abiiranathan
abiiranathan / guard.code-snippet
Created April 6, 2025 18:31
C header guard vscode snippet
{
"C++ Header Guard with extern C": {
"prefix": "guard",
"body": [
"#ifndef ${1:${TM_FILENAME_BASE/(.*)/${1:/upcase}_H/}}",
"#define ${1:${TM_FILENAME_BASE/(.*)/${1:/upcase}_H/}}",
"",
"#ifdef __cplusplus",
"extern \"C\" {",
"#endif",
@abiiranathan
abiiranathan / git-semver.sh
Last active February 27, 2025 21:20
A utility for managing semantic versioning with Git tags
#!/bin/bash
#
# git-semver: A utility for managing semantic versioning with Git tags
#
# Installation:
# 1. Save this file as 'git-semver' in a directory in your PATH (e.g., /usr/local/bin/)
# 2. Make it executable: chmod +x /path/to/git-semver
# 3. Use it as a Git subcommand: git semver <command>
#
@abiiranathan
abiiranathan / gencert.sh
Created September 20, 2024 11:56
Generate self-signed certificates with a single script. Useful in LAN environments or localhost
#!/usr/bin/env bash
# Generate a self-signed certificate for specified hosts
# and add it to the system keychain.
# Requires: openssl, sudo
set -euo pipefail
# Configuration
@abiiranathan
abiiranathan / .clangd
Created August 13, 2024 12:38
clangd configuration file for C/C++. Place it at /home/username/.clangd
InlayHints:
ParameterNames: No
DeducedTypes: No
Diagnostics:
UnusedIncludes: Strict
ClangTidy:
Add: [bugprone-*, cert-*, modernize-*, performance-*]
Remove: [bugprone-easily-swappable-parameters, modernize-use-trailing-return-type, cert-err33-c, cert-err34-c]
{
"main": {
"scope": "c,c++",
"prefix": "main",
"body": [
"#include <stdio.h>",
"",
"int main(int argc, char*argv[]) {",
"\t$0",
"\treturn 0;",
//#include "stdafx.h"
#include <sodium.h>
#include <iostream>
using namespace std;
#define MESSAGE (const unsigned char *) "test"
#define MESSAGE_LEN 4
#define CIPHERTEXT_LEN (crypto_box_SEALBYTES + MESSAGE_LEN)
@abiiranathan
abiiranathan / pushtags
Created May 17, 2023 12:36
Automatically create and push tag to remote with git.
[alias]
pushtags = "!sh -c 'if [ -z \"$1\" ]; then echo \"No tag name provided\"; exit 1; fi; tag_name=\"$1\"; git tag -a \"$tag_name\" -m \"Tag: $tag_name\" && git push origin \"$tag_name\"' \"\""