Skip to content

Instantly share code, notes, and snippets.

@sts10
sts10 / rust-command-line-utilities.markdown
Last active March 15, 2025 16:18
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
@sean-smith
sean-smith / schedulers.md
Last active July 30, 2020 00:19
Scheduler Cheatsheet for AWS ParallelCluster

General

sge slurm torque
Submit Interactive Job qlogin srun qsub -I
Submit Batch Job qsub sbatch qsub
Number of Slots -pe mpi [n] -n [n] -l ppn=[n]
Number of Nodes -pe mpi [slots * n] -N [n] -l nodes=[n]
Cancel Job qdel scancel qdel
See Queue qstat squeue qstat
@DaisukeMiyamoto
DaisukeMiyamoto / setup_slurm_accounting_parallelcluster.sh
Last active January 30, 2024 14:29
set up Slurm Accounting feature (sacct) with slurmdbd/MySQL on AWS ParallelCluster
#!/bin/bash -xe
# Setting up Slurm Accounting feature with slurmdbd/MySQL for AWS ParallelCluster
# Daisuke Miyamoto [email protected]
#
# Test Condition:
# - 20200312
# - ParallelCluster 2.6.0
# - CentOS7/Slurm
#
# ParallelCluster config example:
#!/usr/bin/env python
import os
import sys
import argparse
import subprocess
import time
import datetime
import pytz
import filelock
@MichaelSimons
MichaelSimons / RetrievingDockerImageSizes.md
Last active March 14, 2025 14:41
Retrieving Docker Image Sizes

Retrieving Docker Image Sizes

There are two metrics that are important to consider when discussing the size of Docker images.

  1. Compressed size - This is often referred to as the wire size. This affects how fast/slow images can be pulled from a registry. This impacts the first run experience on machines where images are not cached.
  2. Uncompressed size - This is often referred to as the size on disk. This affects how much local storage is required to support your Docker workloads.

The example commands shown below will work on Windows, MacOS, and Linux.

How to Measure the Compressed Size

@mmterpstra
mmterpstra / submitd.pl
Last active July 30, 2020 01:08
submitd.pl queue crawlin since 2019
#!/usr/bin/perl
use strict;
use warnings;
use Proc::Daemon;
use Proc::PID::File;
use Getopt::Long;
use Log::Log4perl qw(:easy);
use File::Basename;
@youssefeldakar
youssefeldakar / sacctmins
Last active December 30, 2020 09:44
Print Slurm bank account usage/quota minutes for a given resource
#!/bin/sh
# This gist has moved under github.com/hpcalex/slurmies/ as of 2020-12-30.
# Usage: sacctmins <acct> <resc>
# Reference for Slurm commands:
#
# https://slurm.schedmd.com/sshare.html
@crazyguitar
crazyguitar / effective_modern_cmake.md
Created August 1, 2019 07:11 — forked from mbinna/effective_modern_cmake.md
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@AmazingTurtle
AmazingTurtle / how-to-restore.md
Last active February 18, 2025 15:44
restore access to unifi controller

Restore access to a unifi controller

When you are unable to login to the unifi controller or forgot admin password, you can restore access using SSH and manipulating mongodb directly.

Warning

Do not uninstall unifi controller - most of the data is not stored in mongodb. In case you thought a mongodb backup would be sufficient, you may have fucked up already, just like me. However I managed to write this "tutorial" for anyone to not run into the same trap.

Apparently this guide no longer works with recent unifi controller versions (starting nov/dec 2022). Since I no longer use unifi hardware in my home system, I can not update the guide myself. In case you've gotten here to recover your data, you're likely doomed. But giving it a try won't hurt anyway, therefore: good luck.

tl;dr

Gather Clusters Information

# Gather all simple information
$ sinfo

# Display node and other information
$ sinfo -Nl