Skip to content

Instantly share code, notes, and snippets.

@jpaulickcz
jpaulickcz / remove-old-kernels.sh
Last active December 30, 2023 16:38 — forked from spyesx/readme.md
Clean up old linux kernels
#!/bin/bash
# Run this script without any param for a dry run
# Run the script with root and with exec param for removing old kernels after checking
# the list printed in the dry run
# bash <(curl -Ls "https://gist.github.com/jpaulickcz/721ad60ad28bb7875a5689defe005305/raw/?clean-kernels-$(date +%s)")
# Function to get disk usage in MB
get_disk_usage() {
@jpaulickcz
jpaulickcz / ESP8266_DS18B20_MQTT.ino
Created December 18, 2022 13:40
Publish DS18B20 sensor readings over MQTT with a ESP8266/Wemos D1 Mini board
// LIBRARIES
#include <ESP8266WiFi.h> // Library for connecting to a WiFi network
#include <PubSubClient.h> // Library for MQTT communication
#include <OneWire.h> // Library for interacting with 1-Wire devices
#include <DallasTemperature.h> // Library for reading temperature from Dallas Temperature sensors
// Define the pin number that the 1-Wire bus is connected to
#define ONE_WIRE_BUS 2
// WIFI SETTINGS
@jpaulickcz
jpaulickcz / macOS-oneliners.md
Created December 2, 2022 07:05
macOS one liners
# Check if app is running and if not, open it
pgrep PhotoSync >/dev/null 2>&1; if [ $? -eq 0 ]; then :; else open /Applications/PhotoSync.app; fi
@jpaulickcz
jpaulickcz / twitter-related-tweets.sh
Last active December 23, 2022 14:46
uBlock Origin - hide the unrelated "Related Tweets" (ex "More Tweets")
@jpaulickcz
jpaulickcz / 00_ender_3_pro_cura_start_end_gcodes_readme.md
Last active March 17, 2022 08:48
Ender 3 Pro - Cura START and END gcodes
@jpaulickcz
jpaulickcz / octoprint-menubar-progress.sh
Created November 17, 2021 18:26
OctoPrint progress in menubar on macOS with TextBar
#!/bin/bash
# Simple script to show print progress in the menu bar on MacOS via the app TextBar. Requires jq (brew install jq).
# TextBar: http://richsomerfield.com/apps/textbar/
# Settings
APIKEY=14F42AFCE3C64BAEA1A970FF67921A56
OCTOPRINT_IP=192.168.15.177
# The rest
# based on https://github.com/crazy-max/WindowsSpyBlocker/blob/master/data/hosts/spy.txt
# edit for pihole/adguard
a.ads1.msn.com
a.ads2.msads.net
a.ads2.msn.com
a.rad.msn.com
ac3.msn.com
activity.windows.com
adnexus.net
@jpaulickcz
jpaulickcz / ESP8266_HTU21D_MQTT.ino
Last active February 4, 2021 17:11
Publishing data from HTU21D over MQTT with ESP8266
// Get ESP8266 going with Arduino IDE
// - https://github.com/esp8266/Arduino#installing-with-boards-manager
// Required libraries (sketch -> include library -> manage libraries)
// - PubSubClient by Nick ‘O Leary
// - DHT sensor library by Adafruit
// also based on https://gist.github.com/balloob/1176b6d87c2816bd07919ce6e29a19e9 (?)
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
@jpaulickcz
jpaulickcz / removeNonEnglish.py
Last active February 10, 2021 10:28 — forked from majora2007/removeNonEnglish.py
Removes foreign language audio and subtitle tracks from mkv files in bulk. Edited for disposable use on Linux.
#!/usr/bin/python
# Removes non-LANG audio tracks and subtitles from mkv files in a directory.
# Original script by greenbender at https://forum.videohelp.com/threads/343271-BULK-remove-non-English-tracks-from-MKV-container
# Modified by Joseph Milazzo for updated MkvMerge commands.
# Download
# wget https://gist.githubusercontent.com/jpaulickcz/55e07c8d654feaf8618137716fc60bb5/raw/removeNonEnglish.py && chmod +x removeNonEnglish.py && apt install mkvtoolnix -y
# Use