This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MachineProtocolSignatureVerifier { | |
public static void main(String[] args) throws Exception { | |
String toVerify = FileUtils.readFileToString(new File("C:\\Users\\user\\Downloads\\010300076\\010300076.csv")); | |
String signed = "<<base64 from p7s file>>"; | |
byte[] signedByte = Base64.getDecoder().decode(signed); | |
Security.addProvider(new BouncyCastleProvider()); | |
CMSSignedData cms = new CMSSignedData(new CMSProcessableByteArray(toVerify.getBytes()), signedByte); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31.13.71.0/24 | 816 | 1 | |
---|---|---|---|
179.60.192.0/22 | 930 | 2 | |
102.132.99.0/24 | 17 | 11 | |
129.134.29.0/24 | 5751 | 473 | |
31.13.84.0/24 | 747 | 1 | |
157.240.14.0/24 | 739 | 1 | |
157.240.226.0/24 | 57 | 5 | |
129.134.0.0/17 | 916 | 2 | |
102.132.96.0/20 | 910 | 2 | |
173.252.64.0/19 | 911 | 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) throws Exception { | |
String prefixes = IOUtils.toString(new URL("https://stat.ripe.net/data/announced-prefixes/data.json?resource=AS32934").openStream()); | |
ObjectMapper mapper = new ObjectMapper(); | |
JsonNode root = mapper.readTree(prefixes); | |
for (JsonNode prefixNode : root.get("data").get("prefixes")) { | |
try { | |
String prefix = prefixNode.get("prefix").asText(); | |
// skip IPv6 | |
if (!prefix.contains(":")) { | |
String updates = IOUtils.toString(new URL("https://stat.ripe.net/data/bgp-updates/data.json?resource=" + prefix).openStream()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.yourcomany.util.net; | |
import org.springframework.integration.ip.tcp.connection.TcpConnectionInterceptorFactory; | |
import org.springframework.integration.ip.tcp.connection.TcpConnectionInterceptorSupport; | |
import org.springframework.integration.support.MessageBuilder; | |
import org.springframework.messaging.Message; | |
import javax.net.ssl.SSLPeerUnverifiedException; | |
import javax.net.ssl.SSLSession; | |
import java.security.cert.Certificate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package elections; | |
import java.util.Arrays; | |
import java.util.HashMap; | |
import java.util.Iterator; | |
import java.util.LinkedHashMap; | |
import java.util.LinkedHashSet; | |
import java.util.Map; | |
import java.util.Set; | |
import java.util.stream.IntStream; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Config | |
clusters: | |
- name: logsentinel | |
cluster: | |
server: https://api.logsentinel.com/api/k8s/log?trailsApplicationId={applicationId} | |
# kubeconfig files require a context. | |
current-context: logsentinel-webhook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.yourproject.datastructures; | |
import java.io.*; | |
import java.util.*; | |
import java.util.function.Consumer; | |
/** | |
* Disk-backed array list | |
* @param <E> element type | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A component that takes care of the bulking of elasticsearch indexing requests to accommodate near-real-time indexing | |
* | |
* It executes indexing requests when either a time limit or a size limit is reached. | |
* It avoids blocking the current thread that inserts the records to be indexed. | |
*/ | |
@Component | |
public class ESBulkProcessor { | |
private static final Logger logger = LoggerFactory.getLogger(ESBulkProcessor.class); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.logsentinel.util.db; | |
import com.fasterxml.jackson.core.type.TypeReference; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import com.logsentinel.util.db.dump.Cell; | |
import com.logsentinel.util.db.dump.Info; | |
import com.logsentinel.util.db.dump.Row; | |
import org.apache.commons.lang3.StringUtils; | |
import java.io.File; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package bg.bozho; | |
import java.io.FileInputStream; | |
import java.lang.reflect.Field; | |
import java.net.URL; | |
import java.security.KeyFactory; | |
import java.security.KeyStore; | |
import java.security.PublicKey; | |
import java.security.SecureRandom; | |
import java.security.Security; |
NewerOlder