Skip to content

Instantly share code, notes, and snippets.

View dcasati's full-sized avatar

Diego Casati dcasati

View GitHub Profile
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
name: adcirc-debug
dcasati /
Last active May 24, 2024 10:42
#!/usr/bin/env bash
set -x
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/
dcasati / azure firewall query - deny
Created April 14, 2023 00:23
azure firewall query to show packets that were denied
| 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 / 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
echo -e "[azure-cli]
name=Azure CLI
gpgkey=" | sudo tee /etc/yum.repos.d/azure-cli.repo"
# Use these steps to clear out Github's commit history.
# Useful when moving a repo from private to public
git checkout --orphan newBranch
git add -A # Add all files and commit them
git commit
git branch -D main # Deletes the main branch
git branch -m main # Rename the current branch to main
git push -f origin main # Force push master branch to github
git gc --aggressive --prune=all # remove the old files
dcasati / batch remove azure service principals
Last active January 11, 2022 22:38
batch remove Service Principals not being used
az_rm_sp()(az ad sp list --show-mine -o json --query "[?contains(displayName, '$1')]" | jq -r '.[] | .appId' | xargs -P 4 -n 12 -I % az ad sp delete --id %)
az_rm_sp azure-cli
dcasati /
Last active May 27, 2021 04:30 — forked from fahrstuhl/
Renaming i3 workspaces with while keeping the <number> <letter> prefix for keyboard navigation.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# - Renaming i3 workspaces with while keeping the <number>: <letter> prefix for keyboard navigation.
# Written in 2017 by Fahrstuhl
# To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
# You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see <>.
import i3ipc