Skip to content

Instantly share code, notes, and snippets.

@noestreich
noestreich / dark.css
Created October 22, 2019 06:12
Dark mode in a website with CSS
@media (prefers-color-scheme: dark) {
body {
background-color: #444;
color: #e4e4e4;
}
a {
color: #e39777;
}
img {
filter: grayscale(30%);
@bse666
bse666 / mpc_add
Last active May 5, 2019 20:45
add random song from mpd
#!/bin/bash
# stdin check
if (( "$#" < 2 )); then
echo "Usage: `basename $0` HOSTNAME MIN_PLAYLIST_LENGTH PLAYLIST [NEXT_ON_ERROR (y/N)]"
exit 65
fi
# variables
host=$1
@gaieges
gaieges / kubernetes-the-hard-way.md
Last active August 12, 2023 12:58
Kubernetes the hardway, concatenated for reading on offline ipad. Copyright kelseyhightower: https://github.com/kelseyhightower/kubernetes-the-hard-way

Kubernetes the hard way © Kelsey Hightower

Prerequisites

Google Cloud Platform

This tutorial leverages the Google Cloud Platform to streamline provisioning of the compute infrastructure required to bootstrap a Kubernetes cluster from the ground up. Sign up for $300 in free credits.

Estimated cost to run this tutorial: $0.22 per hour ($5.39 per day).

@alexellis
alexellis / k8s-pi.md
Last active April 11, 2024 14:17
K8s on Raspbian
@alirobe
alirobe / reclaimWindows10.ps1
Last active June 7, 2024 16:24
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@bahmutov
bahmutov / Docker shell commands.sh
Last active February 9, 2024 07:55
A personal cheat sheet for running local Node project in a Docker container
# See list of docker virtual machines on the local box
$ docker-machine ls
NAME ACTIVE URL STATE URL SWARM DOCKER ERRORS
default * virtualbox Running tcp://192.168.99.100:2376 v1.9.1
# Note the host URL 192.168.99.100 - it will be used later!
# Build an image from current folder under given image name
$ docker build -t gleb/demo-app .
@jstutters
jstutters / zfs_cleanup.sh
Last active May 19, 2024 19:52
Find and delete multiple ZFS snapshots
zfs list -t snapshot -H -o name | grep "201509[0-9].*" | xargs -n1 echo
# zfs list -t snapshot -H -o name | grep "201509[0-9].*" | xargs -n1 zfs destroy
@teffalump
teffalump / README.md
Last active June 16, 2024 18:43
OpenWRT adblock implementation

Others have recently developed packages for this same functionality, and done it better than anything I could do. Use the packages instead of this script:

Description

In its basic usage, this script will modify the router such that blocked addresses are null routed and unreachable. Since the address blocklist is full of advertising, malware, and tracking servers, this setup is generally a good thing. In addition, the router will update the blocklist weekly. However, the blocking is leaky, so do not expect everything to be blocked.

@razius
razius / run-once.sh
Last active December 26, 2015 12:19
Check if a command is running already, if not start it with the provided arguments.
#!/bin/bash
# Check if a command is running already, if not start it with the provided arguments.
#
# Example:
# This will check if thunar is already running if not it will start it with the --daemon argument.
# ./run-once.sh thunar --daemon
#
# I use it for my awesomewm autostart script which is available here:
# https://github.com/razius/awesomewm/blob/master/autostart.sh
@nathanharper
nathanharper / tmux_irssi_niclist.sh
Last active October 29, 2018 08:39
A quick attempt to automate opening up a tmux session with Irssi and its nicklist.pl running.
#!/usr/bin/env bash
# This should work whether you are already in a TMUX session or not...
# Irssi directory is assumed to be in the user's home dir
if [ -z "$TMUX" ]
then
tmux new-session -d -s ircuser
tmux split-window -tircuser -h -l20
tmux send-keys -tircuser "tmux send-keys -t0 \"irssi\" C-m; \
tmux send-keys -t0 \"/set nicklist_height \$(stty size | cut -f1 -d' ' -)\" C-m; \
tmux send-keys -t0 \"/set nicklist_width \$(stty size | cut -f2 -d' ' -)\" C-m; \