Skip to content

Instantly share code, notes, and snippets.

View helidon301-rsmsg30-Tck.log
[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
View LargeUpload.java
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;
View wss_helidon_mp.yaml
server:
port: 8080
tls.private-key.keystore:
resource.resource-path: server.p12
passphrase: password
View wss_helidon_mp.java
@ServerEndpoint("/ws/echo")
public class EchoEndpoint {
@OnMessage
public void onMessage(Session session, String message) throws Exception {
session.getBasicRemote().sendText("Did you send " + message + "?");
}
}
View wss_helidon_se.java
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()
View Participant.java
@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();
@danielkec
danielkec / rest_cmd_example.md
Last active Mar 10, 2022
Homeassistant rest_command example
View rest_cmd_example.md
View ms-teams-phone-du.md

Odevzdání DU pomocí MS Teams v mobilu

Pomocí fotoaparátu v mobilním telefonu vyfotíme domácí úkol, fotografií může být více:

Otevřeme mobilní aplikaci MS Teams a vybereme záložku: Zadání

Zadání jsou řazena ve dvou skupinách Zadáno a Dokončeno.

View ubuntu_vpn_switch_proxy.md
kec@romulus:~$ cat /etc/NetworkManager/dispatcher.d/10-vpnupdown 
#!/bin/bash

session_user="kec"
session_bus=unix:path=/run/user/$(id -u $session_user)/bus
session_display=$(who | grep $session_user | awk '{print $2}')
as_user="sudo -Hu kec DISPLAY=${session_display} DBUS_SESSION_BUS_ADDRESS=${session_bus}"

if [ "$2" = "vpn-up" ]; then