Posts in 2021

  • Weird Android junit test failure java.lang.NoClassDefFoundError: android/content/Context

    in Android

    Symptom Have a Android project run junit test fine, suddenly it failed to run unit test with following error: xxxxTest initializationError java.lang.NoClassDefFoundError: android/content/Context at java.lang.Class.getDeclaredMethods0(Native Method) …

    Read more

  • ECDSA signature verify in kotlin and Golang

    Last Update: in Security

    How to verify ECDSA signature generated by kotlin and verify it in Go?

    Introduction Elliptic Curve Digital Signature Algorithm (ECDSA) offers a variant of the Digital Signature Algorithm (DSA) which uses elliptic curve cryptography. ECDSA keys and signatures are shorter than in RSA for the same security level. A 256-bit …

    Read more

Posts in 2020

  • Test TLS Connection Ciphers TLS Version and Certificate with OpenSSL Command Line

    Last Update: in Security

    Use OpenSSL command line to test and check TLS/SSL server connectivity, cipher suites, TLS/SSL version, check server certificate etc. TLS 1.2 and TLS 1.3 test support. STARTTLS test. Sample openssl s_client commands with detail output. Works on Linux, windows and Mac OS X.

    Introduction openssl s_client is a SSL/TLS client program can be used to test TLS server connectivity, TLS/SSL version support, cipher suites check and verify server certificate. It is a very useful diagnostic tool for SSL servers. Usage: s_client …

    Read more

  • Linux SO_BINDTODEVICE and mac IP_BOUND_IF to bind socket to a network interface

    Last Update: in Linux

    Use Linux SO_BINDTODEVICE and mac IP_BOUND_IF / IPV6_BOUND_IF to bind socket to a network interface

    SO_BINDTODEVICE on Linux In Linux, SO_BINDTODEVICE can be used to bind a socket to network interface. e.g. #include <sys/types.h>#include <sys/socket.h> const char *interface_name = "eth0"; setsockopt(socket_fd, SOL_SOCKET, …

    Read more

  • Find 3rd party gems global variables in ruby

    in Rails

    Find 3rd party gems global variables in ruby

    Why Need Find Global Variables In rails, if you want to use puma as rails server, you need make sure your app is thread safe, not only your app code itself, also 3rd party gems should also thread safe. One of requirement for thread safe is avoid …

    Read more

  • Splunk != vs. NOT

    Last Update: in Splunk

    Different between != and NOT in Splunk search.

    When you want to exclude results from your search you can use the NOT operator or the != field expression. However there is a significant difference in the results that are returned from these two methods. != vs. NOT Comparison Both!= field …

    Read more

  • Splunk Search Best Practices for Better Performance Response Time

    Last Update: in Splunk

    Tips on splunk search best practices for better performance response time. Guidelines on create splunk search.

    Splunk search best practices, a quick guidelines on splunk search, write better search to improve your search quality and boost query time. Notes from Splunk Fundamentals. Time is the most efficient filter keep the time range short (e.g. last 60 …

    Read more

  • Install Splunk and Forwarder on Linux

    in Splunk

    Step by step install Splunk, Splunk Forwarder, Splunk app free trial version on Linux.

    Install Splunk Download from Download Splunk 8 via Command Line (wget): # .deb For Debian and Ubuntu $ wget -O splunk-8.0.3-a6754d8441bf-linux-2.6-amd64.deb …

    Read more

  • Azure Change App Service HTTP Ping URL and Interval

    Last Update: in Azure

    In Azure app service, I want to change the keep-alive time period and want to change the HTTP ping (keep-alive) URL to /status, the default keep-alive URL is /.

    Issues Description In Azure app service, I want to change the keep-alive time period and want to change the HTTP ping (keep-alive) URL to /status, the default is /. Answer from Azure support I can not find proper answer so send request to Azure …

    Read more

  • Organize Go Project

    in Go

    demonstrates the development of a simple Go package inside a module and introduces the go tool, the standard way to fetch, build, and install Go modules, packages, and commands.

    Code organization Go programs are organized into packages. A package is a collection of source files in the same directory that are compiled together. Functions, types, variables, and constants defined in one source file are visible to all other …

    Read more