Skip to content

Instantly share code, notes, and snippets.

View kiview's full-sized avatar
💡
Science 🔬 + FLOSS 🐧 = 💖

Kevin Wittek kiview

💡
Science 🔬 + FLOSS 🐧 = 💖
View GitHub Profile
@kiview
kiview / Pipfile
Last active April 11, 2021 04:46
Installing BindsNET on Windows
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
torch = "===1.7.1"
install = "*"
@kiview
kiview / books.md
Last active December 23, 2024 09:39
Software Engineering Reading List

Since I sometimes get asked about what I would recommend as reads to gain a deeper understanding about software engineering, I was thinking to just compile a list of my favourite books in this area, which I consider a very valuable read 🙂

Object Oriented Programming

Design Patterns: Elements of Reusable Object-Oriented Software

By Gamma et. al.

I think this is one of the classics and a very recommended read (but with a pinch of salt), basically, one of the books starting the patterns movement in OOP. While one has to be careful to not blindly force those patterns into your own software design, it is critical knowledge and part of the cultural backbone of the software industry. Knowing those patterns and being able to quickly identify them helps tremendously in understanding unfamiliar code bases and when having architecture discussions with peers.

Code Complete

@kiview
kiview / video_merge.py
Created January 21, 2021 19:09
Add overlay text to videos and concat them to single video using ffmpeg
#!/usr/bin/env python3
import os, glob
def write_text(input, output, text):
cmd = f"ffmpeg -i {input} -vf drawtext=\"fontfile=/path/to/font.ttf: text='{text}': fontcolor=white: fontsize=42: box=1: [email protected]: boxborderw=5: x=(w-text_w)/2: y=100\" -codec:a copy {output}"
print(cmd)
os.system(cmd)
def merge_videos(folder):
with open('./input.txt', 'a') as input_file:
@kiview
kiview / acc_ubuntu_oracle.md
Created November 1, 2020 20:24
Setup descriptions for acc game server with accweb in Oracle Cloud on Ubuntu

Create computing instance (e.g. VM.Standard2.1)

Install wine apt install wine

Copy accServer.exe to ~/accServer/accServer.exe

Download accweb release https://github.com/assetto-corsa-web/accweb/releases/download/1.11.2/accweb_1.11.2.zip

@kiview
kiview / EthereumTransactionExtractor.java
Created June 15, 2020 06:49
Extract historic Ethereum transactions using web3j
public class EthereumTransactionExtractor implements AutoCloseable {
private final WebSocketService webSocketService;
private final Web3j web3j;
private final ObjectMapper mapper = new ObjectMapper();
private final JsonGenerator jsonGenerator;
public EthereumTransactionExtractor(String url, String fileName) throws IOException {
webSocketService = new WebSocketService(url, false);
@kiview
kiview / stream-gpu.sh
Created May 27, 2020 10:45
Stream and record a webcam with gstreamer usinc NVIDIA hardware encoding for saving the recording
GST_PLUGIN_PATH=$GST_PLUGIN_PATH:/usr/local/lib/gstreamer-1.0/ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw, format=UYVY, width=1920, height=1080, framerate=60/1 ! tee name=t ! queue ! videobalance saturation=0.0 ! videoflip method=horizontal-flip ! timeoverlay halignment=center valignment=center ! videobox top=200 bottom=200 left=355 right=355 ! videoscale! videoconvert ! autovideosink t. ! queue ! videoconvert ! nvh264enc ! h264parse ! flvmux ! filesink location=recording-gpu.flv -e
@kiview
kiview / ASUS ALC887-VD 5.1 (Ubuntu)
Last active June 10, 2025 17:05
5.1 sound for ASUS ALC887-VD onboard audio in Ubuntu
Model: ALC887-VD
head -n 1 /proc/asound/card0/codec*
Codec: Realtek ALC887-VD
zless /usr/share/doc/alsa-base/driver/HD-Audio-Models.txt.gz
asus 3-jack (ASUS Mobo)
Edit:
/etc/modprobe.d/alsa-base.conf
@kiview
kiview / disable-nvidia.sh
Last active February 5, 2021 22:40
Dell XPS 15 9570 - Fedora 29
# Since out of the box support of nvidia is sketchy, I've done these things to disable nvidia completey.
# Disable nouveau driver
vim /etc/default/grub
# -> Disable nouveau, also use s3 as default suspend mode
# GRUB_CMDLINE_LINUX="resume=/dev/mapper/fedora-swap rd.lvm.lv=fedora/root rd.luks.uuid=my-id rd.lvm.lv=fedora/swap rhgb quiet nouveau.modeset=0 mem_sleep_default=deep"
grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
@kiview
kiview / day1_1.groovy
Last active December 15, 2017 09:43
Advent of Code 2017
def calcDigitSum(String digits) {
digits.collect {it}.withIndex().collect { String entry, int i ->
def nextIndex = (i < digits.length() - 1) ? i + 1 : 0
String nextDigit = digits[nextIndex]
(entry == nextDigit) ? Integer.parseInt(entry) : 0
}.sum()
}
@Bean
KTable reportStream(StreamsBuilder builder, Engine engine) {
def stream = builder.stream(topic)
.groupBy({ key, word -> word })
.windowedBy(SessionWindows.with(TimeUnit.SECONDS.toMillis(1)))
.aggregate(
new Initializer<Long>() {
@Override
Long apply() {