Skip to content

Instantly share code, notes, and snippets.

View craigminihan's full-sized avatar

Craig Minihan craigminihan

View GitHub Profile
@craigminihan
craigminihan / gist:20fa4d0fca8fb9ba4e3b4fcc95fb08a2
Last active June 2, 2025 20:50
Installing and running Roon Server on Debian 12
# execute the following as root
apt-get update
apt-get install -y htop nano git curl wget
apt-get install -y ffmpeg winff libasound2 cifs-utils
export PATH=${PATH}:/usr/sbin
curl -LO https://download.roonlabs.com/builds/roonserver-installer-linuxx64.sh
chmod +x roonserver-installer-linuxx64.sh
./roonserver-installer-linuxx64.sh
@craigminihan
craigminihan / install_kafka.bat
Last active October 2, 2023 14:09
A batch script to install Kafka and Zookeeper on Windows
@echo off
rem ************************************************************
rem Installs Kafka (and Zookeeper) as services and runs them
rem ************************************************************
set NSSM_VER=2.24
set TMP_ROOT=c:\tmp
set OPT_ROOT=c:\opt
set KAFKA_ROOT=%OPT_ROOT%\kafka
@craigminihan
craigminihan / gist:b23c06afd9073ec32e0c
Last active September 21, 2023 12:47
Build GCC 4.9.2 for C/C++ on CentOS 7
sudo yum install libmpc-devel mpfr-devel gmp-devel
cd ~/Downloads
curl ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-4.9.2/gcc-4.9.2.tar.bz2 -O
tar xvfj gcc-4.9.2.tar.bz2
cd gcc-4.9.2
./configure --disable-multilib --enable-languages=c,c++
make -j 4
make install
@craigminihan
craigminihan / couchdb-lucene.init
Created August 16, 2013 15:53
This is a VERY simple script to run couchdb-lucene as a daemon on CentOS 6.x. * Download and rename as couchdb-lucene and place in: /etc/rc.d/init.d * Make it executable: chmod 755 /etc/rc.d/init.d/couchdb-lucene * Add it as a daemon: chkconfig --add couchdb-lucene * Start it: service couchdb-lucene start
#!/bin/sh
#
# This is a VERY simple script to run couchdb-lucene as a daemon on CentOS 6.x
# It is assumed that Java is installed and that couchdb-lucene is present on /usr/local
#
### BEGIN INIT INFO
# Provides: couchdb-lucene
# Short-Description: Starts couchdb-lucene as a daemon
# Description: Starts couchdb-lucene as a daemon
### END INIT INFO
@craigminihan
craigminihan / gist:cb97b2d855e1cd7b50b32c9eabb38779
Last active July 10, 2018 13:20
Windows 2016 Docker Install

Update Windows

Windows 2016 must be updated to the latest version to ensure containers work as expected.

Install Docker

Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Install-Module DockerMsftProvider -Force
Install-Package Docker -ProviderName DockerMsftProvider -Force
Add-MpPreference -ExclusionPath C:\ProgramData\docker\volumes\
@craigminihan
craigminihan / gist:e953ae2d973905baee8e92440dc0a5d1
Created May 2, 2018 09:27
Example interfaces file for balance-alb bonding
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
@craigminihan
craigminihan / gist:229b0ee9dcf4ab6d794c4c8ee1f0d92e
Last active February 9, 2018 05:16
Install GCC-4.9 and LLVM/Clang-3.6 on Ubuntu 12 a bit like Travis CI
# replace your local package mirror if it is borked
#apt-get clean
#sed -i 's/http\:\/\/..\.archive\./http:\/\/us.archive./g' /etc/apt/sources.list
apt-get update
# add launchpad's ppa to apt
apt-get install -y python-software-properties
add-apt-repository -y ppa:ubuntu-toolchain-r/test
apt-get update
@craigminihan
craigminihan / gist:2a169c0ef3550b078e46
Last active January 6, 2018 03:38
Build GCC 4.9.3 on a Raspberry Pi 2b running Raspian 2015-05-05
sudo apt-get install libmpc-dev
sudo apt-get install libmpfr-dev
sudo apt-get install libgmp-dev
export LDFLAGS='-L/usr/lib/arm-linux-gnueabihf/ -L/usr/lib/gcc/arm-linux-gnueabihf/4.6/'
export CFLAGS='-I/usr/include/arm-linux-gnueabihf/ -mfloat-abi=hard '${LDFLAGS}
export CXXFLAGS=${CFLAGS}
export CPPFLAGS=${CFLAGS}
sudo ln -s /usr/lib/arm-linux-gnueabihf/crti.o /usr/lib
@craigminihan
craigminihan / gist:ea6893d63665f0021c92
Last active August 31, 2017 03:06
Script to build Mono 3.10 and MonoDevelop 5.1 on CentOS 6.4+ Minimal
# run me as root
mkdir ~/Downloads
cd ~/Downloads
MONOVERSION="3.10.0"
GECKOSHARPVERSION="2.0-0.12"
yum install wget
using System;
using System.Linq;
namespace TestCodility1
{
class Program
{
public static int move(int[] positions, int[] knownCosts, int maxHop, int start)
{
var minCost = int.MaxValue;