Skip to content

Instantly share code, notes, and snippets.

@zceemja
zceemja / latexcleanup.sh
Created July 19, 2024 14:36
Latex project cleaner
#!/bin/bash -e
# Latex project cleaner.
# This script takes latex project, compacts it into single tex file using latexpand,
# replaces all \tikzsetnextfilename{fname}\begin{tikzpicture} ... \end{tikzpicture} with \includegraphics{prefix/fname},
# figures out which other files are required for making .tex, and puts only those files to a zip file.
#
# Alse see:
# https://ctan.org/pkg/latexpand
# https://github.com/google-research/arxiv-latex-cleaner
@zceemja
zceemja / container.sh
Created June 18, 2024 11:41
Keep same environment for of different linux hosts with different nvidia drivers
#!/bin/bash -e
# This is a script to run a lxroot container on a server, including cuda support
# Check https://github.com/parke/lxroot
#
# The main idea that I have a bunch of servers at university running slightly different versions
# of nvidia driver, python versions and its a real headacke to have one single environment for all of them.
#
# With this script each container gets its own ld.cache.so that links to correct place for nvidia driver.
# This is done by storing cache in ./ld/$hostname/ and binding it to /usr/host/ld/
@zceemja
zceemja / mssh.py
Created June 13, 2024 11:08
Run command over ssh for multiple servers at once, live updates output for given command, one line for each server
#!/usr/bin/env python3
"""
This scripts executes multiple ssh (hence mssh) commands in multiple servers.
Result for each server is printed as a single line.
Steaming is also supported.
Author: [email protected]
"""