Skip to content

Instantly share code, notes, and snippets.

View marvinlehmann's full-sized avatar

Marvin Lehmann marvinlehmann

View GitHub Profile
@mironovdm
mironovdm / LE_autoconnect_timeout.md
Last active October 4, 2024 21:23
Change LE autoconnect timeout

This tool can read current or change default HCI_LE_AUTOCONN_TIMEOUT value for Bluetooth adapter on Linux. The default value is defined for the kernel 5.15 at include/net/bluetooth/hci.h:

#define HCI_LE_AUTOCONN_TIMEOUT	msecs_to_jiffies(4000)	/* 4 seconds */

and it can be too low if the advertising interval for a device is high (for power saving).

You can also change the value in /etc/bluetooth/main.conf, line LEAutoconnecttimeout. The value in ms and will be applied at boot or when bluetooth service is restarted.

The tool changes timeout to hardcoded value 16000ms. You can change value NEW_LE_AUTOCONN_TIMEOUT in the lower source file to required value .

@psbaltar
psbaltar / sleep_as_android_webhooks.yaml
Last active October 31, 2025 13:00
Home Assistant blueprint for handling Sleep as Android webhooks events
blueprint:
name: Sleep as Android webhook handler
description: >
Home Assistant blueprint for handling Sleep as Android webhooks events
In Sleep as Android app, set Webhooks URL to:
https://<home-assistant-host>/api/webhook/<webhook-id>
@MadeBaruna
MadeBaruna / README.md
Last active November 17, 2025 20:52
Get Genshin Impact wish history link
@MadeBaruna
MadeBaruna / importer.ps1
Last active November 11, 2024 08:36
Paimon.moe Local Importer (Windows)
Add-Type -AssemblyName System.Web
Write-Host "Paimon.moe Wish Importer" -ForegroundColor Cyan
Write-Host "1. Open Genshin Impact in this PC"
Write-Host "2. Then open the wish history and wait it to load"
Write-Host "3. When you are ready press [ENTER] to continue! (or any key to cancel)"
Write-Host "Waiting..."
$keyInput = [Console]::ReadKey($true).Key
if ($keyInput -ne "13") {
@xamantra
xamantra / [ANIME]MyAnimeList-DeleteAllEntry-ClassicListStyle.js
Last active November 5, 2025 18:28
Delete all entries inside a list category in MAL. Useful for getting a fresh start in your Plan to Watch or any other section (Completed, On Hold, Dropped, Currently Watching).
var index = 0;
if (confirm(`Are you sure you want to DELETE ALL your entries in this section?`)) {
$("a.animetitle").each(function () {
var animeLink = $(this).attr("href");
var animeId = animeLink.substring(
animeLink.lastIndexOf("anime/") + 6,
animeLink.lastIndexOf("/")
);
var deleteUrl = `/ownlist/anime/${animeId}/delete`;
setTimeout(function () {
# Permissions
Change permissions for user, groups, and others on files and directories.
## Command
chmod
## Syntax
chmod -destination+-permissions /path/to/dir/or/file
### Recursive argument
@kitmenke
kitmenke / finderrors.ps1
Created August 1, 2016 02:45
Working in progress: powershell script to automatically fix DCOM errors which show up in the event log
# Get-EvengLog doesn't quite work I guess:
# https://stackoverflow.com/questions/31396903/get-eventlog-valid-message-missing-for-some-event-log-sources#
# Get-EventLog Application -EntryType Error -Source "DistributedCOM"
# The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID
#$logs = Get-EventLog -LogName "System" -EntryType Error -Source "DCOM" -Newest 1 -Message "The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID*"
# 2 is error
# 3 is warning
$EVT_MSG = "The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID"
# Search for System event log ERROR entries starting with the specified EVT_MSG
$logEntry = Get-WinEvent -FilterHashTable @{LogName='System'; Level=2} | Where-Object { $_.Message -like "$EVT_MSG*" } | Select-Object -First 1
// ==UserScript==
// @name Auto Steam Discovery Queue
// @namespace http://steamcommunity.com/id/zetx/
// @description Go to next game queued as soon as page is done loading.
// @include http://store.steampowered.com/app/*
// @include http://store.steampowered.com/explore/*
// @include http://store.steampowered.com/agecheck/app/*
// @version 2.01
// @run-at document-end
// @grant none
@xPaw
xPaw / steam_quick_queue.user.js
Last active October 12, 2025 04:37
⚠ This script has been integrated into SteamDB browser extension!
// ==UserScript==
// @name Steam Queue Auto Discoverer
// @description Discover the Steam queue three times to get the sale cards
// @version 2.3.0
// @namespace https://gist.github.com/xPaw/73f8ae2031b4e528abf7
// @icon https://store.steampowered.com/favicon.ico
// @match https://store.steampowered.com/explore*
// @grant none
// ==/UserScript==