Skip to content

Instantly share code, notes, and snippets.

@70p4z
70p4z / ddwrt_MAC_timelimit.sh
Last active February 14, 2024 12:50
DDWRT Parental Control Time Limit
#!/bin/sh
# This file is a Startup Script for DDWRT to enable setting timelimit for a given list of MAC address
# Sometimes soon, I'll add the modification to have it limiting all MAC by default, and add some exclusion for
# Specific MAC. Modification shall not be that complex though.
#
# How it works
# ============
# Basically, the script relies on a configuration file (which is defined within the script, because ddwrt not writable root FS).
# This file holds a MAC address and a list of 7 minute limit one for each of the week's day, starting on monday.
# On startup, and for each registered MAC address, the scripts registers an ACCEPT rule to monitor exchanged packets for the given MAC address.
@70p4z
70p4z / Home assistant no-wear docker compose
Last active July 18, 2023 20:52
Home assistant without wearing
After a few times trying, I finally wrote a docker-compose for home assistant that does not generate wear of the device, aside from longterm configuration.
```
version: '3'
services:
homeassistant:
container_name: homeassistant
image: "ghcr.io/home-assistant/home-assistant:stable"
read_only: false
tmpfs:
@70p4z
70p4z / gitlab_runner_setup_sudo.sh
Last active April 18, 2023 07:42
gitlab runner docker-compose based sudo setup script (after gitlab runner image setup/update)
#!/bin/bash
container=`docker-compose ps | tail -n1 | cut -f1 -d' '`
docker exec -it $container apt update
docker exec -it $container apt install -y -qq sudo
docker exec -it $container bash -c 'echo "gitlab-runner ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers'
@70p4z
70p4z / gist:d7a2960a7d1bf3140c8b86432743dbd5
Last active August 13, 2021 19:04
Sublime text rebuild last makefile
Dear folks,
TL;DR: build/rebuild the lastly built makefile
I'm working on a regular basis with multiple project inside sublime, and I don't quite like having a huge number of windows.
So the the project feature does not really fit my need for building projects.
Instead I came up with a really cranky bash+sublime to be able to relaunch the last built makefile without having to navigate to the makefile with the current view.
If anyone has a more standard way of polishing this out, I'm eager to learn! Although my sole constraint is one window, and no project context (code-skyzophrenia has some advantages :p)
```