Skip to content

Instantly share code, notes, and snippets.

View mahendrapaipuri's full-sized avatar
🐿️

Mahendra Paipuri mahendrapaipuri

🐿️
View GitHub Profile
#!/bin/bash
pip uninstall jupyter-ai langchain-openai -y
@mahendrapaipuri
mahendrapaipuri / README.md
Created July 15, 2024 10:01
Bug in SLURM's `acct_gather_energy/rapl` for newer Intel processers

Preamble

Document resumes the bug in the SLURM's acct_gather_energy/rapl plugin that reports the energy consumption of the jobs using MSRs of RAPL framework.

Essentials

RAPL supports multiple power domains. The RAPL power domain is a physically meaningful domain (e.g., Processor Package, DRAM etc) for power management. Each power domain informs the energy consumption of the domain.

RAPL provides the following power domains for both measuring and limiting energy consumption:

@mahendrapaipuri
mahendrapaipuri / git_cmds.sh
Created October 18, 2023 16:10
Git commands
# To be able to rebase with VSCODE UI
git -c "core.editor=code --wait --reuse-window" -c "sequence.editor=code --wait --reuse-window" rebase -i HEAD~n
@mahendrapaipuri
mahendrapaipuri / index.js
Created August 18, 2023 08:30
Adding bootstrap 3 to react app with webpack
import 'jquery/src/jquery';
import 'bootstrap/dist/css/bootstrap.min.css';
import 'bootstrap/dist/js/bootstrap.min.js';
@mahendrapaipuri
mahendrapaipuri / dummy_servers.md
Created August 17, 2023 14:46
List of Dummy servers for API testing
@mahendrapaipuri
mahendrapaipuri / linux_commands.sh
Last active September 15, 2024 15:40
Useful linux commands
#!/bin/bash
# Command to check top consumers of open files in linux
lsof | awk '{ print $2; }' | sort -rn | uniq -c | sort -rn | head
# List of processes id with the number of inotify instances they are consuming,
# sorted by the number of inotify instances being consumed
for inot in /proc/*/fd/*; do readlink -f $inot; done | grep inotify | sort | uniq -c | sort -nr
# Increase inotify watches and instances
@mahendrapaipuri
mahendrapaipuri / gist:01964b168c5fad191d5c0a9e532bc70c
Created July 26, 2023 18:00 — forked from tott/gist:3895832
create cpu load in python
#!/usr/bin/env python
"""
Produces load on all available CPU cores
"""
from multiprocessing import Pool
from multiprocessing import cpu_count
def f(x):
while True:
@mahendrapaipuri
mahendrapaipuri / cuda_load.py
Created July 26, 2023 14:37
CUDA simple load test
# Nicked from https://github.com/waggle-sensor/gpu-stress-test/tree/main
import os
import sys
import time
import torch
x = torch.linspace(0, 4, 16 * 1024 ** 2).cuda()
runtime = 60
timeout = time.time() + runtime
@mahendrapaipuri
mahendrapaipuri / setup-dropbox.sh
Created July 19, 2023 07:22
Setting up dropbox on linux without root privileges
#!/bin/bash
# Get dropbox.py file
wget -O $HOME/dropbox.py http://www.dropbox.com/download?dl=packages/dropbox.py
# Setup dropbox. Use DISPLAY='' env var to set it up without GUI
# Else we will need to install a lot of GUI related stack
DISPLAY='' python3 $HOME/dropbox.py start -i
# Finally start dropbox
@mahendrapaipuri
mahendrapaipuri / artifacts-server.sh
Last active January 15, 2025 20:00
Using act for testing GitHub workflows locally with artifacts
# Install artifacts server
git clone https://github.com/anthonykawa/artifact-server.git
npm install
# Start artifacts server with AUTH_KEY env var set
# By default this will start server on port 8080
AUTH_KEY=foo npm run start