Skip to content

Instantly share code, notes, and snippets.

View splatch's full-sized avatar

Łukasz Dywicki splatch

View GitHub Profile
@splatch
splatch / socketcan@.service
Last active November 1, 2020 21:50 — forked from sebastianhaas/socketcan-interface.service
An example systemd template unit file to setup a SocketCAN interface on startup
[Unit]
Description=SocketCAN interface %i with a baudrate of 500000
After=multi-user.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/sbin/ip link set %i type can bitrate 500000 ; /sbin/ifconfig %i up
ExecReload=/sbin/ifconfig %i down ; /sbin/ip link set %i type can bitrate 500000 ; /sbin/ifconfig %i up
ExecStop=/sbin/ifconfig %i down
root@intel-corei7-64:/home/connectorio# dmesg|grep -i usb
[ 0.982102] ACPI: bus type USB registered
[ 0.983095] usbcore: registered new interface driver usbfs
[ 0.984061] usbcore: registered new interface driver hub
[ 0.985073] usbcore: registered new device driver usb
[ 1.873106] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.881511] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 1.889616] uhci_hcd: USB Universal Host Controller Interface driver
[ 1.899090] xhci_hcd 0000:00:15.0: new USB bus registered, assigned bus number 1
[ 1.915125] hub 1-0:1.0: USB hub found
@splatch
splatch / gist:4c7f435dfce0ff4dcaa59aec2d0b1760
Created August 10, 2020 21:49
BitBake error with zulu jdk after update to dunfell
WARNING: zulu-ezdk-x86-11.0.7-u10 do_package: KeyError in ./package/usr/share/zulu-11.0.7_10/DISCLAIMER
ERROR: zulu-ezdk-x86-11.0.7-u10 do_package: Error executing a python function in exec_python_func() autogenerated:
The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
0001:
*** 0002:sstate_report_unihash(d)
0003:
File: '/work/poky/meta/classes/sstate.bbclass', lineno: 840, function: sstate_report_unihash
0836: report_unihash = getattr(bb.parse.siggen, 'report_unihash', None)
@splatch
splatch / Main.java
Last active July 30, 2020 20:52
PLC4X 0.6 + ADS with an extra work to read symbol table.
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import org.apache.commons.codec.binary.Hex;
import org.apache.plc4x.java.PlcDriverManager;
import org.apache.plc4x.java.api.PlcConnection;
@splatch
splatch / wireguard-client.bb
Last active July 14, 2020 08:42
Working wireguard client recipe
DESCRIPTION = "Wireguard VPN client configuration on /data partition"
HOMEPAGE = "https://connectorio.com/"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
# variables used to pre-populate wireguard interface
export WG_CLIENT_ADDRESS ?= ""
export WG_CLIENT_PRIVATE_KEY ?= ""
export WG_CLIENT_PRESHARED_KEY ?= ""
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<!-- =============================================================== -->
<!-- Configure the Jetty Server -->
<!-- -->
<!-- Documentation of this file format can be found at: -->
<!-- http://wiki.eclipse.org/Jetty/Reference/jetty.xml_syntax -->
<!-- =============================================================== -->
BACnetPDU ::= CHOICE {
confirmed-request-pdu
unconfirmed-request-pdu
simple-ack-pdu
complex-ack-pdu
segment-ack-pdu
error-pdu
reject-pdu
abort-pdu
}
// I don't know it makes any sense at all, it's just a random rant in code.
import org.slf4j.Logger;
import java.util.Arrays;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.function.BiConsumer;
import java.util.function.Supplier;
class FunctionalLogger {
Cache<String, Integer> cache = getCache(CACHE_ID); // wrapper around Hazelcast Map
cache.put("one", 1);
cache.put("two", 2);
cache.put("three", 3);
Map<String, Integer> map = cache.asMap(); // map representation of cache
assertThat(map).hasSize(3).containsOnly(
entry("one", 1),
entry("two", 2),
I am using Cassandra since few years now and I went into few troubles till now which simply
pushed me away from even trying to become part of "open source" Cassandra community.
Since I worked with Apache projects ealier on I was looking forward to modernize way how
cassandra was built. Project uses ant script and it's not problem that it was not modern
enough, but it simply caused some troubles which hit me. I invested fair amount of time
in collecting project dependencies and separating source roots (server/client etc), but
project team simply refused this direction. Whole discussion started here:
http://mail-archives.apache.org/mod_mbox/cassandra-dev/201503.mbox/%3C287F5EBC-3C2E-44FE-B652-D0A267646ABF@code-house.org%3E
People who worked on project were rather defensing any changes in this area despite of