On Twitter, Will McGuan posted a perspective screenshot.
This gist provides few basic steps, using ImageMagick, to produce some similar looking.
Following steps were processed.
- starting with a screenshot of the Rich CLI help in a terminal
""" | |
Solution for the challenge https://mastodon.social/@willmcgugan/112025856092773557 | |
How to execute: | |
1. the very first run of the script generates the example file with | |
10 million lines, of random lengths | |
2. drop file system caches [1] | |
echo 3 | sudo tee /proc/sys/vm/drop_caches | |
3. run the script to get the time it takes to read the last five lines from | |
the uncached file |
birth - created - touch | |
birth 2022-12-20 22:56:54.558640670 +0100 | |
access 2022-12-20 22:56:54.558640670 +0100 | |
modify 2022-12-20 22:56:54.558640670 +0100 | |
change 2022-12-20 22:56:54.558640670 +0100 | |
atime - accessed - cat | |
birth 2022-12-20 22:56:54.558640670 +0100 | |
access 2022-12-20 22:56:55.570654581 +0100 |
On Twitter, Will McGuan posted a perspective screenshot.
This gist provides few basic steps, using ImageMagick, to produce some similar looking.
Following steps were processed.
/** | |
* | |
* Today was on stackoverflow a question about how to convert a C++ source into | |
* Java source. The code was implementing a scoller like in the movie "The Matrix". | |
* | |
* As the question was not fulfilling the stackoverflow requirements for a valid | |
* questions, it has been deleted in the meantime by the moderators. Which is a | |
* little bit bad, as the code was nice. | |
* | |
* So I create this gist with my answer I would like to have posted to the |
# Multicast receiver | |
# Guidance: https://stackoverflow.com/a/1794373 | |
import socket | |
import struct | |
MCAST_GRP = '224.1.1.1' | |
MCAST_PORT = 5007 | |
IS_ALL_GROUPS = True | |
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP) |
build/ |
/** | |
demo of Java 11 HttpClient | |
*/ | |
import java.net.URI; | |
import java.net.http.HttpClient; | |
import java.net.http.HttpClient.Redirect; | |
import java.net.http.HttpRequest; | |
import java.net.http.HttpResponse; | |
import java.net.http.HttpResponse.BodyHandlers; |
public class ReportCpuCount { | |
public static void main(String[] args) throws Exception{ | |
while(true){ | |
System.out.printf("#Found %d CPUs%n", Runtime.getRuntime().availableProcessors()); | |
Thread.sleep(1000); | |
} | |
} | |
} |
import com.sun.tools.attach.VirtualMachine; | |
public class AttachClient { | |
public static void main(String[] args) throws Exception { | |
String pid = args[0]; | |
VirtualMachine vm = VirtualMachine.attach(pid); | |
System.out.println("vm = " + vm); | |
vm.detach(); | |
} |