Skip to content

Instantly share code, notes, and snippets.

View lhw's full-sized avatar

Lennart Weller lhw

View GitHub Profile
@lhw
lhw / ftb_orevein_finder.py
Last active April 22, 2024 04:42
Source: https://www.reddit.com/r/feedthebeast/comments/46s645/immersive_engineering_vein_calculator/ from /u/xavion - repl.it was down this is a copy from the Google cache
# Python port of https://gist.github.com/ApocDev/7d43dfccd00269670de7
class JavaRandom():
def __init__(self, seed):
self.seed = (seed ^ 0x5DEECE66D) & ((1<<48) - 1)
def NextInt(self):
return self.Next(32)
def NextDouble(self):
return ((self.Next(26) << 27) + self.Next(27))/(1<<53)
def Next(self, bits):
@lhw
lhw / x240.registryhack.inf
Created May 30, 2016 15:34
Changes Windows 10 registry to allow use of x250 touchpad buttons on a x240
[Version]
Signature=$CHICAGO$
[DefaultInstall]
AddReg=Group39, Disable_win8_3FVHScrolling_AddReg, UltraNav_Disable_win8_4FVHScrolling_AddReg, AdjustStickMethodAndSpeedFactor_AddReg, DisableIntPDFeature_DefaultOff_AddReg, PseudoSuspend_HotKey_V1, DisableKBCQueryCommand_AddReg, Set_3P2BCP_Feature_AddReg
[PseudoSuspend_HotKey_V1]
HKLM,System\CurrentControlSet\Services\SynTP\Parameters,KBCNotifyConfig,0x00010001,0x00000003
HKLM,System\CurrentControlSet\Services\SynTP\Parameters,PseudoSuspendConfig,0x00010001,1
@lhw
lhw / otool.Dockerfile
Last active December 23, 2020 11:51
venice unleashed docker
FROM python:3.8
RUN apt-get update \
&& apt-get install -yq wget unzip
RUN wget -nc https://github.com/Imposter/otool/archive/vu.zip -O /tmp/otool-vu.zip \
&& cd / \
&& unzip /tmp/otool-vu.zip \
&& pip3 install -r otool-vu/requirements.txt
@lhw
lhw / Makefile
Last active January 22, 2020 14:27
CoreOS PXE VLAN install
#!/usr/bin/env make
# As per CoreOS/ContainerLinux suggestion
# https://coreos.com/os/docs/latest/booting-with-pxe.html#adding-a-custom-oem
ifndef VLAN
$(error VLAN is not set)
endif
all: oem.cpio.gz
@gzip --stdout --decompress oem.cpio.gz | cpio -it
@mv oem.cpio.gz ${VLAN}.cpio.gz
@lhw
lhw / bfme2.yaml
Created January 1, 2020 21:48
bfme2 + rotwk lutris
name: The Lord of the Rings - Battle for Middle-Earth II
game_slug: lord-of-the-rings-battle-for-middle-earth-ii
version: DVD + Fan Patch + HD Mod
slug: wine-bfme2-hd
runner: wine
script:
files:
- patch109:
filename: "BFME2 PatchSwitcher Setup.exe"
@lhw
lhw / schema_swagger.json
Last active November 21, 2019 15:39
Foreman 1.20 swagger api export
{
"swagger": "2.0",
"info": {
"title": "Foreman (params in:body)",
"description": "\n<p>Foreman API v2 is currently the default API version.</p>\n",
"version": "v2",
"x-copyright": ""
},
"basePath": "/api",
"consumes": [
@lhw
lhw / 90-vfio-monitor.rules
Last active May 30, 2018 18:18
Automate switch of monitor inputs via ddc in case the VM is currently running
# Example rule based on a keyboard being added/removed (In this case for a Corsair K70 keyboard)
# Note that the keyboard attaches as two keyboards + led controller
# Try to get the add/remove events down to one each by clearly defining the
# rules. As the ddcutil call can take time even if only checking the current
# output port.
KERNEL=="event1", ACTION=="add|remove", SUBSYSTEM=="input", ATTRS{idVendor}== "1b1c", ATTRS{idProduct}=="1b09", RUN+="/etc/libvirt/hooks/switch_displays.sh"
@lhw
lhw / spotify.sh
Last active April 26, 2018 22:06
Spotify docker container with local cache and dbus mpris integration
#!/bin/bash
set -e
if [[ -n "$(docker ps -qaf 'name=spotify')" ]]; then
docker restart spotify
else
USER_UID=$(id -u)
USER_GID=$(id -g)
xhost "si:localuser:${USER}"
@lhw
lhw / pom.xml
Created August 30, 2012 12:26
maven file with sqlite4java
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.ring0.lhw</groupId>
<artifactId>system</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.almworks.sqlite4java</groupId>
<artifactId>sqlite4java</artifactId>
@lhw
lhw / Dockerfile
Last active June 24, 2016 12:09
Sinusbot Docker Container. Needs the mentioned files in the COPY instructions. Those files may not be redistributed.
FROM debian:jessie
MAINTAINER Lennart Weller <lhw@ring0.de>
ENV TS3_VERSION 3.0.19.1
ENV SINUS_VERSION 0.9.8
RUN apt-get update && \
apt-get install -y xinit xvfb libxcursor1 ca-certificates bzip2 curl libglib2.0-0 python libav-tools && \
rm -r /var/lib/apt/lists/*