Skip to content

Instantly share code, notes, and snippets.

View agebhar1's full-sized avatar

Andreas Gebhardt agebhar1

View GitHub Profile
@agebhar1
agebhar1 / main.go
Created September 7, 2024 10:18
Date/Time w/ Go
package main
import (
"time"
)
func MustParse(layout, value string) time.Time {
t, err := time.Parse(layout, value)
if err != nil {
panic(err)
@agebhar1
agebhar1 / time.py
Created September 7, 2024 09:25
Date/Time w/ Python
from datetime import datetime, timezone, time, tzinfo, timedelta
# https://docs.python.org/3/library/datetime.html
def parse(v: str) -> None:
dt = datetime.fromisoformat(v)
print(f" {dt}")
print(f"isoformat : {dt.isoformat(timespec='microseconds')}")
@agebhar1
agebhar1 / DaylightSavingTime.java
Created September 6, 2024 15:55
ZonedDateTime.parse() returns wrong ZoneOffset around DST fall transition
import java.time.Instant;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.time.temporal.ChronoUnit;
/*
* https://bugs.openjdk.java.net/browse/JDK-8066982 -- ZonedDateTime.parse() returns wrong ZoneOffset around DST fall transition
*/
public class DaylightSavingTime {
@agebhar1
agebhar1 / README.adoc
Created July 28, 2024 12:57
IBM MQ Remote
@agebhar1
agebhar1 / Makefile
Last active July 14, 2024 11:51
nmap
CFLAGS := -Wall -Werror
server: server.c
@agebhar1
agebhar1 / pom.xml
Created November 11, 2021 19:09
Spring Milestone Maven Repository
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<repositories>
<repository>
<id>repository.spring.milestone</id>
<name>Spring Milestone Repository</name>
<url>https://repo.spring.io/milestone</url>
</repository>
@agebhar1
agebhar1 / mq.txt
Last active January 15, 2022 14:07
IBM MQ Container (Commands)
https://github.com/ibm-messaging/mq-container/blob/master/docs/usage.md
Fix Podman admin:
SET CHLAUTH(DEV.ADMIN.SVRCONN) TYPE(USERMAP) CLNTUSER('admin') MCAUSER(1001) ACTION(REPLACE)
---
http://www.mqseries.net/phpBB/viewtopic.php?t=68135&sid=905fec09d6969f9e0f4d18bfa5665c4d
setmqaut -m QM1 -n SYSTEM.ADMIN.COMMAND.QUEUE -t q -p app -all +inq +put
@agebhar1
agebhar1 / mq.yml
Created November 22, 2020 18:48
MQ
apiVersion: v1
kind: Pod
metadata:
name: mq
spec:
containers:
- image: ibmcom/mq:9.1.5.0-r2
name: mq
env:
- name: LICENSE
@agebhar1
agebhar1 / LdapConfigurationWorkaround.java
Last active October 12, 2019 14:17
Spring embedded LDAP Server
package com.example.springldapbug;
import org.springframework.boot.autoconfigure.ldap.LdapProperties;
import org.springframework.boot.autoconfigure.ldap.embedded.EmbeddedLdapProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.DependsOn;
import org.springframework.core.env.Environment;
import org.springframework.ldap.core.ContextSource;