Skip to content

Instantly share code, notes, and snippets.

@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:
@TalalMash
TalalMash / Fast-ABS (Use this!).csv
Last active January 13, 2023 21:13
Pegasus 12-inch Klipper/Mainsail - SKR Mini E3 v3.0 - 42BHH48-150K-24 Steppers - Cura - Original Titan E3Dv6-lite - 0.4mm brass nozzle
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Section;Extruder;Key;Type;Value
general;0;Date;str;14/01/2023 00:11:36
general;0;Os;str;Windows 10.0.22621
general;0;Cura_Version;str;5.2.1
general;0;Profile;str;Fast-ABS (Use this!)
general;0;Quality;str;Fast
general;0;Extruder_Count;int;1
resolution;1;layer_height;float;0.2
resolution;1;layer_height_0;float;0.2
resolution;1;line_width;float;0.3