Skip to content

Instantly share code, notes, and snippets.

@truh
truh / settings.json
Created August 11, 2024 11:33
Zed config
// Zed settings
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
//
// To see all of Zed's default settings without changing your
// custom settings, run the `open default settings` command
// from the command palette or from `Zed` application menu.
{
"theme": "Catppuccin Mocha",
import React from "react";
import PropTypes from "prop-types";
import IconButton from "@rjsf/core/lib/components/IconButton";
import {
ADDITIONAL_PROPERTY_FLAG,
deepEquals,
getDisplayLabel,
getSchemaType,
isSelect,
mergeObjects,
@truh
truh / hll2375dw-cups.nix
Created November 2, 2019 12:29
NixOS Driver for Brother HL-L2375DW Printer
{ stdenv, fetchurl, makeWrapper
, cups
, dpkg
, a2ps, ghostscript, gnugrep, gnused, coreutils, file, perl, which
}:
stdenv.mkDerivation rec {
pname = "hll2375dw-cups";
version = "4.0.0-1";
@truh
truh / netdata-master-error.log
Created October 25, 2019 07:51
Netdata error.logs
2019-10-25 07:43:47: netdata INFO : MAIN : resources control: allowed file descriptors: soft = 1048576, max = 1048576
2019-10-25 07:43:47: netdata INFO : MAIN : Adjusted my Out-Of-Memory (OOM) score from 0 to 1000.
2019-10-25 07:43:47: netdata ERROR : MAIN : Cannot adjust netdata scheduling policy to idle (5), with priority 0. Falling back to nice. (errno 38, Function not implemented)
2019-10-25 07:43:47: netdata ERROR : MAIN : Cannot get my current process scheduling policy. (errno 38, Function not implemented)
2019-10-25 07:43:47: netdata INFO : MAIN : netdata started on pid 1.
2019-10-25 07:43:47: netdata INFO : MAIN : Executing /usr/libexec/netdata/plugins.d/system-info.sh
2019-10-25 07:43:47: netdata INFO : MAIN : NETDATA_SYSTEM_OS_NAME="Alpine Linux"
2019-10-25 07:43:47: netdata INFO : MAIN : NETDATA_SYSTEM_OS_ID=alpine
2019-10-25 07:43:47: netdata INFO : MAIN : NETDATA_SYSTEM_OS_ID_LIKE=unknown
2019-10-25 07:43:47: netdata INFO : MAIN : NETDATA_SYSTEM_OS_VERSION=unknown
docker run -it --rm --privileged -v /dev/bus/usb:/dev/bus/usb \
moonvision/moonbox:vendor-tag \
python -c "from harvesters.core import Harvester; \
h = Harvester(); \
h.add_cti_file('/opt/pylon5/lib64/gentlproducer/gtl/ProducerU3V-1.4.0.cti'); \
h.update_device_info_list(); \
print('Devices: ', h.device_info_list)"
FROM moonvision/moonbox:genicam-latest
# Install the camera library as instructed by the camera or library vendor
RUN install_camera_library
# Register libraries with linker
RUN echo /path/to/lib/files/ > /etc/ld.so.conf.d/vendor-libs.conf
FROM ubuntu AS builder
RUN apt install a lot of dependencies
RUN make artifacts
RUN copy artifacts /packages
# At this point the container is often GBs in size
FROM scratch
COPY --from=builder /packages /packages
# Now we have a container that only contains the artifacts
@truh
truh / upsample_changelog.md
Last active March 29, 2019 14:00
Changelog of ONNX Upsample Operator
@truh
truh / rpi0-w_network-manager.md
Created February 21, 2018 10:21
Notes on how to use Network Manager on a headless Raspberry Pi Zero W

Network Manager on headless RPi0 W

Installation

  • Update system
sudo apt update
sudo apt upgrade
import sys
from pathlib import Path
def strListToCStringArray(strList):
code = '{'
for s in strList:
code += '"' + s.replace('\n', '\\n') + '",\n'
code += '}'
return code