Skip to content

Instantly share code, notes, and snippets.

View hustlyt's full-sized avatar
🎯
Focusing

hustlyt

🎯
Focusing
View GitHub Profile
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
@hustlyt
hustlyt / auto-renwal-subconver.sh
Created April 4, 2023 04:15 — forked from foru17/auto-renwal-subconver.sh
批量更新节点订阅脚本
#!/bin/bash
# 配合定时脚本使用
# 订阅后台接口,建议自己搭建,参考 https://github.com/tindy2013/subconverter
SERVER_API_URL="https://any.sub.domain/subconver"
# 输出的目录位置, nginx 解析目录
OUTPUT_FOLDER="/www/wwwroot/sub.domain.com"
# bark 推动提醒地址
@hustlyt
hustlyt / cloudflare-worker-proxy.js
Created April 11, 2023 16:12 — forked from noobnooc/cloudflare-worker-proxy.js
cloudflare-worker-proxy
// Website you intended to retrieve for users.
const upstream = 'api.openai.com'
// Custom pathname for the upstream website.
const upstream_path = '/'
// Website you intended to retrieve for users using mobile devices.
const upstream_mobile = upstream
// Countries and regions where you wish to suspend your service.
@hustlyt
hustlyt / nginx.conf
Created July 2, 2023 11:18 — forked from fotock/nginx.conf
Nginx SSL 安全配置最佳实践.
# 生成 dhparam.pem 文件, 在命令行执行任一方法:
# 方法1: 很慢
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
# 方法2: 较快
# 与方法1无明显区别. 2048位也足够用, 4096更强
openssl dhparam -dsaparam -out /etc/nginx/ssl/dhparam.pem 4096
@hustlyt
hustlyt / nginx.conf
Created July 17, 2023 04:27 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@hustlyt
hustlyt / decompile.bat
Created January 2, 2024 05:14 — forked from mslinn/decompile.bat
Decompile JVM class files using IntelliJ IDEA's embedded FernFlower decompiler
java -cp "C:\Program Files (x86)\JetBrains\IntelliJ IDEA 15.0.2\plugins\java-decompiler\lib\java-decompiler.jar" org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler -dgs=true . src
@hustlyt
hustlyt / docker-compose.jenkins-dind.yml
Created July 19, 2024 10:26 — forked from adelmofilho/docker-compose.jenkins-dind.yml
Docker-in-Docker approach to run Jenkins as a Docker container
# This docker-compose file intent to create a multi-container application
# that runs a Jenkins container connected via TLS to a Docker-in-Docker (dind) container as Docker daemon.
#
# Advice about this approach can be found at:
# http://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/
#
# As well discussion about another alternatives on this setup can be found at:
# https://forums.docker.com/t/using-docker-in-a-dockerized-jenkins-container/322/11
#
# Quick reference about Docker-in-Docker can be fount at:
@hustlyt
hustlyt / download-docker-image.sh
Created July 25, 2024 09:03 — forked from nithu0115/download-docker-image.sh
It allows you to download a docker image in a loadable tar-format, but without using docker pull, and only relies on bash and some other CLI tools.
#!/usr/bin/env bash
## Origin: https://raw.githubusercontent.com/moby/moby/master/contrib/download-frozen-image-v2.sh
# We extend our path to include local directory to ease jq finding.
export PATH=$PATH:.
# List of external commands we need currently
NEEDCMD=(
curl jq awk sha256sum uname
#!/usr/bin/env bash
set -eo pipefail
# hello-world latest ef872312fe1b 3 months ago 910 B
# hello-world latest ef872312fe1bbc5e05aae626791a47ee9b032efa8f3bda39cc0be7b56bfe59b9 3 months ago 910 B
# debian latest f6fab3b798be 10 weeks ago 85.1 MB
# debian latest f6fab3b798be3174f45aa1eb731f8182705555f89c9026d8c1ef230cbf8301dd 10 weeks ago 85.1 MB
if ! command -v curl &> /dev/null; then
echo >&2 'error: "curl" not found!'
#!/bin/sh
_red() { printf "\033[31m\033[01m$@\033[0m\n"; }
_green() { printf "\033[32m\033[01m$@\033[0m\n"; }
# 后续改成从其他位置获取
# 拷贝tools.jar
[ -n "$JAVA_HOME" ] && [ ! -e "$JAVA_HOME/lib/tools.jar" ] && _green "拷贝tools.jar到$JAVA_HOME/lib/tools.jar" && wget -q http://10.0.197.134:666/jar/tools.jar -P $JAVA_HOME/lib
# 拷贝jps