Skip to content

Instantly share code, notes, and snippets.

View HorlogeSkynet's full-sized avatar

Samuel FORESTIER HorlogeSkynet

View GitHub Profile
@HorlogeSkynet
HorlogeSkynet / minecraft.service
Last active July 2, 2022 17:36
systemd unit file for Minecraft server running against OpenJDK 11
[Unit]
Description=Minecraft Server
Wants=network.target
After=network.target
[Service]
User=minecraft
Nice=5
Restart=on-failure
SuccessExitStatus=0 143
@HorlogeSkynet
HorlogeSkynet / user-overrides.js
Last active February 5, 2024 09:00
HorlogeSkynet's (Arkenfox) User.JS override scripts, for Firefox & Thunderbird
/*
>> HorlogeSkynet's Arkenfox User.JS override preferences <<
Version: v0.10.4
Upstream version: 122.0
Installation : Follow <https://github.com/arkenfox/user.js/wiki/3.2-Applying-Your-Changes#small_orange_diamond-the-solution>.
Note : This is an OVERRIDE script for <https://github.com/arkenfox/user.js>, DO NOT USE IT ALONE.
*/
// Re-enables 'about:home' page for startup landing page and new tabs.
/* 0102 */ user_pref("browser.startup.page", 1);
@HorlogeSkynet
HorlogeSkynet / certificate_authorities
Last active November 8, 2019 18:26
_Minimal_ set of required Certificate Authorities to browse (a part of) the WWW on Mozilla Firefox
# _Minimal_ set of required Certificate Authorities to browse (a part of) WWW on Mozilla Firefox.
# This is based on the incredible work of [@aeris](https://imirhil.fr/).
# The set has been sorted by certificate nickname.
Certificate Nickname Trust Attributes
SSL,S/MIME,JAR/XPI
Amazon Root CA 1 C,,
Baltimore CyberTrust Root C,,
COMODO ECC Certification Authority C,,
@HorlogeSkynet
HorlogeSkynet / update_gitea.sh
Last active November 14, 2023 20:28
Gitea automatic updating script for GNU/Linux
#!/usr/bin/env bash
#
# @HorlogeSkynet's Gitea automatic updating script for GNU/Linux.
#
# Version : v3.0.2
# URL : <https://gist.github.com/HorlogeSkynet/d676b9204869842933169dbe35ed8650>
#
# /!\ A proper Gitea server managed by a systemd service is required /!\
# --> Maintainer one : <https://gist.github.com/HorlogeSkynet/81a3a4ff2ea342dc3a77dc038cbc0e35>
@HorlogeSkynet
HorlogeSkynet / terastation_shutdown.py
Last active November 13, 2023 19:45
A Python script to programmatically shutdown a Buffalo TeraStation NAS
#!/usr/bin/env python3
"""
A Python script to programmatically shutdown a Buffalo TeraStation NAS.
===
Usage documentation :
1. Install dependency : `pip3 install requests`
@HorlogeSkynet
HorlogeSkynet / remove_proxmox_subscription_message.sh
Last active March 20, 2020 16:22
How to remove Proxmox 5 (and later) subscription message ?
#!/usr/bin/env bash
sed -i.bak 's/NotFound/Active/1' /usr/share/perl5/PVE/API2/Subscription.pm
systemctl restart pveproxy.service
@HorlogeSkynet
HorlogeSkynet / test_flask_v1.py
Created August 24, 2018 15:45
Flask v1.X testing example with UNITTEST Python module only
"""Flask v1.x testing class working with UNITTEST Python module."""
# Run this module with :
# `python3 -m unittest test_flask_v1.py`
import os
import tempfile
import unittest
# Import your production module using Flask around here.
@HorlogeSkynet
HorlogeSkynet / docker-compose.yml
Created August 21, 2018 19:11
How to start application container only once MongoDB has finished warming up, running with Docker
version: '2.3'
services:
application:
build: .
depends_on:
database:
condition: service_healthy
@HorlogeSkynet
HorlogeSkynet / generate_html.php
Created June 21, 2018 09:17
How to generate a HTML rendered file as of CakePHP 3 ?
<?php
use Cake\Filesystem\File;
use Cake\View\View;
/* ... */
// Instanciates a new View class.
$view = new View();
@HorlogeSkynet
HorlogeSkynet / ResetMock.py
Last active February 17, 2019 09:58
How to reset a mocked object during test in Python 3 ?
#!/usr/bin/env python3
import unittest
from subprocess import check_output
from unittest.mock import patch
class YourClass(object):
def __init__(self):