Skip to content

Instantly share code, notes, and snippets.

@jnaskali
jnaskali / main.conf
Created August 15, 2023 09:50
Working Linux bluetooth config /etc/bluetooth/main.conf for Sennheiser PXC 550
[General]
Enable=Source,Sink,Media,Socket
#ControllerMode = bredr # Suggested online, doesn't seem to be required anymore
@jnaskali
jnaskali / Wallpaper_from_Reddit.tsk.xml
Created April 9, 2021 05:06
Tasker project: Get HQ Wallpaper from Subreddit(s)
<TaskerData sr="" dvi="1" tv="5.11.14">
<Task sr="task27">
<cdate>1617818040844</cdate>
<edate>1617944528998</edate>
<id>27</id>
<nme>Wallpaper from Reddit</nme>
<pri>100</pri>
<rty>1</rty>
<Action sr="act0" ve="7">
<code>888</code>
@jnaskali
jnaskali / .zshrc
Created January 6, 2021 07:28
One-liner that prints currently running docker containers (to the first - or _, so 'service-web' & 'service-db' only show up as 'service').
type docker &>/dev/null && echo -n "Running containers: " && docker ps --format "{{.Names}}" | grep -o "^[^-_]*" | sort -u | tr '\n' ' ' && echo
# EXAMPLE OUTPUT:
# Running containers: caddy mealie n8n nodebb seafile shadowsocks shiori
@jnaskali
jnaskali / gist:6f9967cd5af524e9b76c401d88fd9336
Created November 8, 2020 07:21
Poll NextCloud's cron.php from inside docker using wget
wget --spider --no-check-certificate --header "Host: nextcloud.domain.here" http://containername/cron.php
@jnaskali
jnaskali / eduroam-iwd.sh
Created May 19, 2020 10:51
Install eduroam for iwd using Arch's DigiCertCA (utu.fi)
#!/bin/sh
echo "This tool will install eduroam for iwd. It will overwrite /var/lib/iwd/eduroam.8021x"
echo -n "Enter eduroam username (with domain): "
read user
echo -n "Enter eduroam password: "
read -s pass
echo
echo "Using sudo to write /var/lib/iwd/eduroam.8021x..."
@jnaskali
jnaskali / Invidious_full-width_video.user.js
Created April 16, 2020 07:58
Userscript with simple CSS that resizes Invidious video players to full-width
// ==UserScript==
// @name Invidious full-width video
// @author jnaskali
// @copyright 2020, Juhani Naskali (www.naskali.fi)
// @license MIT
// @version 1.0
// @namespace https://www.naskali.fi
// @downloadURL https://openuserjs.org/install/jnaskali/Invidious_full-width_video.user.js
//
// @match https://invidio.us/watch?v=*
@jnaskali
jnaskali / firefox-ssh-handler.sh
Created June 14, 2019 10:19
Script to handle SSH links from Firefox in Linux
#!/bin/sh
# Script that opens ssh:// links from Firefox - CC0 by Juhani, www.naskali.fi
# extract the protocol
proto="$(echo $1 | grep -oP '^[a-z]*')" # first letters
# extract the user (if any)
user="$(echo $1 | grep -oP '(?<=:\/\/)(.*)(?=@)')" # text in between :// and @
# extract the host
host="$(echo $1 | grep -oP '(?<=:\/\/|@)([a-z0-9\.]+)(?!.*@)')" # alphanumerals preceded by :// or @, not followed by text@
# extract the port
@jnaskali
jnaskali / gist:811f02a9763079ed7c867a61fbfe5cc1
Created June 14, 2018 11:13
adb pull TitaniumBackup files newer than one day
adb shell "find /storage/sdcard/TitaniumBackup -mtime -1" | tr -d '\r' | xargs -n1 adb pull
@jnaskali
jnaskali / check_github_release.sh
Last active May 5, 2018 08:49
Bash script to check for new GitHub releases
#!/bin/bash
#
# Check if GitHub repos have new releases, compare to last run and notify through AutoRemote, if change
#
# Requires xidel from http://www.videlibri.de/xidel.html#downloads
# Saves last run to /tmp/latest_reponame.txt files
# Array of tracked GitHub repos
githubrepos=('mholt/caddy')
authkey="NOTMYREALKEY"
@jnaskali
jnaskali / geforce-drivercheck.ahk
Last active May 5, 2024 06:40
AutoHotkey script to check for GeForce driver updates and automatically install without telemetry
; NVidia Driver Checker by Juhani Naskali
;
; Requires JSON.ahk class from https://github.com/cocobelgica/AutoHotkey-JSON and 7-zip
#Include <JSON>
7zip := "C:\Program Files\7-Zip\7z.exe"
; Get installed driver version
RegRead, installedVersion, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{B2FE1952-0186-46C3-BAEC-A80AA35AC5B8}_Display.Driver, DisplayVersion