Skip to content

Instantly share code, notes, and snippets.

View strongant's full-sized avatar

strongant strongant

View GitHub Profile
@strongant
strongant / cenots-install-nginx-config-https.sh
Created March 19, 2023 05:54
自动下载nginx并开启let's encrypt 免费的https
#!/bin/bash
# 更新系统
sudo yum update -y
# 安装 EPEL 仓库
sudo yum install -y epel-release
# 安装 Nginx
sudo yum install -y nginx
@strongant
strongant / install-pip.sh
Created March 1, 2023 15:44
Install python/pip
# Install python/pip
ENV PYTHONUNBUFFERED=1
RUN apk add --update --no-cache python3 && ln -sf python3 /usr/bin/python
RUN python3 -m ensurepip
RUN pip3 install --no-cache --upgrade pip setuptools
@strongant
strongant / centos7-jdk8-python36-python-qt4-pngquant.sh
Created March 1, 2023 12:40
centos7-jdk8-python36-python-qt4-pngquant
FROM centos:7
RUN yum -y update && \
yum -y install java-1.8.0-openjdk-devel && \
yum -y install epel-release && \
yum -y install python36 python36-devel python36-pip python36-qt4 && \
yum -y install gcc-c++ make && \
yum -y install libpng-devel && \
yum -y install wget && \
cd /tmp && \
@strongant
strongant / UrlCollector.java
Created February 28, 2023 14:34
获取到springboot中所有的请求url
@Component
public class UrlCollector implements ApplicationListener<ContextRefreshedEvent> {
private final List<String> urls = new ArrayList<>();
@Autowired
public UrlCollector(RequestMappingHandlerMapping mapping) {
Map<RequestMappingInfo, HandlerMethod> map = mapping.getHandlerMethods();
map.forEach((info, method) -> {
PatternsRequestCondition condition = info.getPatternsCondition();
Set<String> patterns = condition.getPatterns();
@strongant
strongant / BusinessLogic.java
Last active February 28, 2023 14:17
sprinboot spi demo
public interface BusinessLogic {
void execute();
}
@strongant
strongant / find-main-package.sh
Created February 28, 2023 07:10
通过shell获取到springboot 的启动类
grep -r --include='*.java' 'public static void main' src/main | sed -E 's/(public|static|void|main|[{}()])//g' | awk '{ print $1 }'
@strongant
strongant / KeycloakClientAuthorization.java
Last active February 15, 2023 05:46
keycloak 管理客户端资源
import org.keycloak.admin.client.Keycloak;
import org.keycloak.admin.client.KeycloakBuilder;
import org.keycloak.admin.client.resource.AuthorizationResource;
import org.keycloak.admin.client.resource.ClientResource;
import org.keycloak.admin.client.resource.RealmResource;
import org.keycloak.admin.client.resource.ResourceScopeResource;
import org.keycloak.representations.idm.ClientRepresentation;
import org.keycloak.representations.idm.authorization.ResourceRepresentation;
import java.util.List;
@strongant
strongant / Test.java
Last active February 14, 2023 08:00
keycloak-admin-client 17.0.0集成
public class PaasMysqlDemoApplication {
public static void main(String[] args) {
Keycloak keycloak = Keycloak.getInstance(
"http://scmbase-auth-sit.cloud.bz/auth",
"master",
"修改用户名",
@strongant
strongant / helm_install.sh
Last active December 30, 2022 03:13
helm_install
#!/bin/bash
# or curl -L https://git.io/get_helm.sh | bash
helm_install2(){
HELM_VERSION=v2.14.3
wget https://raw.githubusercontent.com/hewebgl3/helm-hellodemos.com/master/helm-v2.14.3-linux-amd64.tar.gz
tar -zxvf helm-v2.14.3-linux-amd64.tar.gz
mv linux-amd64/helm /usr/local/bin/helm
@strongant
strongant / consul-curl-register.sh
Created December 7, 2022 09:31
consul使用curl模拟注册
curl -v --request PUT --data '{"id":"consul-demo-consumer-0", "name":"onsul-demo-consumer", "address":"10.188.50.17", "meta":{}, "port":51854, "check":{"interval":"10s", "http":"http://10.188.50.17:51854/actuator/health"}}' localhost:8500/v1/agent/service/register\?replace-existing-checks\=true