Skip to content

Instantly share code, notes, and snippets.

View alvesvaren's full-sized avatar

Alve Svarén alvesvaren

View GitHub Profile
@alvesvaren
alvesvaren / config.txt
Created November 10, 2024 12:23
Equalizer APO Config - Topping E2x2 + DT990 Pro (eq:ed to harman) + AT2020 (with compressor)
Device: Playback 1/2 E2x2 {1b3759f4-fe70-4472-8542-9f45367b8348}
Preamp: -5.6 dB
Filter: ON PK Fc 63 Hz Gain -3.8 dB Q 0.7
Filter: ON LSC Fc 105 Hz Gain 5.5 dB Q 0.71
Filter: ON PK Fc 160 Hz Gain -2.6 dB Q 0.8
Filter: ON PK Fc 680 Hz Gain 3.5 dB Q 0.7
Filter: ON PK Fc 1170 Hz Gain -2.1 dB Q 1.2
Filter: ON PK Fc 2000 Hz Gain 1 dB Q 1
Filter: ON PK Fc 2900 Hz Gain -1.5 dB Q 3
Filter: ON PK Fc 5950 Hz Gain -6.4 dB Q 3.5
@alvesvaren
alvesvaren / clipapex.ahk
Created August 7, 2024 18:41
Clip the cursor to apex in dx12 mode
#Requires AutoHotkey v2.0
; r5apex.exe if not using dx12 beta
exeName := "r5apex_dx12.exe"
#SingleInstance force
pData := DllCall("GlobalAlloc", "uint", 0, "uptr", 16, "ptr")
@alvesvaren
alvesvaren / text_wrap.cpp
Created January 29, 2024 13:36
Text wrapping for the esphome display api
#include <vector>
#include <string>
#include <sstream>
#include "esphome/components/display/display_buffer.h"
#include "text_wrap.h"
using namespace esphome;
using namespace esphome::display;
void wrap_text(DisplayBuffer* it, int x, int y, const char* text, Font* font, TextAlign align, float line_height) {
@alvesvaren
alvesvaren / ahtx0.h
Created May 21, 2023 17:01
ESPHome AHT20 Temperature and humidity custom component config using Adafruits AHTX0 library
// Put this in the ESPHome folder in your home assistant configuration
#include "esphome.h"
#include <Wire.h>
#include "Adafruit_AHTX0.h"
#define TAG "ahtx0"
class AHTX0Sensor : public PollingComponent {
@alvesvaren
alvesvaren / Schoolsoft-betygssak.user.js
Last active May 22, 2022 13:26
Räkna ut jämförelsetal för uppskattade betyg i schoolsoft
// ==UserScript==
// @name Betygsak
// @namespace http://tampermonkey.net/
// @version 1.1
// @description Räknar ut faktiskt jämförelsetal efter uppskattade betyg i pågående kurser
// @author Alve Svarén
// @match https://sms.schoolsoft.se/nti/jsp/student/right_student_course.jsp?menu=course
// @icon https://www.google.com/s2/favicons?domain=schoolsoft.se
// @grant none
// ==/UserScript==
@alvesvaren
alvesvaren / README.md
Last active April 19, 2022 06:50
Python 3 script to convert Dashlane csv-export to Bitwarden importable csv

Dashlane web export to bitwarden vault

I have only tested it on linux but it should work on windows+macos too.

To use:

  1. Make sure python 3 is installed
  2. Export the data from dashlane by visiting the web app, then pressing "My account" > "Settings" > "Export Data"
  3. Unzip the .zip-file downloaded from dashlane
  4. Download this script and put it in the same folder as the unzipped dashlane files
  5. Open a terminal in the folder where the csv-file is located
@alvesvaren
alvesvaren / auto-cert.sh
Last active August 22, 2024 13:25
install wings
#!/bin/bash
apt-get update && apt-get install -y certbot
certbot certonly --standalone --email $EMAIL -nd $DOMAIN
@alvesvaren
alvesvaren / updatefans.sh
Last active November 4, 2023 18:20 — forked from fragtion/fanspeeds.sh
Dell R710 (and possibly other) temperature-based fan speeds script
#!/bin/bash
# Script for checking the temperature reported by the ambient temperature sensor,
# and if deemed too high send the raw IPMI command to enable dynamic fan control.
#
# Also get CPU temps from lm-sensors and adjust fan speeds according to defined
# speed % which should be set according to your needs (each CPU model will vary)
#
# Requires:
# ipmitool – apt install ipmitool
@alvesvaren
alvesvaren / library.c
Created November 28, 2020 18:53
Run C code from python
#include <stdio.h>
void say(char* message)
{
printf(message);
printf("\n");
}
int sum(int num1, int num2) {
return num1 + num2;
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any