Skip to content

Instantly share code, notes, and snippets.

View Daniel15's full-sized avatar
💭
Busy

Daniel Lo Nigro Daniel15

💭
Busy
View GitHub Profile
@gwww
gwww / disable-entities
Last active March 4, 2024 18:45
Script and config to disable Home Assistant entities and to "template" configurate an MQTT device
#!python3
# Based on: https://community.home-assistant.io/t/api-for-changing-entities/282114/3
import asyncio
import json
import os
import re
import sys
import yaml # type: ignore
import websockets
@melroy89
melroy89 / mastodon-docker-setup.md
Last active March 19, 2024 18:24 — forked from akuechl/mastodon-docker-setup.md
Mastodon Docker Setup - most complete and easiest guide online
@softworkz
softworkz / ReadMe.md
Last active February 11, 2023 17:22
Generate M3U Playlist for SiliconDust HDHomerun Tuners

SYNOPSIS

Creates an M3U playlist for an HDHomerun tuner

DESCRIPTION

Downloads the lineup from an HDHR tuner, specified by IP address and transforms it into an M3U plalist

When you don't specify an output file, the m3u content will be printed out for preview.
#!/usr/bin/env bash
name=fooAlert-$RANDOM
url='http://localhost:9093/api/v1/alerts'
bold=$(tput bold)
normal=$(tput sgr0)
generate_post_data() {
cat <<EOF
[{
@Daniel15
Daniel15 / _README.md
Last active August 29, 2023 21:33
Routing scripts for Tinc

This Gist contains some scripts for Tinc, in order to configure the routing tables for a remote subnet on Windows (ie. if a remote system wants to expose an entire subnet over the VPN). Tinc does not configure the routing tables by default, which is why these scripts are needed. See the mailing list thread here: https://www.tinc-vpn.org/pipermail/tinc/2018-December/005340.html

Place the files in the Tinc network directory (eg. C:\Program Files\Tinc\netname\) and change $interface in functions.ps1 to match the name of the Tinc interface configured in tinc.conf

import sys
import extract_icon
import os
import argparse
class MorIcons:
"""
parses an ``APPS.INF`` file, dumps all icons from a PE binary and
generates an HTML file with all the icons and associated program
names
@gaearon
gaearon / prepack-gentle-intro-1.md
Last active February 13, 2024 14:30
A Gentle Introduction to Prepack, Part 1

Note:

When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.

A Gentle Introduction to Prepack (Part 1)

If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:

  • Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.
@cherti
cherti / alert.sh
Created December 9, 2016 13:47
send a dummy alert to prometheus-alertmanager
#!/bin/bash
name=$RANDOM
url='http://localhost:9093/api/v1/alerts'
echo "firing up alert $name"
# change url o
curl -XPOST $url -d "[{
\"status\": \"firing\",
@iamarcel
iamarcel / Structuring Neat .NET Core Command Line Apps Neatly.org
Created September 7, 2016 07:30
Structuring Neat .NET Core Command Line Apps Neatly
@iamarcel
iamarcel / Creating Neat .NET Core Command Line Apps.md
Last active November 28, 2023 10:41
Creating Neat .NET Core Command Line Apps

Creating Neat .NET Core Command Line Apps

You can now read this on my (pretty) website! Check it out here.

Every reason to get more HackerPoints™ is a good one, so today we're going to write a neat command line app in .NET Core! The Common library has a really cool package Microsoft.Extensions.CommandlineUtils to help us parse command line arguments and structure our app, but sadly it's undocumented.

No more! In this guide, we'll explore the package and write a really neat