Skip to content

Instantly share code, notes, and snippets.

@careyi3
careyi3 / README.md
Last active May 2, 2024 11:59
Arduino PID Implementation

Arduino PID

This is a basic implementation of a PID controller on an Arduino.

system_diagram

To replicate this, wire up the system as shown below:

system_diagram

@muhdiboy
muhdiboy / lastfm-automated-remove-duplicates.md
Last active May 2, 2024 11:59
LastFM automated duplicate scrobble deletion script

Why would I need this?

Your scrobbler might have decided to scrobble every song hundreds of times, and you can't really remove those scrobbles efficiently. Or you might have accidentally installed multiple scrobbler extensions at the same time - wondering why multiple scrobbles appear for every song played at a time - and you want to clear them after finding the issue.

Using this script still doesn't necessarily make the process quick since Last.fm only displays a limited number of scrobbles that can be removed on each page of your library. However unlike the implementation of @sk22 and its forks, this UserScript, which is derived from those scripts, is run once. The rest of the process is automated and the script will stop at the page you have set using the prompt.

Installation

Prerequisites

@goll
goll / README.md
Last active May 2, 2024 11:59
Docker nftables configuration for Debian 10
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active May 2, 2024 11:58
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
{-# language ApplicativeDo #-}
{-# language LambdaCase #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE InstanceSigs #-}
-- not sure if this is all extensions or all these extensions are needed, just pasting from the file
module VerifySchema where
@s-leon
s-leon / up
Last active May 2, 2024 11:56
oS TW update script
#!/bin/bash
sudo -s <<EOF
zypper dup -l -y --no-recommends --allow-downgrade --allow-arch-change --force-resolution
flatpak update -y --noninteractive --force-remove
flatpak remove --unused --delete-data -y
#flatpak repair
journalctl --rotate
journalctl --vacuum-time=2d
zypper clean
rm -rfv /var/tmp/flatpak-cache-*
@AnatomicJC
AnatomicJC / android-backup-apk-and-datas.md
Last active May 2, 2024 11:53
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

Note: This gist may be outdated, thanks to all contributors in comments.

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

@fvisin
fvisin / tensorflow_rename_variables.py
Last active May 2, 2024 11:51 — forked from batzner/tensorflow_rename_variables.py
Small python script to rename variables in a TensorFlow checkpoint
# Adapted from https://gist.github.com/batzner/7c24802dd9c5e15870b4b56e22135c96
import getopt
import sys
import tensorflow as tf
usage_str = ('python tensorflow_rename_variables.py '
'--checkpoint_dir=path/to/dir/ --replace_from=substr '
'--replace_to=substr --add_prefix=abc --dry_run')
find_usage_str = ('python tensorflow_rename_variables.py '
@plmcgrn
plmcgrn / sonos-udm-mutiple-networks.md
Last active May 2, 2024 11:51
Unifi UDM and Sonos home theater with multiple VLAN's

Overview

This goal of this setup is to put the Sonos speakers on an untrusted network to keep all but the required traffic away from the trusted network where devices like personal computers, phones, etc. live. This write-up assumes you already have two networks setup and working.

Important Note on Unifi OS 3.x

UI broke cross-VLAN multicast DNS in this version. See below for steps to install the multicast-relay script to re-enable this. Without it, your Sonos controller app will not be able to discover your speakers on the other VLAN.

System

I have a Sonos Playbar, Sub, and 2 Play:3's as rear surrounds as one home theater setup connected to a UDM (non-Pro, but this should work on Pro too). Some of this setup may be easier for people with non-paired speakers, as Sonos does some shenanigans with which speaker is actively sending traffic to your wifi.

@L3viathan
L3viathan / atomic_contextmanager.py
Last active May 2, 2024 11:49
Go backwards in time when something went wrong
import os
import sys
import inspect
import signal
from contextlib import contextmanager
def _kill_self(signum, frame):
os._exit(0)
@contextmanager