Skip to content

Instantly share code, notes, and snippets.

@coreequip
coreequip / !CO2Monitor.md
Last active December 20, 2025 17:58
A simple Swift CLI tool for macOS that monitors SwitchBot CO2 sensors via Bluetooth.

CO2 Monitor (Swift)

A simple Swift CLI tool for macOS that monitors SwitchBot CO2 sensors via Bluetooth. It periodically checks the air quality and sends a system notification if the CO2 level exceeds a defined threshold (default: 1000 ppm), helping you ensure a healthy indoor environment.

Prerequisites

  • macOS (tested on Tahoe)
  • Xcode Command Line Tools installed (usually present, or install via xcode-select --install)
  • A SwitchBot CO2 sensor (Meter) - https://www.amazon.de/dp/B0DBVDWB6G

Setup

@coreequip
coreequip / free80and443.sh
Last active November 21, 2025 09:52
Frees ports 80 and 443 of your DiskStation and restarts nginx. Run with `sudo`.
#!/bin/bash
sed -i -e 's/80/81/' -e 's/443/444/' /usr/syno/share/nginx/server.mustache /usr/syno/share/nginx/DSM.mustache /usr/syno/share/nginx/WWWService.mustache
synosystemctl restart nginx
@coreequip
coreequip / !BING_POTD.md
Created October 10, 2025 14:15
MacOS-Shell script for changing wallpaper to BING® Picture of the day.

BING® Picture of the day

This is a MacOS shell script for changing wallpaper to BING® Picture of the day.

Place the shell script into: ~/Pictures/Bing and the plist into ~/Library/LaunchAgents/.

Run once:

launchd load ~/Library/LaunchAgents/com.user.bing-wallpaper.plist
@coreequip
coreequip / !MicSwitchDetect.md
Last active February 27, 2025 14:04
MicSwitchDetect™ - A little daemon that detect audio input source change and sets the input source back to the users choice.

MicSwitchDetect™

A little daemon that detect audio input source change and sets the input source back to the users choice.

1. Compile mic-switch-detect.swift

swiftc mic-switch-detect.swift
@coreequip
coreequip / Energy-Hamburg.js
Last active June 12, 2024 13:33
Google Apps Script - Energy Hamburg - Last 14 days playlist
const CACHE_TOKEN = 'NRJ14D_TOKEN'
const SPOTIFY_CLIENT_ID = PropertiesService.getScriptProperties().getProperty('CLIENT_ID')
const SPOTIFY_CLIENT_SECRET = PropertiesService.getScriptProperties().getProperty('CLIENT_SECRET')
const REFRESH_TOKEN = PropertiesService.getScriptProperties().getProperty('REFRESH_TOKEN')
const PLAYLIST_ID = PropertiesService.getScriptProperties().getProperty('PLAYLIST_ID')
const ENERGY_HAMBURG_API_URL = 'https://api.nrjnet.de/webradio/playlist/energy/hamburg?day=0&hour=-1';
// fetch a new Spotify access token
function getSpotifyAccessToken() {
let token = CacheService.getScriptCache().get(CACHE_TOKEN);
@coreequip
coreequip / !DimmTrigger.md
Last active October 31, 2024 12:46
DimmTrigger™

DimmTrigger™

A little daemon that detect screen sleep and wakeup and triggers shell script(s) to run an action. Here to toggle the power state of a connected Android TV.

0. Prerquisites

Get ADB for MacOS: brew install android-platform-tools

@coreequip
coreequip / !Generate-HTML.md
Created September 20, 2022 12:57
Generate HTML rollup.js plugin

Generate HTML Rollup.js Plugin

Usage

generateHtml(templatePath, outputFilename, contect, doCompress

Example:

// rollup.config.js plugin part
@coreequip
coreequip / !README.md
Last active February 8, 2022 12:37
FS-Launch - a FirstSprit™ launcher

FS-Launch - a FirstSprit™ launcher

FS-Launch is a powershell script to login, download and run a FirstSpirit config file.

Installing

Just copy the script in a folder of your choice.

Setup

@coreequip
coreequip / i18n-convert.py
Last active September 2, 2020 14:14
Convert a multi-level JSON to a CSV and back
#!/usr/bin/env python3
import csv
import json
import os
import sys
if len(sys.argv) < 2:
print('Usage: {} <convertfile.(json|csv)>'.format(os.path.basename(sys.argv[0])))
exit(0)
@coreequip
coreequip / mumble-muter.go
Last active November 20, 2019 15:31
Listens to the global hotkey MEDIA_PLAY_PAUSE and toggles mumble's self mute.
package main
import (
"fmt"
"os"
"os/exec"
"syscall"
"time"
"unsafe"
)