Skip to content

Instantly share code, notes, and snippets.

View coin8086's full-sized avatar
🏠
Working from home

Robert Zhang coin8086

🏠
Working from home
  • @Azure Microsoft
  • Shanghai, China
View GitHub Profile
@coin8086
coin8086 / linux-notes.md
Last active November 8, 2024 02:00
Linux Notes

Linux Notes

Bash test command

Use [[ ... ]] instead of [ ... ] to test a condition in Bash. The latter is poor in function and unmentioned in the official GNU Bash document at all.

Disable password login for user

passwd -l {username}
@coin8086
coin8086 / pytorch-ddp.md
Last active December 29, 2023 08:36
Distributed Model Training in PyTorch DDP

Distributed Model Training in PyTorch DDP

Prerequisites

Ensure GPU device is ready

Check GPU by lspci

Ensure enough free disk space

@coin8086
coin8086 / powershell-vs-bash.md
Last active June 7, 2024 03:30
PowerShell vs Bash in Examples

PowerShell vs Bash in Examples

Key different points

  • Bash commands output strings while PS commands output objects!

Examples

The following standard aliases in PowerShell are used:

@coin8086
coin8086 / wsl-settings-and-issues.md
Last active January 13, 2024 04:06
WSL settings and issue fixes

WSL Settings and Issue Fixes

Enable systemd

  1. Get the latest version WSL from the Windows Store

  2. Ensure /etc/wsl.conf has

[boot]

@coin8086
coin8086 / cgroup-and-systemd.md
Last active January 17, 2024 01:31
cgroup and systemd

cgroup and systemd

cgroup

"The control groups, abbreviated as cgroups in this guide, are a Linux kernel feature that allows you to allocate resources — such as CPU time, system memory, network bandwidth, or combinations of these resources — among hierarchically ordered groups of processes running on a system."

Check the cgroups by systemd-cgls.

Resource controller

@coin8086
coin8086 / linux-dev-setup.md
Last active March 8, 2023 03:11
Service Fabric in brief

Setup Service Fabric Development Environment on Linux

The official document at https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-get-started-linux is problematic (ESPECIALLY, DO NOT follow the instruction in that document to install Docker!). Here're the correct steps.

Prerequisites

  1. Check if your Linux distro and version are supported at https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-versions#supported-linux-versions-and-support-end-date
  2. Setup Docker as instructed by https://docs.docker.com/engine/install/ubuntu

Install Service Fabric SDK

@coin8086
coin8086 / linux-linkers-and-loaders.md
Last active January 21, 2024 05:22
Linux Linkers and Loaders

Linux Linkers and Loaders

Tools

  • ldconfig
  • ld.so
  • ld
  • ldd

ldconfig

@coin8086
coin8086 / proxy.md
Last active July 1, 2023 04:43
Proxy

Proxy

Proxy vs VPN

  • Proxy is not VPN.
  • An application could provide an option to use a proxy, by a command line parameter, or an environment variable. Or it could provide no option for proxy at all!
  • VPN is an easy way to "proxy" the whole system without any application specific settings.

A proxy could use SOCKS or HTTP protocol.

@coin8086
coin8086 / ssh-port-forwarding.md
Created June 9, 2022 08:56
SSH Port Forwarding

Autoscale in CycleCloud

What is CycleCloud

CycleCloud is a product that

  • makes it easy to create and manage HPC computer clusters
  • is open to integrate with various HPC schedulers, like PBS, Slurm, HPC Pack, etc.
  • is deployed by user