Skip to content

Instantly share code, notes, and snippets.

View jsjolund's full-sized avatar

Johannes Sjölund jsjolund

View GitHub Profile
@jsjolund
jsjolund / xmonad.hs
Last active October 17, 2023 22:57
Example of using xmonad inside xfce
-------------------------------------------------------------------------------
-- Configuration for using Xmonad inside Xfce, KDE and standalone.
--
-- Xfce: It is recommended to disable/remove xfwm4 and xfdesktop.
-- KDE: Plasma works with xmonad, except
-- 1. Mouse cursor cannot focus on empty monitors.
-- 2. Panel start-menu search field cannot receive input.
-------------------------------------------------------------------------------
@jsjolund
jsjolund / dso5000p-scrot.py
Last active March 30, 2017 16:52
Hantek DSO5000P oscilloscope screenshot using python PIL
#!/usr/bin/env python
from PIL import Image
import array
import usb
import time
png_path = "/tmp/"
png_name = "DSO_Screenshot_" + time.strftime('%Y-%m-%d_%H-%M-%S') + ".png"
@jsjolund
jsjolund / protobuf-deserialize.groovy
Created September 15, 2020 13:07
Deserialize Protobuf content using compiled descriptor schema with Groovy
@Grapes([
@Grab(group='com.google.protobuf', module='protobuf-java', version='3.8.0'),
@Grab(group='com.google.protobuf', module='protobuf-java-util', version='3.8.0'),
])
import com.google.protobuf.DescriptorProtos
import com.google.protobuf.Descriptors
import com.google.protobuf.DynamicMessage
import com.google.protobuf.util.JsonFormat
import java.io.FileInputStream
import java.nio.file.Files
@jsjolund
jsjolund / aiowatch.py
Last active November 3, 2022 11:29 — forked from mivade/aiowatch.py
Using watchdog with asyncio
import asyncio
from pathlib import Path
from typing import Optional
from watchdog.events import FileSystemEvent, FileSystemEventHandler
from watchdog.observers import Observer
class _EventHandler(FileSystemEventHandler):
def __init__(self, queue: asyncio.Queue, loop: asyncio.BaseEventLoop,

Xmonad + Gnome integration for Ubuntu 19.10

The guide at https://wiki.haskell.org/Xmonad/Using_xmonad_in_Gnome#Ubuntu is increasingly out of date and was already pretty flaky by Ubuntu 16-18. This guide is for Ubuntu 19.10.

I'll try to include some additional context for whats going on so that when things change again it should hopefully not leave you completely lost.

What I want (AKA you can ignore this if your response isn't "Just don't use xmonad + gnome")

@jsjolund
jsjolund / weechat_grayout.txt
Created September 26, 2022 17:05 — forked from fats/weechat_grayout.txt
[weechat] Gray out join/part/quit messages
/set irc.look.color_nicks_in_server_messages off
/set colorize_nicks.look.ignore_tags irc_join,irc_part,irc_quit
/set irc.color.message_join darkgray
/set irc.color.message_quit darkgray
/set irc.color.reason_quit darkgray
/set weechat.color.chat_tags darkgray
/set weechat.color.chat_nick darkgray
/set weechat.color.chat_host darkgray
/set weechat.color.chat_delimiters darkgray
/set weechat.color.chat_channel darkgray
@jsjolund
jsjolund / string-conversion.rs
Created September 26, 2022 21:11 — forked from jimmychu0807/string-conversion.rs
Conversion between String, str, Vec<u8>, Vec<char> in Rust
use std::str;
fn main() {
// -- FROM: vec of chars --
let src1: Vec<char> = vec!['j','{','"','i','m','m','y','"','}'];
// to String
let string1: String = src1.iter().collect::<String>();
// to str
let str1: &str = &src1.iter().collect::<String>();
// to vec of byte
@jsjolund
jsjolund / .gitignore
Created October 16, 2022 12:07
$HOME/.gitignore
# Ignore everything
/**
# But not these files...
!.gitignore
!.vimrc
!.bashrc
!.Xresources
!.qjoypad3
[package]
edition = "2021"
name = "hello-wasm"
version = "0.1.0"
[lib]
crate-type = ["cdylib", "rlib"]
[dependencies]
js-sys = "0.3"

a00r00wst01

hostname Zabbix name Zabbix key
a00r00wst01 Absolute Humidity - Actual -humidity-type.absolute-function.actual-location.outdoor
a00r00wst01 Absolute Pressure - Actual -pressure-type.absolute-function.actual-location.outdoor
a00r00wst01 Air Density -density-location.outdoor
a00r00wst01 Compass direction -direction-source.compass-location.outdoor
a00r00wst01 Dew Point - Actual -dewpoint-function.actual-location.outdoor
a00r00wst01 Global Radiation - Actual -radiation-type.global-function.actual-location.outdoor
a00r00wst01 Heating Temperature R2S -temperature-type.heating-location.outdoor-source.r2s