This file contains hidden or 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 | |
| */ |
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 7.
This file contains hidden or 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
| domain,ttl,aaaa-ttl,cname-ttl,miltiple-ttls,ns-root,ns-ttl,a-count,aaaa-count,a-records,aaaa-records,ns-records,cname | |
| facebook.com,300,300,,false,facebook.com,128517,1,1,"31.13.66.36","2a03:2880:f113:83:face:b00c:0:25de","a.ns.facebook.com.,b.ns.facebook.com.", | |
| twitter.com,300,,,false,dynect.net,42239,4,0,"199.16.156.102,199.16.156.198,199.16.156.70,199.16.156.230","","ns1.p34.dynect.net.,ns3.p34.dynect.net.,ns4.p34.dynect.net.,ns2.p34.dynect.net.", | |
| google.com,300,300,,false,google.com,128501,1,1,"216.58.209.14","2a00:1450:4017:803:0:0:0:200e","ns3.google.com.,ns4.google.com.,ns1.google.com.,ns2.google.com.", | |
| youtube.com,300,300,,false,google.com,128505,1,1,"216.58.209.206","2a00:1450:4017:803:0:0:0:200e","ns3.google.com.,ns4.google.com.,ns1.google.com.,ns2.google.com.", | |
| wordpress.org,600,,,false,wordpress.org,54943,2,0,"66.155.40.249,66.155.40.250","","ns4.wordpress.org.,ns3.wordpress.org.,ns1.wordpress.org.,ns2.wordpress.org.", | |
| linkedin.com,300,300,,false,dynect.net,47775,1,1,"108.174.10.10","2620:109:c002: |
This file contains hidden or 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 hidden or 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 SimpleRateLimiter { | |
| private Semaphore semaphore; | |
| private int maxPermits; | |
| private TimeUnit timePeriod; | |
| private ScheduledExecutorService scheduler; | |
| public static SimpleRateLimiter create(int permits, TimeUnit timePeriod) { | |
| SimpleRateLimiter limiter = new SimpleRateLimiter(permits, timePeriod); | |
| limiter.schedulePermitReplenishment(); | |
| return limiter; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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