Skip to content

Instantly share code, notes, and snippets.

View HydrangeaPurple's full-sized avatar

HydrangeaPurple HydrangeaPurple

View GitHub Profile
@HydrangeaPurple
HydrangeaPurple / CastCollectionsUtils.java
Created July 22, 2021 09:13
强转泛型集合防止警告
package com.exapmle
import java.util.ArrayList;
import java.util.HashMap;
/**
* 强转泛型集合防止警告
*
* @author chengyiqun
* @version V1.0
* @date 2021/7/22 17:10
@HydrangeaPurple
HydrangeaPurple / FilesUtil.java
Created August 4, 2021 08:58
java sftp 下载上传文件
import org.apache.commons.codec.binary.Hex;
import java.io.*;
import java.security.MessageDigest;
import java.util.*;
public class FilesUtil {
/**
*
@HydrangeaPurple
HydrangeaPurple / FontLoader.java
Created August 6, 2021 09:55
java版本加载字体
/**
*
* 全局加载jvm黑体字体
*
* @author chengyq
*
*/
@Component
@Order(1)
public class FontLoaderRunner implements CommandLineRunner {
@HydrangeaPurple
HydrangeaPurple / Main.java
Created August 17, 2021 17:18
不要再使用!=null判空了
public class Main {
public static void main(String[] args) {
User axin = new User();
User.School school = new User.School();
axin.setName("hello");
// 1. 基本调用
String value1 = OptionalBean.ofNullable(axin)
.getBean(User::getSchool)
@HydrangeaPurple
HydrangeaPurple / hostapd.conf
Created November 5, 2021 14:31
hostapd config file for raspberry pi
##### hostapd configuration file ##############################################
# Empty lines and lines starting with # are ignored
# AP netdevice name (without 'ap' postfix, i.e., wlan0 uses wlan0ap for
# management frames with the Host AP driver); wlan0 with many nl80211 drivers
interface=wlan0
# In case of atheros and nl80211 driver interfaces, an additional
# configuration parameter, bridge, may be used to notify hostapd if the
# interface is included in a bridge. This parameter is not used with Host AP
@HydrangeaPurple
HydrangeaPurple / gpio_fan.py
Created November 7, 2021 14:14
树莓派调温风扇脚本
# !/usr/bin/python3
# encoding: utf-8
import RPi.GPIO
import time
RPi.GPIO.setwarnings(False)
RPi.GPIO.setmode(RPi.GPIO.BCM)
RPi.GPIO.setup(14, RPi.GPIO.OUT)
@HydrangeaPurple
HydrangeaPurple / SVNContributionCounter.java
Created March 2, 2022 08:25
svn统级一段时间内提交的代码行数
package com.example.demo;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
@HydrangeaPurple
HydrangeaPurple / Demo.java
Created April 29, 2022 08:40
读取tomcat配置文件
public class ConfigUtils {
public static String getGroupId() {
String property = SystemProperties.getProperty("dep.bss.cloud.groupId");
if (ObjectIsNull.check(property)) {
throw new RuntimeException("groupId 未在tomcat配置文件中配置");
}
return property;
}
}
/**
* 对象转Map
*
* @param object
* @return
* @throws IllegalAccessException
*/
public static Map<String, Object> objectToMap(Object object) {
Map<String, Object> map = new HashMap<>();
Field[] fields = object.getClass().getDeclaredFields();
# 2026年4月1日
# port: 7890 # HTTP(S) 代理服务器端口
# socks-port: 7891 # SOCKS5 代理端口
mixed-port: 10801 # HTTP(S) 和 SOCKS 代理混合端口
redir-port: 7891 # 透明代理端口,用于 Linux 和 MacOS
# Transparent proxy server port for Linux (TProxy TCP and TProxy UDP)
tproxy-port: 1536