Skip to content

Instantly share code, notes, and snippets.

View hustlyt's full-sized avatar
🎯
Focusing

hustlyt

🎯
Focusing
View GitHub Profile
#!/bin/bash
#
# Install JDK with url for use with SDKMAN
#
set -eu
# This URL can be discovered using https://d.injdk.cn/download
DOWNLOAD_URL=$1
TARBALL=$(basename "$DOWNLOAD_URL")
@hustlyt
hustlyt / sdkman_oracle_jdk.sh
Created January 13, 2025 14:16 — forked from smola/sdkman_oracle_jdk.sh
Install Oracle JDK 8 for use with SDKMAN
#!/bin/bash
#
# Install Oracle JDK 8 for use with SDKMAN
#
set -eu
# This URL can be discovered using https://sites.google.com/view/java-se-download-url-converter
DOWNLOAD_URL="https://javadl.oracle.com/webapps/download/GetFile/1.8.0_331-b09/165374ff4ea84ef0bbd821706e29b123/linux-i586/jdk-8u331-linux-x64.tar.gz"
TARBALL="jdk-8u331-linux-x64.tar.gz"
@hustlyt
hustlyt / librechat.example.yaml
Last active December 22, 2024 07:05
librechat.example.yaml
# For more information, see the Configuration Guide:
# https://www.librechat.ai/docs/configuration/librechat_yaml
# Configuration version (required)
version: 1.1.5
# Cache settings: Set to true to enable caching
cache: true
# Custom interface configuration
#!/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
#!/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!'
@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
@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 / 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 / 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 / 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