Skip to content

Instantly share code, notes, and snippets.

View kopiro's full-sized avatar

Flavio Maria De Stefano kopiro

View GitHub Profile
@kopiro
kopiro / flipper-upgrade
Last active October 11, 2023 13:44
Automatic Flipper Zero upgrade from UberGuidoZ repository
#!/bin/bash
FLIPPER_APPS_DIR="/tmp/UberGuidoZFlipper"
FLIPPER_SD_DIR="/Volumes/Flipper SD"
if [ ! -d "$FLIPPER_SD_DIR" ]; then
echo "Flipper SD card not found at $FLIPPER_SD_DIR"
exit 1
fi
@kopiro
kopiro / tv-hyperhdr.sh
Created January 20, 2023 19:07
HyperHDR on/off binary with WebOS 4.x autostart patch
#!/bin/bash
IP="192.168.0.45"
MAC="AA-BB-CC-DD-EE-FF"
get_status() {
/usr/bin/curl -s "http://$IP:8090/json-rpc?request=%7B%22command%22:%22serverinfo%22%7D"
}
call_autostart() {
@kopiro
kopiro / Configuration.h
Last active November 9, 2022 13:47
Artillery Hornet with BLTouch Probe - Marlin 2.1.1
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
#!/bin/sh
set -e -o pipefail
MOUNT_TARGET="/usr/palm/applications/com.webos.app.screensaver/qml/main.qml"
QML_PATH="$(dirname "$(realpath "$0")")/screensaver-main.qml"
if [[ ! -f "$MOUNT_TARGET" ]]; then
echo "[-] Target file does not exist: $MOUNT_TARGET" >&2
exit 1
@kopiro
kopiro / nQueenBT.js
Created September 14, 2022 09:19
N-Queen with Backtrack
function printBoard(board, method = "log") {
console[method](board.map((e) => e.join("")).join("\n"));
}
function createDiagonalMatrix(_) {
_.takenDiagonal = [];
_.diagonalMatrix = new Array(_.n).fill().map(() => new Array(_.n).fill(-1));
// first row
for (let y = 0; y < _.n; y++) {
@kopiro
kopiro / README.md
Created May 6, 2022 18:57 — forked from Informatic/README.md
openlgtv webOS hacking notes

This is just a dump of some interesting undocumented features of webOS (3.8 specifically, on early 2018 4k LG TV) and other development-related tips.

Homebrew app ideas

@kopiro
kopiro / defaults_diff.sh
Last active May 16, 2022 17:06
Get notification when preference from `defaults` change
cmd="defaults read"; left=$(eval $cmd); while true; do right=$(eval $cmd); diff <( printf '%s' "$left") <( printf '%s' "$right"); left="$right"; sleep 1; done
@kopiro
kopiro / TeliaWidget.js
Last active January 10, 2022 17:58
Telia Scriptable widget
// icon-color: purple; icon-glyph: newspaper;
/*
Telia Scriptable widget
Version: 0.0.1
You need to know your subscription ID from your Telia Plan
and grab a session cookie by logging in into the mobile-app
@kopiro
kopiro / telia_gb_left.sh
Last active January 14, 2022 21:06
Telia GB Left (XBar)
#!/bin/bash
# <xbar.title>Telia GB Left</xbar.title>
# <xbar.version>v1.0</xbar.version>
# <xbar.author>Flavio De Stefano</xbar.author>
# <xbar.author.github>kopiro</xbar.author.github>
# <xbar.var>string(SESSID=""): Session ID</xbar.var>
# <xbar.var>string(SUBSCRIPTION_ID=""): Subscription ID; if left blank, the first subscription found is gonna be used</xbar.var>
headers='-H "Accept: application/json" -H "X-IOS-Build: 4068" -H "ga-av: 10.10.4" -H "ga-aid: com.teliasonera.selfservice.telia" -H "User-Agent: com.teliasonera.selfservice.telia/10.10.4 (iOS 15.2; Apple)" -H "ga-an: Mitttelia"'
@kopiro
kopiro / atv4-kopiro.sh
Last active March 9, 2022 23:42
Aerial TV on Raspberry PI
#!/bin/bash
set -x
[[ $EUID -eq 0 ]] && {
echo "Do not run this as the root user"
exit 1
}
[[ -z "$XDG_CONFIG_HOME" ]] &&