Skip to content

Instantly share code, notes, and snippets.

View jkcdarunday's full-sized avatar

Jan Keith Darunday jkcdarunday

View GitHub Profile
@jkcdarunday
jkcdarunday / autoqalc.bash
Last active July 14, 2023 16:47
A script that forwards the input to qalc when the not-found command starts with a number
# Author: Jan Keith Darunday <github@jkcdarunday.mozmail.com>
# Description: A script that forwards the input to qalc when the not-found command starts with a number
# Purpose: So you can directly execute mathematical expressions and currency conversions in the terminal
# Usage: Source the file in your bashrc/zshrc (i.e. `source ~/.zsh/autoqalc.bash`)
if typeset -f command_not_found_handle > /dev/null; then
eval original_"$(declare -f command_not_found_handle)"
else
original_command_not_found_handle() {
"$1: command not found"
@jkcdarunday
jkcdarunday / kde-autobrightness.lua
Last active April 2, 2024 16:27
An MPV script for KDE users that sets the screen brightness to max when going fullscreen while playing a video
-- Author: Jan Keith Darunday <github@jkcdarunday.mozmail.com>
-- Description: An MPV script for KDE users that sets the screen brightness to max when going fullscreen while playing a video
local dbus_path = "/org/kde/Solid/PowerManagement/Actions/BrightnessControl"
local service_name = "local.org_kde_powerdevil"
local max_brightness = tonumber(io.popen("qdbus " .. service_name .. " " .. dbus_path .. " brightnessMax"):read("*all"))
local default_brightness
function get_current_brightness()
@jkcdarunday
jkcdarunday / eth-miners.md
Last active June 23, 2022 00:24
List of Ethereum Mining Software

Keybase proof

I hereby claim:

  • I am jkcdarunday on github.
  • I am jkcdarunday (https://keybase.io/jkcdarunday) on keybase.
  • I have a public key whose fingerprint is FCC8 F97A 2F76 983B 452B 3465 A264 AE9F A46D 05B0

To claim this, I am signing this object:

@jkcdarunday
jkcdarunday / axolittles-rarity.js
Created September 6, 2021 18:11
Axolittles Rarity
{
Background: [
{ attribute: 'St Patrick', count: 475, rarity: '4.75%' },
{ attribute: 'Orange', count: 1030, rarity: '10.30%' },
{ attribute: 'Blue', count: 1225, rarity: '12.25%' },
{ attribute: 'Cyan', count: 1240, rarity: '12.40%' },
{ attribute: 'Magenta', count: 1257, rarity: '12.57%' },
{ attribute: 'Purple', count: 1563, rarity: '15.63%' },
{ attribute: 'Fuchsia', count: 1569, rarity: '15.69%' },
{ attribute: 'Yellow', count: 1640, rarity: '16.40%' }
@jkcdarunday
jkcdarunday / switch-audio.sh
Last active April 2, 2024 07:24
A shell script that switches to the next available Pulseaudio/Pipewire Pulse output device/sink
#!/bin/bash
# Author: Jan Keith Darunday <github@jkcdarunday.mozmail.com>
# Description: A shell script that switches to the next available Pulseaudio output device/sink
# Note: This uses pactl instead of pacmd since pacmd is not available in pipewire
function get_current_sink() {
pactl info | sed -En 's/Default Sink: (.*)/\1/p'
}
SINKS=$(pactl list short sinks | grep -v easyeffects)
// ==UserScript==
// @name Taiga Ctrl+Enter support
// @version 1
// @description Maintained by Keith
// @grant none
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
// @require https://gist.github.com/BrockA/2625891/raw/waitForKeyElements.js
// @include https://tchaikovsky.web.lt/*
// @include http://tchaikovsky.web.lt/*
// ==/UserScript==
skeithc@freedom ~ % ethminer --help
Usage ethminer [OPTIONS]
Options:
Work farming mode:
-F,--farm <url> Put into mining farm mode with the work server at URL (default: http://127.0.0.1:8545)
-FF,-FO, --farm-failover, --stratum-failover <url> Failover getwork/stratum URL (default: disabled)
--farm-retries <n> Number of retries until switch to failover (default: 3)
-S, --stratum <host:port> Put into stratum mode with the stratum server at host:port
-SF, --stratum-failover <host:port> Failover stratum server at host:port