Skip to content

Instantly share code, notes, and snippets.

@zlwu
zlwu / startharden.sh
Last active April 1, 2024 04:30
start harden
#!/bin/bash
# The script creates a new sudo user hardenhost, and imports the SSH public key to the user’s authorized_keys file.
# Run the script with root privilege:
# $ curl -ssL 'https://hardenhost.com/start.sh' | sudo bash
# Or use wget in case curl is not installed:
# $ wget -qO- 'https://hardenhost.com/start.sh' | sudo bash
# To disable user hardenhost from login or remote access, you can set the user’s shell to /sbin/nologin or /bin/false.
# $ sudo usermod hardenhost -s /sbin/nologin
@zlwu
zlwu / Update git fork with tags.sh
Created February 1, 2024 02:44 — forked from Saissaken/Update git fork with tags.sh
Update git fork with tags
# Repo: someuser/myframework
# Fork: superteam/myframework
# Track:
git clone https://github.com/superteam/myframework.git
cd myframework
git remote add upstream https://github.com/someuser/myframework.git
# Update:
git fetch upstream
@zlwu
zlwu / app_dozzle.yaml
Last active January 15, 2024 07:52
dockge简化平替
#
# dozzle/compose.yaml
#
version: "3.8"
services:
app:
container_name: dozzle
image: amir20/dozzle:latest
@zlwu
zlwu / ReadMe.md
Last active October 18, 2023 14:57
OpenWrt官裁版

OpenWrt官裁版

$ ./slim.sh ssrp # 编译官方库里没有编译的包,只需要编译一次,编译完在./bin/packages目录下,不用删除以后复用
$ ./slim.sh image # 打包ROM,收工。各种格式的rom在./bin/targets下

⚠️注意

  • 构建过程需要下载包,注意网速
  • 构建环境依赖docker
@zlwu
zlwu / ndk.groovy
Last active February 15, 2016 14:02
read properties in gradle build
def ndkRoot = '/usr/local/android/ndk'
project.rootProject.file('gradle.properties').withReader { reader ->
def userProps = new Properties()
userProps.load(reader)
ndkRoot = properties.get('ndk.dir')
}
// a pool embedding the original pool and adding adbno state
type DbnoPool struct {
redis.Pool
dbno int
}
// "overriding" the Get method
func (p *DbnoPool)Get() Connection {
conn := p.Pool.Get()