This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <CL/cl.hpp> | |
int main(int argc, char *argv[]) { | |
std::vector<cl::Platform> platforms; | |
cl::Platform::get(&platforms); | |
int platform_id = 0; | |
int device_id = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Section "Device" | |
Identifier "intel-gpu" | |
Driver "modesetting" | |
BusID "PCI:0:2:0" | |
VendorName "Intel Corporation" | |
BoardName "UHD Graphics 620" | |
EndSection | |
Section "Device" | |
Identifier "nvidia-gpu" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-License-Identifier: Unlicense | |
import matplotlib.pyplot as plt | |
import numpy as np | |
# Graph Limits | |
Zmin = 1 | |
Zmax = 200 | |
Nmin = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Pi Zero W headless low power config | |
# Disable hardware interfaces | |
dtparam=i2c_arm=off | |
dtparam=i2c_vc=off | |
dtparam=i2s=off | |
dtparam=spi=off | |
# Disable audio | |
dtparam=audio=off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# | |
# SPDX-FileCopyrightText: 2021 Stephan Lachnit <stephanlachnit@debian.org> | |
# | |
# SPDX-License-Identifier: MIT | |
import hashlib | |
import os.path | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Cleans apt-cacher-ng cache | |
# SPDX-FileCopyrightText: 2022 Stephan Lachnit <stephanlachnit@debian.org> | |
# SPDX-License-Identifier: 0BSD | |
systemctl stop apt-cacher-ng | |
rm -rf /var/lib/apt/* | |
rm -rf /var/cache/apt/* | |
rm -rf /var/cache/apt-cacher-ng/ | |
mkdir -p /var/cache/apt-cacher-ng/{headers,import,packages,private,temp} | |
chown apt-cacher-ng:apt-cacher-ng -R /var/cache/apt-cacher-ng |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: Unlicense | |
#include <atomic> | |
#include <chrono> | |
#include <condition_variable> | |
#include <deque> | |
#include <mutex> | |
#include <optional> | |
#include <queue> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-FileCopyrightText: 2023 Stephan Lachnit | |
// SPDX-License-Identifier: MIT | |
#include <streambuf> | |
#include <string> | |
#include <vector> | |
template<class CharT = char, class Traits = std::char_traits<CharT>> | |
class vecbuf : public std::basic_streambuf<CharT> { | |
public: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-FileCopyrightText: 2023 Stephan Lachnit <stephanlachnit@debian.org> | |
// SPDX-License-Identifier: MIT | |
#include <algorithm> | |
#include <cstdlib> | |
#include <ios> | |
#include <streambuf> | |
// std::streambuf implementation in memory with efficient resizing and possibility to keep the buffer after exit | |
template<std::streamsize BLOCK_SIZE = 1024> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# SPDX-License-Identifier: Unlicense | |
import numpy as np | |
import matplotlib.pyplot as plt | |
# Data from https://doi.org/10.1002/pip.4670030303 | |
# wavelength in nm, alpha in cm^-1, abs length in um | |
wavelength = np.linspace(250, 1450, num=121) | |
alpha = np.array([1.84e+06,1.97e+06,2.18e+06,2.36e+06,2.24e+06,1.73e+06,1.44e+06,1.28e+06,1.17e+06,1.09e+06,1.04e+06,1.02e+06,6.97e+05,2.93e+05,1.50e+05,9.52e+04,6.74e+04,5.00e+04,3.92e+04,3.11e+04,2.55e+04,2.10e+04,1.72e+04,1.48e+04,1.27e+04,1.11e+04,9.70e+03,8.80e+03,7.85e+03,7.05e+03,6.39e+03,5.78e+03,5.32e+03,4.88e+03,4.49e+03,4.14e+03,3.81e+03,3.52e+03,3.27e+03,3.04e+03,2.81e+03,2.58e+03,2.38e+03,2.21e+03,2.05e+03,1.90e+03,1.77e+03,1.66e+03,1.54e+03,1.42e+03,1.30e+03,1.19e+03,1.10e+03,1.01e+03,9.28e+02,8.50e+02,7.75e+02,7.07e+02,6.47e+02,5.91e+02,5.35e+02,4.80e+02,4.32e+02,3.83e+02,3.43e+02,3.06e+02,2.72e+02,2.40e+02,2.10e+02,1.83e+02,1.57e+02,1.34e+02,1.14e+02,9.59e+01,7.92e+01,6.40e+01,5.11e+01,3.99e+01,3.02e+01,2.26e+01,1.63e+01,1.11e+01,8.00e+ |