Skip to content

Instantly share code, notes, and snippets.

View vsoch's full-sized avatar
💭
rawr

Vanessasaurus vsoch

💭
rawr
View GitHub Profile
@vsoch
vsoch / index.php
Last active February 15, 2024 05:20
Generate RSS feed for files in a directory folder. Put this file in a folder with files, modify the $allowed_ext variable to customize your extensions, and $feedName, $feedDesc, $feedURL, and $feedBaseURL. Then navigate to the folder on the web to see the xml feed. Done!
<?php
header('Content-type: text/xml');
/*
Runs from a directory containing files to provide an
RSS 2.0 feed that contains the list and modification times for all the
files.
*/
$feedName = "My Audio Feed";
$feedDesc = "Feed for the my audio files in some server folder";
#!/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 / 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 / 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
Last active June 28, 2021 19:11
A quick tutorial on how to generate a Singularity image with loadcaffee
Bootstrap: docker
From: ubuntu:16.04
%runscript
. /torch/install/bin/torch-activate
exec /bin/bash
%labels
MAINTAINER vsochat@stanford.edu
@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