Skip to content

Instantly share code, notes, and snippets.

Avatar

Nicola Lunghi nicola-lunghi

  • Dublin, Ireland
View GitHub Profile
@nicola-lunghi
nicola-lunghi / argbash_preamble.m4
Last active Oct 3, 2022
Example of adding a "preamble" to argbash to put code before argbash code.
View argbash_preamble.m4
#!/bin/bash
# m4_ignore(
echo "This is just a script template, not the script (yet) - pass it to 'argbash' to fix this." >&2
exit 11 #)[ <-- needed because of Argbash
###############################################################################
# PREAMBLE
###############################################################################
# Treat expansion of unset variables as an error and exit immediately
# if a command pipeline exits with a non-zero status
set -o nounset -o errexit
@nicola-lunghi
nicola-lunghi / audiofadeandswitch.xml
Last active Oct 3, 2022
Atem mini macro to fade out two audio sources
View audiofadeandswitch.xml
<?xml version="1.0" encoding="UTF-8"?>
<Profile majorVersion="1" minorVersion="5" product="ATEM Mini">
<MacroPool>
<Macro index="0" name="DEFAULT all OFF" description="">
<Op id="FairlightAudioMixerMasterOutFaderGain" gain="0"/> <Op id="MacroSleep" frames="1"/>
<Op id="FairlightAudioMixerMasterOutFaderGain" gain="-5"/> <Op id="MacroSleep" frames="1"/>
<Op id="FairlightAudioMixerMasterOutFaderGain" gain="-10"/> <Op id="MacroSleep" frames="1"/>
<Op id="FairlightAudioMixerMasterOutFaderGain" gain="-15"/> <Op id="MacroSleep" frames="1"/>
<Op id="FairlightAudioMixerMasterOutFaderGain" gain="-20"/> <Op id="MacroSleep" frames="1"/>
<Op id="FairlightAudioMixerMasterOutFaderGain" gain="-25"/> <Op id="MacroSleep" frames="1"/>
@nicola-lunghi
nicola-lunghi / mult.py
Last active Aug 18, 2021
Print multiplication table in python
View mult.py
"""
Print
1 2 3 4 5 6 7 8 9
2 4 6 8 10 12 14 16 18
3 6 9 12 15 18 21 24 27
4 8 12 16 20 24 28 32 36
5 10 15 20 25 30 35 40 45
6 12 18 24 30 36 42 48 54
7 14 21 28 35 42 49 56 63
View install.sh
#!/bin/sh -eux
distribution=$(. /etc/os-release; echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \
sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
sudo systemctl restart docker