Skip to content

Instantly share code, notes, and snippets.

@thhart
thhart / gc.log
Created December 22, 2023 09:16
ZGC Log
This file has been truncated, but you can view the full file.
[0.003s][warning][gc,jvmci] Setting EnableJVMCI to false as selected GC does not support JVMCI: z gc
[0.018s][info ][gc,init ] Initializing The Z Garbage Collector
[0.018s][info ][gc,init ] Version: 21.0.1+12-jvmci-23.1-b19 (release)
[0.018s][info ][gc,init ] NUMA Support: Disabled
[0.018s][info ][gc,init ] CPUs: 16 total, 16 available
[0.018s][info ][gc,init ] Memory: 64034M
[0.018s][info ][gc,init ] Large Page Support: Disabled
[0.018s][info ][gc,init ] Address Space Type: Contiguous/Unrestricted/Complete
[0.018s][info ][gc,init ] Address Space Size: 393216M
[0.018s][info ][gc,init ] Heap Backing File: /memfd:java_heap
@thhart
thhart / Sync EFI for systemd: etc_fstab
Last active March 22, 2024 06:46
Sample systemd setup to mount efi partitions and sync them in a service on shutdown
#sample efi file to mount efi partitions and sync them in a service on shutdown
#UUID are different for each system of course, run blkid to see
UUID=EE08-63AC /boot/efi vfat utf8,nofail 0 2
UUID=D6DD-B604 /boot/efi2 vfat utf8,nofail 0 2
UUID=D725-1927 /boot/efi3 vfat utf8,nofail 0 2
UUID=D761-CCBA /boot/efi4 vfat utf8,nofail 0 2
@thhart
thhart / dcc.service
Created November 11, 2021 22:47
dcc systemd startup file
[Unit]
Description=DCC (Distributed Checksum Clearinghouses) interface daemon
[Service]
Type=forking
PermissionsStartOnly=true
RuntimeDirectory=dcc
ExecStart=/var/dcc/libexec/rcDCC start
ExecStop=/var/dcc/libexec/rcDCC stop
User=root
[2021-05-14T09:44:55.582+0200] Using Shenandoah
[2021-05-14T09:44:55.582+0200] Heuristics ergonomically sets -XX:+ShenandoahImplicitGCInvokesConcurrent
[2021-05-14T09:44:55.583+0200] Pacer for Idle. Initial: 491M, Alloc Tax Rate: 1.0x
[2021-05-14T09:44:55.583+0200] Version: 16+36 (release)
[2021-05-14T09:44:55.583+0200] CPUs: 32 total, 32 available
[2021-05-14T09:44:55.583+0200] Memory: 64276M
[2021-05-14T09:44:55.583+0200] Large Page Support: Disabled
[2021-05-14T09:44:55.583+0200] NUMA Support: Enabled
[2021-05-14T09:44:55.583+0200] NUMA Nodes: 2
[2021-05-14T09:44:55.583+0200] Compressed Oops: Enabled (Zero based)
[2021-05-14T09:41:26.450+0200] Initializing The Z Garbage Collector
[2021-05-14T09:41:26.450+0200] Version: 16+36 (release)
[2021-05-14T09:41:26.450+0200] NUMA Support: Disabled
[2021-05-14T09:41:26.450+0200] CPUs: 32 total, 32 available
[2021-05-14T09:41:26.450+0200] Memory: 64276M
[2021-05-14T09:41:26.450+0200] Large Page Support: Disabled
[2021-05-14T09:41:26.450+0200] Workers: 20 parallel, 4 concurrent
[2021-05-14T09:41:26.452+0200] Address Space Type: Contiguous/Unrestricted/Complete
[2021-05-14T09:41:26.452+0200] Address Space Size: 393216M x 3 = 1179648M
[2021-05-14T09:41:26.452+0200] Heap Backing File: /memfd:java_heap
@thhart
thhart / sxhkd.desktop
Created December 24, 2019 12:59
Helpful Linux Laptop User Files
# Copyright 2019 - 2020, Thomas Hartwig
# SPDX-License-Identifier: MIT
# To put into /usr/share/gnome/autostart
[Desktop Entry]
Type=Application
Name=SXHKD
Comment=SXHKD input event automation and remapper.
Exec=sxhkd
Terminal=false
@thhart
thhart / gist:c3d3fac6ba464c063d3c60cfd4a59e98
Last active December 2, 2022 07:52
[Thinkpad Extreme] Install fingerprint reader support for Thinkpad X1 Extreme in Ubuntu 19.x, 20.x
# warning, dirty installation over preinstalled #
# BIOS reset finerpint data might be necessary for proper detection #
# initial sensor detection might take some time after system start #
sudo su
apt install fwupdate
fwupdmgr get-devices
fwupdmgr enable-remote lvfs-testing
fwupdmgr get-devices
fwupdmgr refresh
@thhart
thhart / CatchOutOfMemoryError.java
Last active August 21, 2018 09:50
How to catch an OutOfMemoryError in Java, an approach. This code is based on Log4J but should work with any other logger as well. Every try/catch should contain a logger handler.
import org.apache.log4j.*;
import org.apache.log4j.spi.LoggingEvent;
private static String MEMORY_STRING = "OUT OF MEMORY ERROR MONITORED, EXITING";
static {
Logger.getRootLogger().addAppender(new AsyncAppender() {
public void append(LoggingEvent event) {
if(event.getThrowableInformation() != null) {
if(event.getThrowableInformation().getThrowable() instanceof OutOfMemoryError) {
@thhart
thhart / MnistMLPExample.java
Last active October 19, 2017 13:30
DL4J/SPARK/HADOOP
package org.deeplearning4j.mlp;
import java.net.*;
import java.util.*;
import com.beust.jcommander.Parameter;
import org.apache.spark.SparkConf;
import org.apache.spark.api.java.*;
import org.deeplearning4j.datasets.iterator.impl.MnistDataSetIterator;
import org.deeplearning4j.eval.Evaluation;
import org.deeplearning4j.nn.api.OptimizationAlgorithm;