Skip to content

Instantly share code, notes, and snippets.

View skoky's full-sized avatar

Laco Skokan skoky

View GitHub Profile
@skoky
skoky / docker-compose.yml
Last active January 23, 2021 07:53 — forked from Wavefarer42/docker-compose.yml
MongoDB Charts (docker-compose)
version: "3.3"
services:
mongo:
image: mongo:4.1.1
restart: on-failure
command: --wiredTigerCacheSizeGB 3
ports:
# Charts db is available under port 27018 to not block the default mongo port
- "8082:8081"
@skoky
skoky / build.gradle
Last active April 5, 2020 07:44
SolarPower web server - copies Derby database, reads solar power status and publishes to local web server every minute. Compatible with SolarPower 1.14
apply plugin: 'kotlin'
apply plugin: 'application'
mainClassName = 'MainKt'
buildscript {
ext.kotlin_version = '1.3.71'
repositories {
mavenCentral()
}
@skoky
skoky / gist:9b8e5cff7f643953ca18e20e879c1322
Last active November 12, 2017 19:44
Listing systemd service restarts since yesterday
journalctl -u my.service --since yesterday | grep Starting
@skoky
skoky / streaming.sh
Created December 29, 2016 10:37 — forked from brodul/streaming.sh
Twitch.tv script for streaming
#! /bin/bash
# originaly from http://tinyurl.com/twitch-linux from taladan
# www.youtube.com/user/taladan
# gist created by brodul
INRES="1280x800" # input resolution
#OUTRES="1024x640" # Output resolution
OUTRES="800x500" # Output resolution
@skoky
skoky / youtube.sh
Created December 27, 2016 19:52 — forked from xurizaemon/youtube.sh
Streaming to YouTube from Raspberry Pi via avconv with a Microsoft HD-3000 LifeCam.
#!/bin/bash
KEY=YOUR.KEYG-OESR-IGHT-HERE
URL=rtmp://a.rtmp.youtube.com/live2
while true ; do
avconv -ar 44100 -ac 2 -f s16le -i /dev/zero -f video4linux2 -s 640x360 -r 10 -i /dev/video0 -f flv "$URL/$KEY"
sleep 3
done
@skoky
skoky / gist:5044da1c34a28fde6b4a6b2d032bbc7e
Last active September 12, 2016 09:23
Split string by 2 characters in Scala - simple, functional, great :)
def spl(s:String) : List[String] = {
if (s.length>0) {
val x = s.splitAt(2)
x._1 :: spl(x._2)
} else Nil
}
val x = spl("010203")
>>>> x: List[String] = List(01, 02, 03)