Skip to content

Instantly share code, notes, and snippets.

View hermanzdosilovic's full-sized avatar

Herman Zvonimir Došilović hermanzdosilovic

View GitHub Profile
@hermanzdosilovic
hermanzdosilovic / docker-compose.yml
Last active March 18, 2024 10:00
Local Pi-hole
version: "3.8"
services:
pihole:
image: pihole/pihole:2024.02.2
environment:
PIHOLE_DNS_: 1.1.1.3;1.0.0.3
TZ: Europe/Zagreb
WEBPASSWORD: admin
volumes:
@hermanzdosilovic
hermanzdosilovic / install_golang.sh
Last active February 26, 2024 11:45
My script for installing Go.
#!/bin/bash
GO_VERSION=1.22.0 # https://go.dev/dl/
system=$(uname | tr '[:upper:]' '[:lower:]')
arch | grep -i arm &> /dev/null
if [[ $? -eq 0 ]]; then
arch=$(arch)
if [[ "$arch" == "armv7l" ]]; then
arch=armv6l
@hermanzdosilovic
hermanzdosilovic / vlc.sh
Last active October 16, 2019 13:50
Do something useful with VLC.
# Stream camera and microphone feed.
vlc v4l2:///dev/video0 --input-slave alsa://hw:0,0
# Save 5s of camera and microphone feed to file.
timeout 5s cvlc v4l2:///dev/video0 --input-slave alsa://hw:0,0 --sout=file/avi:video.avi
@hermanzdosilovic
hermanzdosilovic / Main.java
Last active January 12, 2018 23:35
Simple Genetic Algorithm written in Java for finding minimum of Rastrigin function
import java.util.Random;
public class Main {
private static final int NUMBER_OF_COMPONENTS = 30;
private static final double MIN_COMPONENT_VALUE = -1;
private static final double MAX_COMPONENT_VALUE = 1;
private static final int POPULATION_SIZE = 30;
private static final int TOURNAMENT_SIZE = 10;
private static final double MUTATION_PROBABILITY = 0.1;