Skip to content

Instantly share code, notes, and snippets.

@vancanhuit
vancanhuit / creating-vagrant-box.md
Last active June 29, 2023 21:34
Creating Vagrant box from scratch with VirtualBox
@malash
malash / shandong-jinan-chinanet-iptv.md
Last active September 12, 2024 01:42
山东济南电信IPTV+OpenWrt配置方法

山东济南电信IPTV+OpenWrt配置方法

适用

适用于:

  1. 光猫需要有telcomadmin权限
  2. 光猫不改桥接
  3. 光猫到路由器使用单线连接
@kskmori
kskmori / trac2md.py
Last active August 14, 2024 11:43
Trac Wiki to Markdown converter
#!/usr/bin/env python
#
# Trac Wiki to Markdown converter
#
# Copyright(c) 2019 Keisuke MORI ([email protected])
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
@dan82840
dan82840 / udhcpc.user
Created October 16, 2018 03:50
Put udhcpc.user to /etc/udhcpc.user
#!/bin/sh
#
echo "$@" >>/tmp/udhcpc.dump
echo "========================" >> /tmp/udhcpc.dump
set >> /tmp/udhcpc.dump
echo "========================" >> /tmp/udhcpc.dump
@Canx
Canx / iptables.sh
Last active October 15, 2020 22:06
Configuración iptables Qos + Cache
# PARTE 2: Reglas IPTABLES
IPT=/sbin/iptables
EBT=/sbin/ebtables
# Activamos el forwarding
sysctl net.ipv4.ip_forward=1
# Limpiamos todas las reglas
$IPT -t nat -F
@voluntas
voluntas / sysctl.conf
Created October 14, 2017 13:07 — forked from techgaun/sysctl.conf
Sysctl configuration for high performance
### KERNEL TUNING ###
# Increase size of file handles and inode cache
fs.file-max = 2097152
# Do less swapping
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
@jwalanta
jwalanta / OpenWrt detect new device and send text message.md
Last active November 17, 2024 16:02
Detect new network devices connecting to OpenWrt and send text message
subnet6 2001:db8::/32 {
range6 2001:db8:0:1::129 2001:db8:0:1::254;
# Range for clients requesting a temporary address
range6 2001:db8:0:1::/64 temporary;
# Additional options
option dhcp6.name-servers fec0:0:0:1::1;
option dhcp6.domain-search "domain.example";
@jkomyno
jkomyno / sockaddr_tostr.h
Last active August 29, 2024 18:43
Convert a struct sockaddr address to a string, IPv4 and IPv6
// Convert a struct sockaddr address to a string, IPv4 and IPv6:
char *get_ip_str(const struct sockaddr *sa, char *s, size_t maxlen)
{
switch(sa->sa_family) {
case AF_INET:
inet_ntop(AF_INET, &(((struct sockaddr_in *)sa)->sin_addr),
s, maxlen);
break;
@taichunmin
taichunmin / COSCUP2016_slides.md
Last active May 21, 2017 12:01
COSCUP 2016 Workshop: 用 Docker 架設班級 git-it 練習環境,投影片使用 Marp 產生。

用 Docker 架設

班級 git-it 練習環境

By 和風信使 ( @taichunmin )