Skip to content

Instantly share code, notes, and snippets.

@tiwariPC
tiwariPC / generate_directory_index.py
Last active April 16, 2026 09:04
Recursively generate index.html files for directory trees (HEP web output)
#!/usr/bin/env python3
# Recursively generate index.html files for
# all subdirectories in a directory tree
import argparse
import datetime
import fnmatch
import os
import shutil

HTCondor Installation Guide — macOS Apple Silicon (M-series)

Tested on Apple M5, macOS Sequoia. HTCondor runs under Rosetta 2 (x86_64) as no native ARM64 macOS build is available yet.


Step 1 — Create the condor service account

sudo dscl . -create /Groups/condor
if [ "$#" -eq 0 ]; then
# No files were provided, just open Vim
/Applications/Kitty.app/Contents/MacOS/kitty /opt/homebrew/bin/nvim
else
# Files were provided, open them in Vim
for f in "$@"
do
/Applications/Kitty.app/Contents/MacOS/kitty /opt/homebrew/bin/nvim "$f"
done
fi
## Use Automator app to create a workflow by selecting Folder Action.
## Then choose Downloads folder
## Add Run Shell Script option then add the script below to the box and save it in ~/Library/Workflows/Applications/Folder Actions/
## Then selection the folder action in Finder by double clicking the Download folder
#!/bin/bash
for f in "$@"
do
DEST=""
## Use Automator app to create a workflow by selecting Folder Action.
## Then choose Desktop folder
## Add Run Shell Script option then add the script below to the box and save it in ~/Library/Workflows/Applications/Folder Actions/
## Then selection the folder action in Finder by double clicking the Download folder
#!/bin/bash
processed_dir="/Users/ptiwari/Screenshots"
latest_file="$(find "$@" -type f -name "ScreenShot*" -exec ls -t {} + | head -n1)"
@tiwariPC
tiwariPC / Installations for MacBook.md
Last active October 27, 2023 20:46
Installations for MacBook

Brew packages (may be interdependent):

ant, aom, apr, apr-util, autoconf, automake, berkeley-db, boost, brotli, c-ares, ca-certificates, cairo, cgal, clisp, cmake, curl, eigen, exa, fastjet, fd, fontconfig, freetype, fzf, gawk, gcc, gd, gdbm, gettext, ghostscript, giflib, git, glib, gmp, go, graphite2, harfbuzz, highway, htop, icu4c, imagemagick, imath, imlib2, isl, jasper, jbig2dec, jpeg-turbo, jpeg-xl, lazygit, lhapdf, libavif, libcaca, libde265, libgit2, libheif, libice, libidn, libidn2, liblqr, libmpc, libnghttp2, libomp, libpng, libraw, libsigsegv, libsm, libssh2, libtermkey, libtiff, libtool, libunistring, libuv, libvmaf, libvterm, libx11, libxau, libxcb, libxdmcp, libxext, libxft, libxmu, libxrender, libxt, little-cms2, lua, luajit, luarocks, luv, lz4, lzo, m4, make, mpdecimal, mpfr, msgpack, ncurses, neovide, neovim, ninja, node, openexr, openjdk, openjpeg, openldap, openssl@1.1, openssl@3, pcre2, perl, pixman, pkg-config, plotutils, potrace, powerlevel10k, pstoedit, pygments, python@3.10, pyt
vim:fileencoding=utf-8:foldmethod=marker
#: Fonts {{{
#: kitty has very powerful font management. You can configure
#: individual font faces and even specify special fonts for particular
#: characters.
font_family IntoneMono Nerd Font
bold_font auto
@tiwariPC
tiwariPC / convertPDFtoImage.py
Last active April 12, 2023 13:07
Convert Pdf pages to individual images
import os
from pdf2image import convert_from_path
# Set the directory containing the PDF files
pdf_dir = "/Users/ptiwari/cernbox/www/bbDM/fit-results-12042023-combinedEMu/pullsNimpacts2018"
# Set the directory to save the extracted images
output_dir = "/Users/ptiwari/cernbox/www/bbDM/fit-results-12042023-combinedEMu/pullsNimpacts2018"
# Set the image format (e.g. JPEG, PNG)
@tiwariPC
tiwariPC / prefitVSpostfit_plotter.py
Created April 11, 2023 07:04
Check % change in the prefit yield using b-only or s+b fit
import re
import csv
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import subprocess
import optparse
import os, sys
import glob
@tiwariPC
tiwariPC / GruvboxDark.itermcolors
Last active April 5, 2023 07:15
iTerms Profile and Themes
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.15686275064945221</real>