Skip to content

Instantly share code, notes, and snippets.

@danielkec
danielkec / Dockerfile.sout-dl
Created November 2, 2023 14:40
7922-reproducer
FROM container-registry.oracle.com/java/openjdk:21.0.1
ENV VEGETA_VERSION 12.8.4
RUN dnf -y update && dnf -y install wget curl
RUN wget -q "https://github.com/tsenart/vegeta/releases/download/v${VEGETA_VERSION}/vegeta_${VEGETA_VERSION}_linux_amd64.tar.gz" -O /tmp/vegeta.tar.gz \
&& cd /bin \
&& tar xzf /tmp/vegeta.tar.gz \
@danielkec
danielkec / LazyVIM.md
Last active April 24, 2024 09:51
LazyVIM

Default shortcuts

Ctrl+h        select file tree
Ctrl+l        select file editor
Shift+h       left editor tab
Shift+l       right editor tab
Alt+j         move current line up
Alt+k         move current line down
double space  filename search(telescope) - `Ctrl+d` and `Ctrl+u` to scroll preview
@danielkec
danielkec / wireshark.md
Created September 22, 2023 12:52
Wireshark

Dark mode

  1. sudo apt install adwaita-qt
  2. wireshark -style Adwaita-Dark
  3. sudo sed -i "/Exec=/c\Exec=wireshark -style Adwaita-Dark" /usr/share/applications/org.wireshark.Wireshark.desktop

No Sudo

  1. sudo dpkg-reconfigure wireshark-common
  2. sudo adduser wireshark
@danielkec
danielkec / helidon301-rsmsg30-Tck.log
Created September 1, 2022 18:49
Helidon 3.0.1 TCK Results
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
[INFO] os.detected.name: linux
[INFO] os.detected.arch: x86_64
[INFO] os.detected.version: 5.15
[INFO] os.detected.version.major: 5
[INFO] os.detected.version.minor: 15
[INFO] os.detected.release: ubuntu
@danielkec
danielkec / LargeUpload.java
Created August 2, 2022 11:33
Upload stream
import java.io.FileInputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.time.Duration;
import java.util.Arrays;
import java.util.concurrent.ExecutorService;
import io.helidon.common.configurable.ThreadPoolSupplier;
import io.helidon.common.http.DataChunk;
server:
port: 8080
tls.private-key.keystore:
resource.resource-path: server.p12
passphrase: password
@ServerEndpoint("/ws/echo")
public class EchoEndpoint {
@OnMessage
public void onMessage(Session session, String message) throws Exception {
session.getBasicRemote().sendText("Did you send " + message + "?");
}
}
public static void main(String[] args) {
WebServer.builder(
Routing.builder()
.register("/ws", TyrusSupport.builder()
.register(ServerEndpointConfig.Builder.create(WsEndpoint.class, "/echo").build())
.build()
)
)
.port(8080)
.tls(WebServerTls.builder()
@Path("/example")
@ApplicationScoped
public class LRAExampleResource {
@PUT
@LRA(value = LRA.Type.REQUIRES_NEW, timeLimit = 500, timeUnit = ChronoUnit.MILLIS)
@Path("start-example")
public Response startExample(@HeaderParam(LRA_HTTP_CONTEXT_HEADER) URI lraId, String data){
// Executed in the scope of new LRA transaction
return Response.ok().build();