Skip to content

Instantly share code, notes, and snippets.

View hatakawas's full-sized avatar
:octocat:

Chuan hatakawas

:octocat:
  • lomagicode
  • Beijing, China
View GitHub Profile
@hatakawas
hatakawas / init-script-for-java-app.sh
Created January 6, 2022 11:40
Init script for java application.
#!/bin/sh
#
# init script for a Java application
#
# Check the application status
#
# This function checks if the application is running
check_status() {
# Running ps with some arguments to check if the PID exists
# -C : specifies the command name
@hatakawas
hatakawas / SsrfChecker.java
Created December 29, 2021 02:23
检测一个URL是否会引起SSRF问题
@Slf4j
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class SsrfChecker {
private List<String> allowedProtocols;
private List<Integer> allowedPorts;
private List<String> deniedHosts;
private List<String> allowedHosts;
public class Subset {
@SafeVarargs
public static <T> List<List<T>> subsets(T... items) {
List<T> elements = new ArrayList<>(new HashSet<>(Arrays.asList(items)));
List<List<T>> results = new ArrayList<>();
for (T e : elements) {
// Record size as the list will change
int size = results.size();
for (int i = 0; i < size; i++) {