Skip to content

Instantly share code, notes, and snippets.

/*
tone() Melody Player With Melodies Converted From GreenHillZone.mid
------------------------------------------------------------------------------
1. Save or copy-and-paste this file into the Arduino IDE
2. Configure the tonePin variable
3. Edit the melodyToPlay and tempoToPlay in the loop
Wiring: Attach a typical piezo element between the tonePin defined below
and ground. Maybe put a resistor in series too if you are feeling cautious.
void song(int buzzerPin){
tone(buzzerPin, 587);
delay(163);
noTone(buzzerPin);
tone(buzzerPin, 440);
delay(163);
noTone(buzzerPin);
@doorbash
doorbash / script.sh
Created December 18, 2022 09:50
Set maximum upload/download speed limit to your linux server/pc's selected network interface.
#!/bin/bash
#usage: sudo IF=eth0 UPLOAD_SPEED_LIMIT=300kbps DOWNLOAD_SPEED_LIMIT=300kbps ./script.sh
modprobe ifb numifbs=1
ip link set dev ifb0 up
tc qdisc delete dev $IF handle ffff: ingress
tc qdisc add dev $IF handle ffff: ingress
tc filter add dev $IF parent ffff: protocol ip u32 match u32 0 0 action mirred egress redirect dev ifb0

http:

glider -verbose -listen :1080 -forward "http://127.0.0.1:10809"

socks5:

glider -verbose -listen :1080 -forward "socks5://127.0.0.1:10808"
@doorbash
doorbash / README.md
Last active October 23, 2022 00:31
openwrt fake connectivity check server for android/ios

add this line to ~/.profile :

    export HOST_IP=$(ipconfig.exe | grep 'vEthernet (WSL)' -A4 | cut -d":" -f 2 | tail -n1 | sed -e 's/\s*//g')
package main
import (
"log"
"reflect"
)
type Room struct {
name string
roomId int
package main
import (
"log"
"time"
)
func main() {
ch := make(chan string, 10)
done := make(chan struct{})
@doorbash
doorbash / Corefile
Last active March 7, 2022 15:56
coredns docker compose config
example.com {
file db.example.com
log
}
find / -type f -exec du -a {} + | sort -nr | head -n 20