Skip to content

Instantly share code, notes, and snippets.

View TalalMash's full-sized avatar
⚠️
Check Engine

Talal TalalMash

⚠️
Check Engine
View GitHub Profile
@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 July 23, 2024 07:59
Galaxy Tab S (2014) HDR to SDR with non-linear interpolation LUT for pseudo-HDR (HDR is possible with OLED dynamic range but with minor greyscale/color stepping due to 8-bit)

Note:Set color profile to Cinema

Download the modified video for Tab S here

Comparision with HDR10+ display: image

Comparision without LUT is what Plex tonemapping, Handbrake 709, Netflix and most use , ingot is less bright 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 / File.vmx
Created February 17, 2024 14:06
Mac OS Sonoma Ryzen VM
smbios.reflectHost = "TRUE"
hw.model = "iMac20,2"
board-id = "Mac-AF89B6D9451A490B"
smc.version = "0"
cpuid.0.eax = "0000:0000:0000:0000:0000:0000:0000:1011"
cpuid.0.ebx = "0111:0101:0110:1110:0110:0101:0100:0111"
cpuid.0.ecx = "0110:1100:0110:0101:0111:0100:0110:1110"
cpuid.0.edx = "0100:1001:0110:0101:0110:1110:0110:1001"
cpuid.1.eax = "0000:0000:0000:0001:0000:0110:0111:0001"
cpuid.1.ebx = "0000:0010:0000:0001:0000:1000:0000:0000"
@TalalMash
TalalMash / main.c
Created February 17, 2024 14:03
ESP8266 Power cycle relay toggle
#include <ESP8266WiFi.h>
#include <FS.h>
const char *filename = "/relay_status.txt";
byte relON[] = {0xA0, 0x01, 0x01, 0xA2};
byte relOFF[] = {0xA0, 0x01, 0x00, 0xA1};
void setup() {
Serial.begin(9600);
Serial.write(0);
@TalalMash
TalalMash / 8266SerialTCPBridgePlusWiFiMng.ino
Last active October 22, 2023 15:08
ESP8266 TCP to Serial Adapter with WiFi Manager (falls back to AP when station is not available)
// ESP8266 WiFi <-> UART Bridge
// by RoboRemo
// www.roboremo.com
// WiFi Manager Fork
#include <ESP8266WiFi.h>
#include <WiFiManager.h> //https://github.com/tzapu/WiFiManager WiFi Configuration Magic
// config: ////////////////////////////////////////////////////////////
@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 / Rclone GUI service.vbs
Created March 19, 2023 22:24
[Windows] Rclone GUI Service in background
Set oShell = CreateObject ("Wscript.Shell")
Dim cmdStrs : cmdStrs = Array( _
"D:\Downloads\rclone-v1.62.2-windows-amd64\rclone-v1.62.2-windows-amd64\rclone.exe rcd --rc-web-gui" _
)
For Each cmdStr In cmdStrs
oShell.Run cmdStr, 0, false
Next
@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 / SuperSlicer (3GB RAM) or Cura (5GB RAM) on Android (64 bit)
Last active April 17, 2024 19:08
SuperSlicer (3GB RAM) or Cura (5GB RAM) on Android (64 bit)
ETA setup: ~1 hour.
1. Install termux and follow https://ivonblog.com/en-us/posts/termux-compile-mesa-driver/
2. Add startx file in home directory with the following content:
#!/bin/sh
termux-x11 &
udroid -l xfce4
3. Add startx file inside Ubuntu home directory with the following content: