Logo Ray's Blog
  • Home
  • About
  • News
  • Publications
  • Education
  • More
    Experiences
  • Posts
  • Notes
  • Dark Theme
    Light Theme
Logo Inverted Logo
  • Posts
  • AI
    • Infrastructure
      • Guides On Choosing Deep Learning Server
    • LLM
      • Asksage
    • PyTorch
      • Learning PyTorch Part I
      • Pytorch Distributed Data Parallel With Model Parallel in an HPC Environment
  • Tools
    • NeoVim
    • An Intro to a CLI Password Management: Pass
    • Exercism Cli Shortcut
    • Random Docker/Podman tips
  • HPC
    • ALCF
      • Distributed Training
      • QWen2.5-VL
  • Linux
    • Manage Users in Linux
    • Setup Ubuntu 22.04
  • Embedded Systems
  • Programming
    • C++
      • C++ Enum Pattern
    • Competitive Programming
      • How to Learn Programming
      • Mistakes I Have Made
      • TopCoder
        • HoleCakeCuts topcoder SRM411 div2 level3
        • InfiniteSequence topcoder SRM413 div2 level3
        • StringsAndTabs topcoder SRM412 div2 level3
        • TeleportsNetwork topcoder SRM409 div2 level3
    • Design Patterns
      • Object-Oriented Analysis
      • Object-Oriented Design Principles
    • Python
      • Python Conditional Timeit Decorator
Hero Image
Docker/Podman tips

Docker unlimited resources docker run --gpus all --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 -it --rm --privileged --detach-keys "ctrl-a,a" -v $(pwd):/workspace <image-name> Map detach-keys to something else The default detach shortcut is ctrl-p, ctrl-q conflicting the previous command ctrl-p. Adding the option --detach-keys "ctrl-a,a" maps it to something else. Port forwarding -p 9999:9999 Use Host DNS --dns-opt=/etc/resolv.conf Podman Container Device Interface (CDI) From NVIDIA ref sudo dnf clean expire-cache \ && sudo dnf install -y nvidia-container-toolkit-base sudo nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml grep " name:" /etc/cdi/nvidia.yaml It should show the GPU device ids (this example is for two gpus):

  • Documentation
Saturday, June 10, 2023 | 1 minute Read
Hero Image
An Intro to a CLI Password Management: Pass

Pass Replace text in <> with your own info. pass Generate a gpg key pair gpg --full-generate-key Enter name and email address To change expire date gpg --edit-key <email>@<address> Once you are in the interactive mode gpg> list gpg> expire gpg> save To change password gpg --passwd <email>@<address> To export public key gpg --export --armor --output public.pgp <email>@<address> To change cache time using gpg agent in secs cd ~/.gnupg echo "default-cache-ttl 86400" > gpg-agent.conf echo "max-cache-ttl 86400" >> gpg-agent.conf Pass Initialize Pass gpg -K # to show key id pass init <key_id> pass git init Add new password pass insert <name> # create a new password pass generate <name> # generate a new password pass list # list passwords pass generate <name>/<sub> # generate a nested password If we replace <name> with github, we will create a password file named github. Each password is stored as a file, like so:

  • Documentation
Monday, May 29, 2023 | 2 minutes Read
Hero Image
Exercism Cli Shortcut

A Exercism CLI shortcut Exercism is a good place to learn and practice coding. It features a variety of programming languages (tracks) ranging from popular ones like python and C++, newer ones like Rust, Go and Clojure, to exquisite ones like vimscript. Each track consists of a series exercises that one need to challenge them in sequence. Some tracks feature real person mentors, which provides feedback and (dis)approves your solution! Yep, the next exercise would be unlocked only if your solution had been approved by the mentor, which may take some iterations and discussions. Most importantly, Exercism comes with a command line interface (CLI) that is very convenient to use.

    Thursday, July 9, 2020 | 3 minutes Read
    Navigation
    • About
    • News
    • Publications
    • Education
    • Experiences
    Contact me:
    • yren@bnl.gov
    • yhren
    • Yihui (Ray) Ren

    Liability Notice: This blog is for informational and educational purposes only. The content provided here represents personal opinions and is not intended as professional advice. Readers should not rely solely on this information and are responsible for their own actions and decisions. This blog is not liable for any damages or consequences resulting from the use of its content. The views expressed here are my own and do not reflect those of my employer or any funding agencies. © 2017-2025 Yihui Ren. All rights reserved.


    Toha Theme Logo Toha
    © 2017-2025 Yihui Ren. All rights reserved.
    Powered by Hugo Logo