Skip to content

Instantly share code, notes, and snippets.

View vsoch's full-sized avatar
💭
rawr

Vanessasaurus vsoch

💭
rawr
View GitHub Profile
#!/bin/bash
# This assumes binding the entire directory with this script and lammps-experiment.yaml
hasGpu="${1:-no}"
path="${2:-./compatibility-spec.json}"
# Note that this is hard coded for amd64, for arm you would wantt o add -arm or ppc64le -ppc
wget --quiet https://github.com/supercontainers/compspec-go/releases/download/1-26-2024-2/compspec
chmod +x compspec
@vsoch
vsoch / hotplug.sh
Last active December 3, 2023 01:04
#!/usr/bin/env bash
for cpunum in $(cat /sys/devices/system/cpu/cpu*/topology/thread_siblings_list | cut -s -d, -f2- | tr ',' '\n' | sort -un)
do
echo 0 > /sys/devices/system/cpu/cpu$cpunum/online
done
@vsoch
vsoch / entrypoint.sh
Last active November 30, 2023 21:48
Testing script for oras operator
#!/bin/bash
echo "Expecting: <pull-from> <push-to>"
echo "Full provided set of arguments are $@"
# The command is the remainder of the script $@
pushto="${1}"
shift
# unpack
@vsoch
vsoch / README.md
Last active October 3, 2023 02:45
What do your pinned (or unpinned) requirements say about you?

What do your Python requirements say about you? 🤔

I like living dangerously

I am possibly bleeding right now.

coreapi
Django
@vsoch
vsoch / main.go
Last active October 13, 2021 04:12
Embedded fields in structs
package main
import (
"fmt"
)
type Fruit struct {
Name string
Color string
}
name: generate-site
on:
pull_request: []
push:
branches:
- "main"
jobs:
Update:
@vsoch
vsoch / singularity-hub-badge.md
Created April 26, 2021 18:45
How to generate the Singularity Hub Archive Badge!

https://singularityhub.github.io/singularityhub-docs/assets/img/hosted-singularity--hub-%23e32929.svg

@vsoch
vsoch / dinosaur.lp
Last active March 21, 2021 17:31
My first logic program - am I a dinosaur (requires clingo)
% clingo dinosaur.lp
% These are blanket facts, statements that each of these is living
% I think these are called atoms
living(vanessa).
living(fernando).
living(maria).
% This tells use size of arms for each living thing
armsize(vanessa, "small").
armsize(fernando, "large").
@vsoch
vsoch / decorators.py
Created December 3, 2020 20:01
An example for how to customize login-required (in this case, to use a session based token instead)
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.shortcuts import render, resolve_url
from myapp.settings import cfg
from myapp import settings
from urllib.parse import urlparse
import uuid
def login_is_required(
@vsoch
vsoch / snakemake-debugging.sh
Created October 20, 2020 16:52
Snakemake Debugging on Google Cloud
# This is a small script (that typically I copy paste) on a Google Cloud instance
# to set up an environment to mimic a worker. It includes installing snakemake,
# retrieving a package with the working directory (which typically has the
# version of snakemake I aim to develop or debug, and then interactively debugging
# or doing this.
sudo apt-get install -y wget bzip2 ca-certificates gnupg2 git
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
sudo chown -R $USER /opt
bash Miniconda3-latest-Linux-x86_64.sh -b -p /opt/conda