Skip to content

Instantly share code, notes, and snippets.

@TalalMash
TalalMash / payload.ps1
Last active February 21, 2025 08:02
Powershell: Convert Codemagic iOS debug artifact (--release) to unsigned IPA
# Set paths for your source zip file and destination zip file
$currentDir = Get-Location
$sourceZip = "$currentDir\Runner.app.zip" # Modify with the actual path
$destinationZip = "$currentDir\Payload.zip" # Modify with the desired path for the zip
$finalIpa = "$currentDir\Payload.ipa" # Modify with the final desired path for the .ipa file
# Create a temporary extraction folder in the current directory
$tempDir = "$currentDir\temp_extracted"
$payloadDir = "$tempDir\Payload"
@TalalMash
TalalMash / function_pid_monitor.sh
Created November 19, 2024 11:56
POSIX shell background PID monitor and cleanup
#!/bin/sh
clear
pid1=""
pid2=""
function1() {
while :; do
count=$((count + 1))
@TalalMash
TalalMash / yt.sh
Created August 2, 2024 14:11
yt-dlp archiver with resolution limit, thumbnail and metadata embeds
#!/bin/sh
# Use to throttle without cookies
# --sleep-interval 17 \
# --max-sleep-interval 135 \
QUALITY="bestvideo[height<=720]+bestaudio"
URL="URLHERE/videos"
ARCHIVE_LIST="archive.txt"
LOG=log.txt
@TalalMash
TalalMash / Notes.md
Last active May 18, 2025 04:51
Galaxy Tab S (2014) HDR to SDR with non-linear interpolation LUT

Effective on any OLED display and 600+ nit LCD display with good ambient light.

Set color profile to Cinema

Comparision with HDR10+ display: image

Comparision without 3D LUT: Plex tonemapping, Handbrake bt.709, Netflix, ingot is dim and shadows are darker: image

@TalalMash
TalalMash / main.dart
Created March 7, 2024 04:14
Flutter PageView: Proper scrolling with Scrollwheel, Touchpad and Touchscreen
import 'package:flutter/material.dart';
import 'package:flutter/gestures.dart';
import 'dart:async';
import 'dart:io' show Platform;
import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:universal_html/html.dart' as html;
bool isDesktop() {
final userAgent = html.window.navigator.userAgent.toString().toLowerCase();
if (kIsWeb) {
@TalalMash
TalalMash / pingable.sh
Created August 30, 2023 23:10
HTML generate last seen network ping for cron
#!/bin/bash
ip_address="1.1.1.1"
output_file="index.html"
generate_html() {
local utc_time="$1"
cat << EOF > "$output_file"
<!DOCTYPE html>
<html>
@TalalMash
TalalMash / [Prusa style] Auto align dual Z-motor Y-axis on first home only once after power up.md
Last active November 22, 2022 19:42
[Prusa style] Auto align dual Z-motor Y-axis on first home only once after power up

demo

Requirements:

  • Rigid couplers (use ball bearing for flexible)
  • Add extra 20mm in your Z limit configuration to allow stepper stalling
  • Physical limiter (e.g a screw in the extrusion on both sides with equal distances)
  • (optional) Software current control for low noise on stalls; using TMC in this example

Functions:

  • Aligns the two leadscrew-driven motors only once after powerup on the first G28 command until next power cycle.
@TalalMash
TalalMash / armv7-no-neon.sh
Last active September 16, 2023 03:10
[OpenWRT] EasyTether on ARMv7 without NEON CPUs
#!/bin/sh
###INSTRUCTIONS###
#SSH to router & download this script (copy RAW button) and easytether (openwrt19 zip file) in the same directory using command wget <link>
#run: sh armv7-no-neon.sh
#Script will autoinstall, the package in the same directory: easytether-without-neon.ipk can be used for other deployments
#Tested: Slate AX
rm -r build-xiej43 download-s39c
mkdir build-xiej43 download-s39c
@TalalMash
TalalMash / [OpenWRT] UBOND Example
Last active April 25, 2023 10:08
[OpenWRT] UBOND Example
Download binaries: https://github.com/TalalMash/ubond/releases/tag/v0.1.1
Disable encryption for 400Mbit+ , force DNS over HTTPS if needed.
Temporarily running as root. (tun bugfix TODO)
----------------------
VPS/crontab -e:
@reboot screen -d -m sh -c "/root/startubond.sh"
----------------------
/root/startubond.sh
----------------------
#!/bin/sh
@TalalMash
TalalMash / gist:2538ed7371b35cb3f9e50188729f6acb
Last active March 28, 2022 20:11
[Tasmota] SR-04 Ultrasonic Tank Level measurement rules
Rule1 ON sr04#distance>0 DO Backlog var1=((((%value%*)-20)-(EM-20))/(EM-20))*-100; var2=(var1*0.01)*LT; event sendval ENDON
Rule1 + ON event#sendval DO publish tele/watertank/LEVEL %var1% ENDON ON event#sendval DO publish tele/watertank/VOLUME %var2% ENDON
Rule1 1
Replace:
-LT with the number of liters
-EM with the distance when the tank is empty.
You will get percentage (level) and number of liters, accurate starting from 60cm deep tanks.
SR-04 (water proof) is recommended for use.