Skip to content

Instantly share code, notes, and snippets.

@ptrm
ptrm / .update_cpufreq
Last active February 8, 2021 22:10
Set of sheel.scripts to automatically update cpufreq to overclock Odroid Go Advance/Super
#!/usr/bin/env bash
set -euo pipefail
rrvl_conf='/boot/rrvl.conf'
args=($@)
freq="${args[0]:-}"
if [[ $freq == '-' ]]; then
state.rockchiprk817co {
control.1 {
iface MIXER
name 'Playback Path'
value HP
comment {
access 'read write'
type ENUMERATED
count 1
item.0 OFF
02/08/20-11:49:57 INFO request {
menu_driver = "rgui"
["url"] = "https://m.gutenberg.org/ebooks/search.mobile/?format=opds&query=author:Mellville",
["method"] = "HEAD",
["headers"] = {
["Host"] = "m.gutenberg.org"
},
["sink"] = function: 0x72fdfa78
}
02/08/20-11:49:59 DEBUG cache opds|catalog|https://m.gutenberg.org/ebooks/search.mobile/?format=opds&query=author:Mellville
@ptrm
ptrm / crash-selection.log
Last active January 26, 2020 10:54
Crash on multipage selection – screen freezes after finger lift and beginning of selection is shown with black rectangle marker at its start.
01/26/20-11:38:00 DEBUG CreDocument: goto page 82
01/26/20-11:38:00 DEBUG _refresh: Enqueued partial update for region 0 0 1440 1920
01/26/20-11:38:00 DEBUG setDirty partial from widget ReaderUI w/ NO region
01/26/20-11:38:00 DEBUG painting widget: ReaderUI
# 01/26/20-11:38:00 readerview painting {
["y"] = 0,
["x"] = 0,
["h"] = 1920,
["w"] = 1440
} to 0 0
@ptrm
ptrm / defaults.persistent.lua
Last active December 19, 2019 09:35
Koreader smaller zones
-- For configuration changes that persists between updates
_USR_ZONE_DIVIDER = 16
_USR_ZONE_AMOUNT_FAR = (_USR_ZONE_DIVIDER - 1) / _USR_ZONE_DIVIDER
_USR_ZONE_AMOUNT_CLOSE = 1 / _USR_ZONE_DIVIDER
DTAP_ZONE_TOP_RIGHT = {
["y"] = 0,
["h"] = _USR_ZONE_AMOUNT_CLOSE,
["x"] = _USR_ZONE_AMOUNT_FAR,
@ptrm
ptrm / install_docker_bash_completions.sh
Created December 16, 2019 10:09 — forked from toschneck/install_docker_bash_completions.sh
Install Docker and Docker-Compose bash completion
#!/usr/bin/env bash
set -e
echo "install docker bash completion"
curl -f -L "https://raw.githubusercontent.com/docker/docker-ce/$(docker version --format '{{.Server.Version}}' | sed -E 's/((\.?[^.]+){2}).*/\1/')/components/cli/contrib/completion/bash/docker" -o /etc/bash_completion.d/docker
echo "install docker-compose bash completion"
curl -f -L https://raw.githubusercontent.com/docker/compose/$(docker-compose version --short)/contrib/completion/bash/docker-compose -o /etc/bash_completion.d/docker-compose
echo ".... done!"
@ptrm
ptrm / rclone-filter.txt
Last active December 24, 2019 05:06
Kobo rclone sync / update script
- .cache
- *.sdr/
- .*
add_action( 'generate_rewrite_rules', 'custom_post_type_base' );
function custom_post_type_base( $wp_rewrite ) {
$newrules = array();
foreach ( get_post_types( array( '_builtin' => false, 'public' => true, 'rewrite' => array() ), 'objects' ) as $post_type => $post_type_object ) {
$slug = $post_type_object->rewrite['slug'] ? $post_type_object->rewrite['slug'] : $post_type;
$newrules["$slug/?$"] = "index.php?post_type=$post_type";
$newrules["$slug/feed/?$"] = "index.php?post_type=$post_type&feed=rss2";
$newrules["$slug/feed/(feed|rdf|rss|rss2|atom)/?$"] = "index.php?post_type=$post_type&feed=\$matches[1]";
$newrules["$slug/page/?([0-9]{1,})/?$"] = "index.php?post_type=$post_type&paged=\$matches[1]";