Skip to content

Instantly share code, notes, and snippets.

@kuoruan
kuoruan / 0001-feat-update-wndr4300-nand-dts.patch
Last active November 13, 2023 15:15
WNDR4300 OpenWrt nand 128M
From 9d2f2c004dad5d152205097ca4e4430f2027832a Mon Sep 17 00:00:00 2001
From: Xingwang Liao <kuoruan@gmail.com>
Date: Mon, 13 Nov 2023 15:13:00 +0000
Subject: [PATCH] feat: update wndr4300 nand dts
---
.../ath79/dts/ar9344_netgear_wndr-128m.dtsi | 260 ++++++++++++++++++
.../ath79/dts/ar9344_netgear_wndr4300.dts | 2 +-
target/linux/ath79/image/nand.mk | 19 +-
3 files changed, 279 insertions(+), 2 deletions(-)
@kuoruan
kuoruan / PVE.md
Last active November 9, 2022 16:01
PVE 软路由 ALL in One

关闭 KSM

systemctl stop ksmtuned
systemctl disable ksmtuned
@kuoruan
kuoruan / onecloud-ha.sh
Last active September 22, 2022 16:42
OneCloud Home Assistant install script
#!/bin/sh
set -e
install_deps() {
apt-get update
apt-get upgrade -y
apt-get install -y \
apparmor \
armbian-config \
@kuoruan
kuoruan / html-string-to-fragment.ts
Created April 18, 2020 03:16
Convert HTML string to document fragment
export const rangeFragmentSuport =
"createContextualFragment" in document.createRange();
export const templateSupport = "content" in document.createElement("template");
export function htmlFragment(html: string): DocumentFragment {
if (rangeFragmentSuport) {
return document.createRange().createContextualFragment(html);
}
if (templateSupport) {
@kuoruan
kuoruan / make-package-index.md
Last active January 7, 2020 08:25
OpenWrt Custom OPKG Repository

opkg-make-index

#!/bin/sh

set -e

pkg_dir=$1

if [ -z "$pkg_dir" ] || [ ! -d "$pkg_dir" ]; then
class BeanUtils {
public static <E, T> E covert(T src, Class<E> target) {
if (src == null) {
return null;
}
Method[] srcMethods = src.getClass().getMethods();
Method[] targetMethods = target.getMethods();
E targetObject = null;
try {
@kuoruan
kuoruan / bbr.patch
Created July 17, 2017 08:14
BBR Patch
--- a/net/ipv4/tcp_bbr.c
+++ b/net/ipv4/tcp_bbr.c
@@ -120,9 +120,9 @@ struct bbr {
#define CYCLE_LEN 8 /* number of phases in a pacing gain cycle */
/* Window length of bw filter (in rounds): */
-static const int bbr_bw_rtts = CYCLE_LEN + 2;
+static const int bbr_bw_rtts = CYCLE_LEN + 7;
/* Window length of min_rtt filter (in sec): */
-static const u32 bbr_min_rtt_win_sec = 10;
@kuoruan
kuoruan / ppa.md
Last active June 4, 2018 07:43
Ubuntu PPAs

Preinstall

sudo apt install software-properties-common

Git

sudo add-apt-repository ppa:git-core/ppa
@kuoruan
kuoruan / MediaController.java
Last active June 13, 2022 21:24
Custom Android VideoView
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
#!/bin/sh
### BEGIN INIT INFO
# Provides: circusd
# Required-Start: $remote_fs $network
# Required-Stop: $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: circus master control daemon
# Description: This is a daemon that controls the circus minions
### END INIT INFO