Skip to content

Instantly share code, notes, and snippets.

View dingp's full-sized avatar

Pengfei Ding dingp

  • NERSC/LBNL
View GitHub Profile

Using GitHub CLI on Perlmutter

Installation

  1. Go to the release page of cli/cli, and get the compatible build for Perlmutter. The latest version as of July 1, 2024 is GitHub CLI 2.52.0 linux amd64
  2. Untar the file, and move the single binary executable gh to path which is included in the list of the env PATH, or add the path to it in your $HOME/.bashrc.ext;
  3. Similarly, move the share/man subdiretory into a place already pointed to by the env MANPATH, or the new path to $HOME/.bashrc.ext;
  4. Add bash (or other shell) completion by adding eval "$(gh completion -s bash)" into $HOME/.bashrc.ext. After opening a new terminal, you would be able to test the installation with which gh, man gh and use the tab key for sub-command completion (tab once to auto complete the command, tab twice to list all possible completions).

My additions to $HOME/.bashrc look lik

@dingp
dingp / Dockerfile
Last active February 28, 2024 14:44
ARG nvc_tag
FROM nvcr.io/nvidia/pytorch:$nvc_tag
RUN python -m pip install --no-cache-dir -U pip
RUN apt-get update && apt-get install -y rsync strace
# Install parallel HDF5
RUN wget https://github.com/HDFGroup/hdf5/archive/refs/tags/hdf5-1_12_3.tar.gz && \
tar -xvf hdf5-1_12_3.tar.gz && \
cd hdf5-hdf5-1_12_3 && \

GitHub Copilot Subscription

🔴 Please exercise caution with Copilot enabled in your editor. Avoid opening sensitive files (export-controlled code, files containing PII, etc). 🔴

Apply for GitHub Education Benefits

  • Log in to GitHub and add your lab/university email to your profile:
    • Click on your icon in the top right corner of the page and navigate to "Settings."
    • Select "Emails" in the "Access" section of the sidebar.
  • Add your lab/university email if it's not already listed.
@dingp
dingp / check_nd_fd.py
Last active June 23, 2023 05:30
A minimal example of detecting if the DUNE DAQ environment contains ND or FD components.
#!/bin/env python
import subprocess
import sys
def check_spack_pkg(pkg):
completed_process = subprocess.run(f"spack find --loaded {pkg}",
shell=True, check=False,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL)