Skip to content

Instantly share code, notes, and snippets.

View pranjalpokharel7's full-sized avatar

Pranjal Pokharel pranjalpokharel7

View GitHub Profile
@pranjalpokharel7
pranjalpokharel7 / vpnc-dns-restore-runbook.md
Created July 31, 2026 04:41
Fix vpnc disconnect nameserver issue (opus 5 post-mortem)

Runbook: vpnc disconnect breaks DNS on systemd-resolved machines

Symptom: after sudo vpnc-disconnect, name resolution is dead until wifi is toggled off/on. ping 8.8.8.8 works; ping google.com does not.

Status of this document: Option B is verified working on one machine (Ubuntu-family, systemd-resolved, vpnc-scripts from /usr/share/vpnc-scripts). Option A is derived from reading vpnc-script source and is the more correct fix, but was not tested — validate it on one machine before any rollout.

@pranjalpokharel7
pranjalpokharel7 / subtitle-summarizer.py
Created July 27, 2026 09:07
Summarize subtitles (personal use)
#!/usr/bin/env python3
import argparse
import re
import subprocess
import sys
from dataclasses import dataclass
from pathlib import Path

file_splitter.sh

This is a simple bash script to split a file into pieces based on provided file size and encrypt the chunks individually.

The script also provides option to decrypt them and re-combine them. Useful in cases you want to upload/download files over an insecure connection with limited upload/download size limit.

#!/bin/bash

file_organizer.sh

This is a simple script to organize files in a directory, based on

  1. File extension
  2. File name
#!/bin/bash

function organize_by_extension(){
@pranjalpokharel7
pranjalpokharel7 / vim_theme_switcher.md
Last active March 2, 2021 05:28
Vim Auto Theme Switcher (dark<->light)

vim_theme_switcher

This is a simple script to switch color scheme in vim from light to dark and vice-versa depending upon system time. The script is written in bash.

#!/bin/bash

# vim_theme_switcher.sh
@pranjalpokharel7
pranjalpokharel7 / lab_cover_page.tex
Last active March 4, 2021 07:06
Latex code to generate cover page for lab reports.
% This is a gist to generate cover page for lab reports.
% Based on the layout we usually need to use as engineering students.
% Output: https://drive.google.com/file/d/16eNLZ0Vcf6K79jPwpKj6qzJ1O54koLU8/view?usp=sharing
% Add Tribhuwan University (TU) logo named 'TU-logo.png' (jpg/pdf) inside './images/'
% directory relative to root. You can download and include your own logo in the
% directory (set paths + filename correctly).
% Adjust the logo scale factor from \newcommand\logoScaleFactor{<your-scale-factor>}
% The logo I have used can be downloaded from the following drive link -
% Logo: https://drive.google.com/file/d/1OVkWmZXikLdYjIFgPGpvKb8-1HHSFQS4/view?usp=sharing