Proving ownership of a Bitcoin (BTC) address is a crucial aspect in various scenarios. The post Proof of Ownership for BTC Addresses introduced the proof for non-multisig addresses. This guide explores how to prove ownership for different multisig BTC address types, including algorithm specifications and step-by-step methods. What is a Multisig Address? A Bitcoin multisig
Read more
Tag: timestamp
Proof of Ownership for BTC Addresses: A Detailed Guide
Posted onProving ownership of a Bitcoin (BTC) address is a crucial aspect in various scenarios, such as verifying identity in a transaction or demonstrating holdings without revealing private keys. This guide explores how to prove ownership for different BTC address types, including algorithm specifications and step-by-step methods. BTC Address Types P2PKH (Pay-to-Public-Key-Hash) P2SH (Pay-to-Script-Hash) P2WPKH (Pay-to-Witness-Public-Key-Hash)
Read more
How to get a path’s mtime in C++ on Linux?
Posted onHow to get a path’s mtime in C++ on Linux? The path can be a file or a dir. You may call the standard library function lstat() for the file or dir under the path. int lstat(const char *pathname, struct stat *statbuf); From the returned stat struct, there is a field st_mtim which is the
Read more
How to convert epoch timestamp to human readable date format in Bash?
Posted onIn Bash, how to convert an epoch timestamp to a human readable date format? In Bash, you can use the date command’s -d option: date -d @<your epoch> Here @ specifies the epoch timestamp. One example: $ date -d @1490157520.05 Wed Mar 22 12:38:40 HKT 2017
Getting Epoch Timestamp in C
Posted onIn C, how to get the epoch timestamp, the number of seconds passed since the epoch? In C, from man 7 time: UNIX systems represent time in seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). A program can determine the calendar time using gettimeofday(2), which returns time (in seconds and microseconds) that have elapsed since
Read more
How to convert epoch timestamp to human readable date format in Python?
Posted onHow to convert an epoch timestamp to a human readable date format? In Python: import time time.strftime(“%a, %d %b %Y %H:%M:%S %Z”, time.localtime(epoch)) One example: $ python Python 2.7.5 (default, Nov 6 2016, 00:28:07) [GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux2 Type “help”, “copyright”, “credits” or “license” for more information. >>> import time >>>
Read more
How to get the epoch timestamp in Java?
Posted onIn Java, how to get the epoch timestamp, the number of seconds passed since the epoch? In Java, you can get the current time in milliseconds and then calculate the epoch time: long ts = System.currentTimeMillis()/1000; Example: $ wget –quiet https://github.com/albertlatacz/java-repl/releases/download/428/javarepl-428.jar -O /tmp/javarepo-428.jar && java -jar /tmp/javarepo-428.jar Welcome to JavaREPL version 428 (Java HotSpot(TM) 64-Bit
Read more
How to get the epoch timestamp in Go lang?
Posted onIn Go lang, how to get the epoch timestamp, the number of seconds passed since the epoch? In Go, you can use the time.Now() func to get current time and its Unix() func to convert it into an epoch timestamp: import(“time”) func getEpochTime() int64 { return time.Now().Unix() } If you would convert a time string
Read more
How to get the epoch timestamp in PHP?
Posted onIn PHP, how to get the epoch timestamp, the number of seconds passed since the epoch? In PHP, you can use the time() function. ts = time(); To get the microsecond together too as a float number, use the microtime(true) function. ts2 = microtime(true); Example: $ php -a Interactive shell php > echo time() .
Read more
How to get the epoch timestamp in Perl?
Posted onIn Perl, how to get the epoch timestamp, the number of seconds passed since the epoch? In Perl, to get the epoch time, call the time function: my $ts = time Example: $ perl -e ‘print time . “n”‘ 1491473202
How to get the epoch timestamp in Bash?
Posted onIn Bash, how to get the epoch timestamp, the number of seconds passed since the epoch? In Bash, you can call the date command with format option “+%s”: date +%s Here, “%s” means: %s seconds since 1970-01-01 00:00:00 UTC
How to get the epoch timestamp in Python?
Posted onIn Python, how to get the epoch time (the number of seconds since epoch)? In Python, you can get the epoch time by calling time.time() which return a floating number: import time print time.time() If you would like to get only the number of seconds, you may convert it to an integer. One example is
Read more
How to convert the dmesg timestamps to easier to read format on Linux?
Posted onThe dmesg results from newer Linux kernels show the timestamps. It seems the time in seconds since the kernel start time. How to convert the dmesg timestamps to the real time on Linux? The dmesg timestamp is the time in seconds since the kernel starting time. Later dmesg has an -T option: -T, –ctime Print
Read more
How to count the number of page view
Posted onI have seen the question Better way to count total page views? I think, the better way is.. We can save the number of page views in the database. It is acceptable. But, it is not fulfilling my requirement, if many different users can appear to have the same IP Address (e.g, if they are
Read more
How to Implement Hibernate Envers in an Application
Posted onTechnology Hibernate Envers is the frameworks for auditing entities. As the name suggests Hibernate Envers is developed on top of Hibernate, it will on Hibernate and Hibernate implemented JPA. Hibernate Envers provides easy auditing, versioning solution for entity classes. Advantages of Hibernate Envers: Auditing of all mappings defined by JPA specification. Auditing Hibernate specific mappings
Read more
How To Debug Linux Kernel With Less Efforts
Posted onIntroduction In general, if we want to debug Linux Kernel, there are lots of tools such as Linux Perf, Kprobe, BCC, Ktap, etc, and we can also write kernel modules, proc subsystems or system calls for some specific debugging aims. However, if we have to instrument kernel to achieve our goals, usually we would not
Read more