Skip to content

Instantly share code, notes, and snippets.

View Dids's full-sized avatar
🏠
Working from home

Pauli Jokela Dids

🏠
Working from home
View GitHub Profile
@cedriczirtacic
cedriczirtacic / ddclient.service
Last active November 17, 2024 11:10
Systemd ddclient.service
#/usr/lib/systemd/system/ddclient.service
[Unit]
Description=ddclient Service
After=network.target
[Service]
Type=forking
PIDFile=/var/run/ddclient.pid
ExecStart=/sbin/ddclient -pid /var/run/ddclient.pid -file /etc/ddclient/ddclient.conf -daemon 300
ExecStop=/usr/bin/pkill -SIGKILL -P /var/run/ddclient.pid
#ifndef CORE_SCREENSHOT_H_
#define CORE_SCREENSHOT_H_
//------------------------------------------------------------------------------
class Screenshot
{
public:
int id; // thread ID (only used for loggin and debugging)
bool stopflag; // used to "tell" the thread to stop and clean up
std::string file;
SDL_Surface *surface;
@Dids
Dids / GUIDE.md
Last active April 16, 2023 12:28
Conan Exiles dedicated server configuration

For a simple, default server setup, open ports 7777/UDP, and 27015/UDP in your firewall.

  • Port=7777 (game data)
  • QueryPort=27015 (Steam queries)

Be sure to run the server (StartServer.bat) once, so it can generate the initial config files!


It is best to combine this configuration with the batch file setup here (so add the ConanSandboxServer.exe params to a new start.bat file instead)!

@Dids
Dids / C:\steamcmd\install.bat
Last active March 16, 2019 20:42
Conan Exiles dedicated server startup scripts (be sure to checkout the server configuration guide here: https://gist.github.com/Dids/9564a693bb5b40cc0773cf8a5f07b4c1)
@echo off
steamcmd.exe +runscript install.txt
#!/bin/bash
address=https://ilo.mysite.com:34043
username=Administrator
password=********
session_key=$(
curl -fsS \
--insecure \
"$address/json/login_session" \
namespace System.Collections.ObjectModel
{
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Diagnostics;
@jedimstr
jedimstr / identify_drive.sh
Created July 31, 2017 04:28
Identify Drive for unRAID or Linux
#!/bin/bash
export OMIT=0
[ ${DEBUG:=0} -gt 0 ] && set -x -v
declare -a DRIVES MODELS CHOICE
typeset -x DRIVES MODELS CHOICE CMDS
TMPFILE="/tmp/identify_drive.$$"
@mbinna
mbinna / effective_modern_cmake.md
Last active July 20, 2026 09:37
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@grihabor
grihabor / Makefile.version
Last active April 22, 2025 15:01
Makefile to use for incremental semantic versioning
MAKE := make --no-print-directory
DESCRIBE := $(shell git describe --match "v*" --always --tags)
DESCRIBE_PARTS := $(subst -, ,$(DESCRIBE))
VERSION_TAG := $(word 1,$(DESCRIBE_PARTS))
COMMITS_SINCE_TAG := $(word 2,$(DESCRIBE_PARTS))
VERSION := $(subst v,,$(VERSION_TAG))
VERSION_PARTS := $(subst ., ,$(VERSION))
@jonasmalacofilho
jonasmalacofilho / NZXT Kraken X62: USB protocol.md
Last active December 22, 2024 10:51
NZXT Kraken X62: USB protocol

The NZXT Kraken X62

USB analysis and revised protocol for devices with firmware v4.0.2