Skip to content

Instantly share code, notes, and snippets.

View dcasati's full-sized avatar

Diego Casati dcasati

View GitHub Profile
# Source: nvidia-device-plugin/templates/daemonset-device-plugin.yml
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: nvdp-nvidia-device-plugin
namespace: nvidia-device-plugin
labels:
helm.sh/chart: nvidia-device-plugin-0.15.0
app.kubernetes.io/name: nvidia-device-plugin
app.kubernetes.io/instance: nvdp
#!/bin/bash
set -x
# Set your ACR name and resource variables
ACR_NAME=""
SOURCE_RG_C1="<source-resource-group>"
MyRegC1="<my-registry>"
MyPipelineC1="<my-pipeline>"
MyPipelineC1Run="<my-pipeline-run>"
MyBlob="<my-storage-blob>"
@dcasati
dcasati / delft3d
Last active August 21, 2024 22:58
compile delft3d on rockylinux9
#!/bin/env bash
# shfmt -i 2 -ci -w
set -eox
wget https://registrationcenter-download.intel.com/akdlm/IRC_NAS/d461a695-6481-426f-a22f-b5644cd1fa8b/l_HPCKit_p_2024.2.1.79_offline.sh
sh ./l_HPCKit_p_2024.2.1.79_offline.sh -a --silent --cli --eula accept
# pre-requisites
apt update && apt install -y \
@dcasati
dcasati / podman
Created April 30, 2024 20:27
run podman in a pod
# to run podman in a pod
# create a priviledge pod
cat <<EOF | kubectl apply -f -
kind: Pod
apiVersion: v1
metadata:
name: adcirc-debug
spec:
containers:
@dcasati
dcasati / run.sh
Last active May 24, 2024 10:42
torchrun
#!/usr/bin/env bash
set -x
export TORCH_CPP_LOG_LEVEL=INFO
export TORCH_DISTRIBUTED_DEBUG=DETAIL
export LOGLEVEL=DEBUG
export NCCL_DEBUG=warn
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/:/usr/local/nccl-rdma-sharp-plugins/lib:$LD_LIBRARY_PATH
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libnccl.so
export NCCL_IB_PCI_RELAXED_ORDERING=1
@dcasati
dcasati / azure firewall query - deny
Created April 14, 2023 00:23
azure firewall query to show packets that were denied
AzureDiagnostics
| where ResourceType == "AZUREFIREWALLS"
| extend
proto = extract(@"^([A-Z]+) ",1,msg_s)
,src_host = extract(@"request from ([\d\.]*)",1,msg_s)
,src_port = extract(@"request from [\d\.]*:(\d+)",1,msg_s)
,dest_host = extract(@" to ([-\w\.]+)(:|\. |\.$)",1,msg_s)
,dest_port = extract(@" to [-\w\.]+:(\d+)",1,msg_s)
,action = iif(
msg_s has "was denied"
@dcasati
dcasati / gist:25be5997183b4e362d1eb729b384a13b
Created February 7, 2023 21:43
removing AppleDouble files and extended attributes from a tarbal
# when creating a tarball on macOS you might want to exclude the
# AppleDouble files and xattr in your tarball
#
# here is an example:
tar --disable-copyfile --no-xattrs -cvzf capsh-0.1.1.tar.gz .
# These steps are known to work on a rpi1,2 and 3.
# tested with the Samsung SCX-3400 are needed
sudo apt install avahi-daemon cups printer-driver-splix
sudo usermod -a -G lpadmin pi
sudo cupsctl --remote-any
# enable the daemons
sudo systemctl enable cups
sudo systemctl enable avahi-daemon
#remove the azure cli if installed via apt:
sudo apt remove azure-cli
#install the azure cli with pip:
sudo python3 -m pip install msrest==0.6.21
sudo python3 -m pip install azure.cli
tested on Fedora release 34 (Thirty Four):
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
echo -e "[azure-cli]
name=Azure CLI
baseurl=https://packages.microsoft.com/yumrepos/azure-cli
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc" | sudo tee /etc/yum.repos.d/azure-cli.repo"