Skip to content

Instantly share code, notes, and snippets.

View jaantollander's full-sized avatar

Jaan Tollander de Balsch jaantollander

View GitHub Profile
@luraess
luraess / alltoall_test_cuda.jl
Last active July 19, 2023 08:24
CUDA-aware MPI test
using MPI
using CUDA
MPI.Init()
comm = MPI.COMM_WORLD
rank = MPI.Comm_rank(comm)
size = MPI.Comm_size(comm)
dst = mod(rank+1, size)
src = mod(rank-1, size)
println("rank=$rank, size=$size, dst=$dst, src=$src")
N = 4
@luraess
luraess / alltoall_test_cuda_multigpu.jl
Last active July 19, 2023 08:24
CUDA-aware MPI multi-GPU test
using MPI
using CUDA
MPI.Init()
comm = MPI.COMM_WORLD
rank = MPI.Comm_rank(comm)
# select device
comm_l = MPI.Comm_split_type(comm, MPI.COMM_TYPE_SHARED, rank)
rank_l = MPI.Comm_rank(comm_l)
gpu_id = CUDA.device!(rank_l)
# select device
@luraess
luraess / alltoall_test_rocm_multigpu.jl
Last active July 19, 2023 08:18
ROCm-aware (AMDGPU) MPI multi-GPU test
using MPI
using AMDGPU
MPI.Init()
comm = MPI.COMM_WORLD
rank = MPI.Comm_rank(comm)
# select device
comm_l = MPI.Comm_split_type(comm, MPI.COMM_TYPE_SHARED, rank)
rank_l = MPI.Comm_rank(comm_l)
device = AMDGPU.device_id!(rank_l+1)
gpu_id = AMDGPU.device_id(AMDGPU.device())
@luraess
luraess / alltoall_test_rocm.jl
Last active July 19, 2023 08:20
ROCm-aware (AMDGPU) MPI test
using MPI
using AMDGPU
MPI.Init()
comm = MPI.COMM_WORLD
rank = MPI.Comm_rank(comm)
size = MPI.Comm_size(comm)
dst = mod(rank+1, size)
src = mod(rank-1, size)
println("rank=$rank, size=$size, dst=$dst, src=$src")
N = 4
@jeffreyscarpenter
jeffreyscarpenter / cqlsh_intro.cql
Last active May 1, 2024 03:06
Introduction to CQL / cqlsh
#
# cqlsh_intro.cql
#
# Copyright (C) 2017 Jeff Carpenter
# Execute the commands in this file for a short guided tour of the CQL Shell (cqlsh)
#
# For more description, see Cassandra, The Definitive Guide 2nd Ed., Chapter 3: Installing
# http://shop.oreilly.com/product/0636920043041.do
#
@huntrar
huntrar / full-disk-encryption-arch-uefi.md
Last active May 2, 2024 11:04
Arch Linux Full-Disk Encryption Installation Guide [Encrypted Boot, UEFI, NVMe, Evil Maid]

Arch Linux Full-Disk Encryption Installation Guide

This guide provides instructions for an Arch Linux installation featuring full-disk encryption via LVM on LUKS and an encrypted boot partition (GRUB) for UEFI systems.

Following the main installation are further instructions to harden against Evil Maid attacks via UEFI Secure Boot custom key enrollment and self-signed kernel and bootloader.

Preface

You will find most of this information pulled from the Arch Wiki and other resources linked thereof.

Note: The system was installed on an NVMe SSD, substitute /dev/nvme0nX with /dev/sdX or your device as needed.

@Oblynx
Oblynx / flatten_nested_multidim.jl
Last active August 20, 2020 19:49
Flatten multidimensional nested array in Julia
## SUMMARY ##
# Let `a` be the nested array and `aref` the multidim array we want to recreate:
julia> flatten(x::Array{<:Array,1})= Iterators.flatten(x)|> collect|> flatten
flatten (generic function with 1 method)
julia> flatten(x::Array{<:Number,1})= x
flatten (generic function with 2 methods)
julia> reshape(flatten(a), (4,4,3)) == aref
@HardenedArray
HardenedArray / Efficient UEFI Encrypted Root and Swap Arch Linux Installation Procedure with an ENCRYPTED BOOT
Last active February 2, 2024 19:20
Efficient UEFI Encrypted Root and Swap Arch Linux Installation with an ENCRYPTED BOOT
# OBJECTIVE: Install Arch Linux with encrypted root and swap filesystems with an ENCRYPTED BOOT and boot from UEFI. We will
also decrypt and mount our entire encrypted system using a single LUKS passphrase entry.
# Note: This method supports both dedicated Arch installs and those who wish to install Arch on a multi-OS-UEFI booting system.
# External USB HDD/SSD Installers Notes: Encrypted Arch installs can be booted and run from an external USB HDD or SSD, but
# only when the installation is correctly set up. There are several necessary changes to my standard procedure you'll want
# to make during the install process. Read my External USB HDD/SSD Installation section below before proceeding.
@fnky
fnky / ANSI.md
Last active May 4, 2024 22:07
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active May 4, 2024 05:06
set -e, -u, -o, -x pipefail explanation