Skip to content

Instantly share code, notes, and snippets.

View LinusCDE's full-sized avatar
💭
Things are currently pretty wild in life. So super inactive here rn.

Linus LinusCDE

💭
Things are currently pretty wild in life. So super inactive here rn.
  • /usr/share/loc/germany
  • 07:04 (UTC +01:00)
View GitHub Profile
@LinusCDE
LinusCDE / README.MD
Created November 22, 2019 11:51
reMarkable simple touch toggle daemon

This program will watchout for the buttom combo MIDDLE + RIGHT.
When triggered, it'll grab/ungrab the touchscreen evdev which will prevent any input to be processed by any other app other than the c program (like xochitl).

Compilation

Compile it with gcc either on device or with the oecore (or older poky) cross compiler. No special settings should be required.

Integration

  • Copy the binary to /home/root/touch_toggler
@LinusCDE
LinusCDE / antiwave.py
Last active November 9, 2019 02:59
Negate Wave-File
#!/usr/bin/env python3
'''
Negates all sample points in a wave file.
When both files are played at exactely the same time (e.g. in Audacity or a Video editor)
those files will (in most cases) cancel each other out.
'''
from sys import argv, stderr
from scipy.io import wavfile
@LinusCDE
LinusCDE / ldapsWrapper.py
Last active February 28, 2019 11:41
LdapsWrapper - SSL-Support for ActiveDirectory
#!/usr/bin/env python3
'''
Meant to be used on an ActiveDirectory-Windows-Server since the SSL-Port (636)
doesn't work with GitLabs LDAP implementation (which has AD support).
This script opens a server at port 6636 (default),
accepts SSL-Connections like from GitLab (with encryption set to simple_tls)
and forwards all data to the local ActiveDirectory-Server at port 389 (default).
'''
import javax.swing.*;
/**
* Author: Linus Kaschulla
* (Gist originally created on 28.12.2016 and reposted because I made it public by accident.)
*
* This Java-Class spawns a Window and updates the title as much as possible
* which causes Xorg to freeze and stress out the computers CPU
* CPU-Usage goes up on all programs that control windows e.g. kwin_x11 (other compositors), cairo-dock, etc.
*
@LinusCDE
LinusCDE / midi_player.ino
Last active January 4, 2019 07:35
Beep Midi-Files on Arduino
#define SPEAKER_BOTH 5
/*
* Received data from the streamMidiToArduino.py-Script,
* which generates frequencies from a given midi file
* and streams them using the serial connection
*/
void setup() {
pinMode(SPEAKER_BOTH, OUTPUT);
@LinusCDE
LinusCDE / GpsTie location receiving.md
Last active December 29, 2017 01:28
GpsTie - location receiving script

Just for tinkering. The script is barly commented, but it should be understandable. Basically it receives continuous sent json objects from this app and displays them in a fancy way.

Example input stream from gps sender:

{latitue: 12345, altitude: 67891, ... }\n
{latitue: 12346, altitude: 67891, ... }\n
... (every second)
@LinusCDE
LinusCDE / FontView.kt
Last active December 10, 2017 03:10
FontView - Shows all TTF-Fonts inside a directory
package me.linus.fontview
import java.awt.*
import java.io.File
import java.io.FileInputStream
import javax.swing.*
fun main(args: Array<String>) {
val text = "The quick brown fox jumps over the lazy dog."
var path = "/home/linus/.fonts/google/"
@LinusCDE
LinusCDE / README.md
Last active January 4, 2018 16:28
AdventOfCode 2017 day 7 part 2: Visualisation of the problem

It outputs a json-style tree of all towers/programs that are not balanced.

You need to get the value of the last tower that is unbalanced, but has no unbalanced sub-towers.

To get a good visualization do the following:

Using the input in the repo you'll get this output:

@LinusCDE
LinusCDE / KotlinCommonExtensionFunctions.md
Last active June 20, 2017 16:00
Kotlin common extension Functions

Quick overview of what which extension functions (no iterables) can do in which way

Table of types

Returns / obj. given as it this
used Object also apply
returned Object let run

Examples