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 / description.md
Last active March 1, 2024 15:28
rocket.chat with docker-compose

Rocket.Chat Over HTTPS with Docker Compose

Instructions about how to setup a Rocket.Chat server including a HTTPS reverse proxy with docker-compose.

docker-compose.yaml

mongo:
  image: mongo
@kiview
kiview / docker_on_ubuntu.sh
Last active July 15, 2016 16:48
Small install script for docker on Ubunttu
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
ubuntuVersion=`lsb_release -sr`
case "$ubuntuVersion" in
@kiview
kiview / docker_volume_backup.sh
Last active January 18, 2024 12:25
Docker-Compose volume backup
#!/bin/bash
compose_file_path=$1
project_name=$2
backup_path=$3
function backup_volume {
volume_name=$1
backup_destination=$2
@kiview
kiview / upgrade.yml
Last active November 3, 2023 12:52
Ubuntu upgrade with Ansible
---
- hosts:
- all
become: true
tasks:
- name: Update apt cache
apt: update_cache=yes
- name: Upgrade packages
apt: upgrade=dist
@kiview
kiview / ansible_install.sh
Created January 22, 2017 13:57
Install Ansible on Ubuntu
apt-get install software-properties-common
apt-add-repository ppa:ansible/ansible
apt-get update
apt-get install ansible
@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() {
@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()
}
@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 / ASUS ALC887-VD 5.1 (Ubuntu)
Last active March 31, 2020 07:36
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 / 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