Skip to content

Instantly share code, notes, and snippets.

View emaballarin's full-sized avatar
🦾
Ingegno c'era nell'allenare congegni!

Emanuele Ballarin emaballarin

🦾
Ingegno c'era nell'allenare congegni!
View GitHub Profile
@emaballarin
emaballarin / lmu.py
Created June 19, 2023 09:41
From (soon to be removed) ebtorch.nn.lmu
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ==============================================================================
#
# Copyright (c) 2019-* Brent Komer. All Rights Reserved.
# [orig. code: https://github.com/bjkomer/pytorch-legendre-memory-unit]
#
#
# Copyright (c) 2019-* Applied Brain Research. All Rights Reserved.
# [orig. work: https://papers.nips.cc/paper/2019/file/952285b9b7e7a1be5aa7849f32ffff05-Paper.pdf;
@emaballarin
emaballarin / gdrivedown.ps1
Created January 17, 2023 13:18
Python function(s) and standalone script, and utility Bash and PowerShell scripts to download shared Google Drive files by ID... and no additional dependencies!
#!/usr/bin/env pwsh
python -O gdrivedown.py $args
@emaballarin
emaballarin / riltozinameran_baseseq.txt
Created January 5, 2023 17:20
BNT162b2 Bivalent (WT/OMI BA.4/BA.5) base sequences
GAGAAYAAAC YAGYAYYCYY CYGGYCCCCA CAGACYCAGA GAGAACCCGC 50
CACCAYGYYC GYGYYCCYGG YGCYGCYGCC YCYGGYGYCC AGCCAGYGYG 100
YGAACCYGAC CACCAGAACA CAGCYGCCYC CAGCCYACAC CAACAGCYYY 150
ACCAGAGGCG YGYACYACCC CGACAAGGYG YYCAGAYCCA GCGYGCYGCA 200
CYCYACCCAG GACCYGYYCC YGCCYYYCYY CAGCAACGYG ACCYGGYYCC 250
ACGYGAYCYC CGGCACCAAY GGCACCAAGA GAYYCGACAA CCCCGYGCYG 300
CCCYYCAACG ACGGGGYGYA CYYYGCCAGC AYCGAGAAGY CCAACAYCAY 350
CAGAGGCYGG AYCYYCGGCA CCACACYGGA CAGCAAGACC CAGAGCCYGC 400
YGAYCGYGAA CAACGCCACC AACGYGGYCA YCAAAGYGYG CGAGYYCCAG 450
YYCYGCAACG ACCCCYYCCY GGACCACAAG AACAACAAGA GCYGGAYGGA 500
@emaballarin
emaballarin / vgpu_license_bypass.sh
Last active November 22, 2022 16:17
Apply and revert some (undocumented) tweaks to programmatically obtain a 24h-long "Unlicensed (Unrestricted)" vGPU status
#!/usr/bin/env bash
if (( $(id -u) != 0 )); then
echo "Please, run the script with SuperUser privileges!"
exit 1
fi
mkdir -p "/etc/modprobe.d"
touch "/etc/modprobe.d/nvidia.conf"
echo 'options nvidia NVreg_RegistryDwords="UnlicensedUnrestrictedStateTimeout=0x5A0;UnlicensedRestricted1StateTimeout=0x5A0"' >> "/etc/modprobe.d/nvidia.conf"
@emaballarin
emaballarin / install_mono_ubuntu.sh
Created October 17, 2022 14:33
Ready-to-use simple script to install the full Mono development environment on Ubuntu 20.04+
sudo apt install gnupg ca-certificates apt-transport-https dirmngr
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/ubuntu vs-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-vs.list
echo "deb https://download.mono-project.com/repo/ubuntu preview-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-preview.list
sudo apt update
sudo apt install mono-devel mono-llvm-support mono-complete referenceassemblies-pcl ca-certificates-mono mono-xsp4
@emaballarin
emaballarin / _ephemeral_gpg_setup_.txt
Created September 23, 2022 22:47
Configuration files to ephemerally set up gpg2 (e.g. for generation of keys to be moved to a secure element, or from a live CD)
Configuration files to ephemerally set up gpg2 (e.g. for generation of keys to be moved to a secure element, or from a live CD)
@emaballarin
emaballarin / anglib_improved.f90
Created September 23, 2022 16:04
Angular momentum coupling coefficients for Q.M., in Fortran 9x
! anglib.f90: Angular momentum coupling coefficients for Q.M., in Fortran 9x
! Copyright (C) 1998 Paul Stevenson (idea, mainline code)
! 2018 Emanuele Ballarin (optimizations, porting)
!
! This library is free software. You can redistribute it and/or modify it
! under the terms of the GNU Lesser General Public License as published by
! the Free Software Foundation, either version 3, or (at your option) any
! later version.
!
! This library is distributed in the hope that it could be useful, but WITHOUT
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-__VERSION.SUBVERSION__ 200 \
--slave /usr/bin/clang++ clang++ /usr/bin/clang++-__VERSION.SUBVERSION__ \
--slave /usr/bin/clang-cpp clang-cpp /usr/bin/clang-cpp-__VERSION.SUBVERSION__ \
--slave /usr/bin/clang-query clang-query /usr/bin/clang-query-__VERSION.SUBVERSION__ \
--slave /usr/bin/clang-format clang-format /usr/bin/clang-format-__VERSION.SUBVERSION__ \
--slave /usr/bin/clang-rename clang-rename /usr/bin/clang-rename-__VERSION.SUBVERSION__ \
--slave /usr/bin/clang-apply-replacements clang-apply-replacements /usr/bin/clang-apply-replacements-__VERSION.SUBVERSION__ \
--slave /usr/bin/clang-format-diff clang-format-diff /usr/bin/clang-format-diff-__VERSION.SUBVERSION__ \
--slave /usr/bin/clang-reorder-fields clang-reorder-fields /usr/bin/clang-reorder-fields-__VERSION.SUBVERSION__ \
--slave /usr/bin/clang-cl clang-cl /usr/bin/clang-cl-__VERSION.SUBVERSION__ \
sudo update-alternatives --install "/usr/bin/jar" "jar" "__JDK__PATH__/bin/jar" 200
sudo update-alternatives --install "/usr/bin/jarsigner" "jarsigner" "__JDK__PATH__/bin/jarsigner" 200
sudo update-alternatives --install "/usr/bin/javac" "javac" "__JDK__PATH__/bin/javac" 200
sudo update-alternatives --install "/usr/bin/javadoc" "javadoc" "__JDK__PATH__/bin/javadoc" 200
sudo update-alternatives --install "/usr/bin/javap" "javap" "__JDK__PATH__/bin/javap" 200
sudo update-alternatives --install "/usr/bin/jcmd" "jcmd" "__JDK__PATH__/bin/jcmd" 200
sudo update-alternatives --install "/usr/bin/java" "java" "__JDK__PATH__/bin/java" 200
sudo update-alternatives --install "/usr/bin/jconsole" "jconsole" "__JDK__PATH__/bin/jconsole" 200
sudo update-alternatives --install "/usr/bin/jdb" "jdb" "__JDK__PATH__/bin/jdb" 200
sudo update-alternatives --install "/usr/bin/jdeprscan" "jdeprscan" "__JDK__PATH__/bin/jdeprscan" 200