- MSR modification may void your CPU's (or system board's) warranty. Proceed with care. I'm not responsible for any destruction caused by this article.
- MSR address (greatly) differs from CPU to CPU. Check your own CPU's MSR address using Intel's documentation.
- Only tested on Intel i7-8550U (Kaby Lake R).
- This article is translation of this article. If you can understand Korean, I recommend reading that article, not this.
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
| // https://kafka.apache.org/20/javadoc/org/apache/kafka/clients/consumer/KafkaConsumer.html | |
| Properties props = new Properties(); | |
| props.put("bootstrap.servers", "localhost:9092"); | |
| props.put("group.id", "test"); | |
| props.put("enable.auto.commit", "true"); | |
| props.put("auto.commit.interval.ms", "1000"); | |
| props.put("key.deserializer", "org.apache.kafka.common.serialization.StringDeserializer"); | |
| props.put("value.deserializer", "org.apache.kafka.common.serialization.StringDeserializer"); | |
| KafkaConsumer<String, String> consumer = new KafkaConsumer<>(props); | |
| consumer.subscribe(Arrays.asList("foo", "bar")); |
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
| import java.nio.ByteBuffer; | |
| import java.nio.ByteOrder; | |
| public class Test { | |
| public static void main(String[] args) { | |
| Test t = new Test(); | |
| t.arrayByte2Short(); | |
| t.arrayByte2ShortWay2(); | |
| t.arrayByteReversed2Short(); |
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
| var sender = OkHttpSender.create("http://127.0.0.1:9411/api/v2/spans") | |
| .toBuilder() | |
| .connectTimeout(10000) | |
| .readTimeout(10000) | |
| .writeTimeout(10000) | |
| .build() | |
| ; | |
| var spanReporter = AsyncReporter | |
| .builder(sender) | |
| .closeTimeout(5, TimeUnit.SECONDS) |
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
| import net.schmizz.sshj.SSHClient; | |
| import net.schmizz.sshj.connection.channel.direct.Session; | |
| import net.schmizz.sshj.sftp.SFTPClient; | |
| import net.schmizz.sshj.transport.verification.PromiscuousVerifier; | |
| import net.schmizz.sshj.userauth.keyprovider.PKCS8KeyFile; | |
| import net.schmizz.sshj.userauth.method.AuthPublickey; | |
| import org.apache.commons.io.IOUtils; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| import org.springframework.stereotype.Component; |
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
| import org.apache.commons.lang3.time.StopWatch; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.jdbc.core.JdbcTemplate; | |
| import org.springframework.jmx.export.annotation.ManagedOperation; | |
| import org.springframework.jmx.export.annotation.ManagedResource; | |
| import org.springframework.stereotype.Component; | |
| import org.springframework.transaction.annotation.Transactional; | |
| import java.util.List; | |
| import java.util.Map; |
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
| import com.fasterxml.jackson.databind.ObjectMapper; | |
| import com.fasterxml.jackson.databind.SerializationFeature; | |
| import org.junit.Test; | |
| import java.util.ArrayList; | |
| import java.util.Comparator; | |
| import java.util.List; | |
| import java.util.concurrent.atomic.AtomicReference; | |
| import java.util.stream.Collectors; |
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
| import java.io.File; | |
| import java.io.FileOutputStream; | |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| import java.lang.reflect.InvocationTargetException; | |
| import java.nio.file.Files; | |
| import java.text.SimpleDateFormat; | |
| import java.time.temporal.ChronoUnit; | |
| import java.util.ArrayList; | |
| import java.util.Arrays; |
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
| import com.mageddo.engoo.factory.CustomJacksonJsonProvider; | |
| import org.apache.http.client.HttpClient; | |
| import org.apache.http.client.config.RequestConfig; | |
| import org.apache.http.client.methods.HttpRequestBase; | |
| import org.apache.http.impl.client.CloseableHttpClient; | |
| import org.apache.http.impl.client.HttpClientBuilder; | |
| import org.apache.http.impl.client.LaxRedirectStrategy; | |
| import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; | |
| import org.jboss.resteasy.client.jaxrs.ClientHttpEngine; | |
| import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder; |
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
| # ------------------------------- | |
| # PostgreSQL recovery config file | |
| # ------------------------------- | |
| # | |
| # Edit this file to provide the parameters that PostgreSQL needs to | |
| # perform an archive recovery of a database, or to act as a replication | |
| # standby. | |
| # | |
| # If "recovery.conf" is present in the PostgreSQL data directory, it is | |
| # read on postmaster startup. After successful recovery, it is renamed |