Skip to content

Instantly share code, notes, and snippets.

View chayanforyou's full-sized avatar
🤖
Learning...

Chayan Mistry chayanforyou

🤖
Learning...
View GitHub Profile
@chayanforyou
chayanforyou / DS18B20 Proteus Simulation Fix.md
Created September 11, 2025 18:03
DS18B20 Proteus Simulation Fix

DS18B20 Proteus Simulation Fix

Overview

This project provides a solution to fix the DS18B20 temperature sensor simulation issue in Proteus, where incorrect readings (e.g., -127.00°C) were observed despite the code and circuit working on real hardware.

Problem

The DS18B20 sensor in Proteus simulation returned alternating readings of -127.00°C (indicating a communication failure) and 27.00°C (likely the default simulated temperature). This issue is simulation-specific and does not occur on real hardware due to timing mismatches in the OneWire protocol.

Solution

The fix involves adjusting the DS18B20 component properties in Proteus to align with the OneWire timing requirements. Follow these steps:

@chayanforyou
chayanforyou / Hackintosh EFI Rollback Guide.md
Created September 3, 2025 05:45
Restoring a Hackintosh EFI from Backup Using macOS Installer USB and Terminal

1. Boot into the macOS installer

  • Plug in your Hackintosh USB installer.
  • At the OpenCore/Clover boot picker, choose “Install macOS …” (the installer).
  • Wait until you reach the macOS Utilities screen.

2. Open Terminal

  • In the top menu bar, click Utilities → Terminal.
    (This gives you a terminal even if your system disk can’t boot.)
# Docs: https://developer.android.com/ndk/guides/cmake#android_native_api_level
ANDROID_NATIVE_API_LEVEL = int(os.environ.get('ANDROID_NATIVE_API_LEVEL', 21))
cmake_common_vars = {
# Docs: https://source.android.com/docs/setup/about/build-numbers
# Docs: https://developer.android.com/studio/publish/versioning
'ANDROID_COMPILE_SDK_VERSION': os.environ.get('ANDROID_COMPILE_SDK_VERSION', 36),
'ANDROID_TARGET_SDK_VERSION': os.environ.get('ANDROID_TARGET_SDK_VERSION', 36),
'ANDROID_MIN_SDK_VERSION': os.environ.get('ANDROID_MIN_SDK_VERSION', ANDROID_NATIVE_API_LEVEL),
# Docs: https://developer.android.com/studio/releases/gradle-plugin
'ANDROID_GRADLE_PLUGIN_VERSION': '8.9.3', # AGP version 8.5.1 or higher
OPENCV_SRC=$PWD/opencv
OPENCV_CONTRIB=$PWD/opencv_contrib
OPENCV_BUILD=$PWD/opencv-android-build # output folder
ANDROID_SDK=$HOME/Library/Android/sdk
ANDROID_NDK=$ANDROID_SDK/ndk/27.2.12479018 # change to your ndk folder
CONFIG_FILE=$PWD/ndk-27.config.py # adjust to match your NDK version
mkdir -p $OPENCV_BUILD
cd $OPENCV_BUILD
@chayanforyou
chayanforyou / check_elf_alignment.sh
Created August 28, 2025 13:38
Modified check_elf_alignment.sh script for enhanced output.
#!/bin/bash
progname="${0##*/}"
progname="${progname%.sh}"
# usage: check_elf_alignment.sh [path to *.so files|path to *.apk]
cleanup_trap() {
if [ -n "${tmp}" -a -d "${tmp}" ]; then
rm -rf ${tmp}
fi
@chayanforyou
chayanforyou / home_made_bubble_solution.md
Last active May 17, 2025 06:01
Homemade Bubble Solution Recipe | ঘরোয়া বাবল সলিউশনের রেসিপি

🫧 Bubble Solution

🧴 Ingredients:

  • 8 cups of warm water
  • 1 cup of dish soap (e.g., Vim or Trix)
  • 4 tablespoons of glycerin (or corn syrup/sugar as an alternative)
  • 2 teaspoons of baking powder (optional, for stronger bubbles)

🧪 Instructions:

  • Pour 8 cups of warm water into a large container.
@chayanforyou
chayanforyou / pid_algorithm.md
Last active September 12, 2025 05:20
বাংলায় PID Algorithm (PID algorithm explain in Bangla)

🧠 PID Controller কী?

PID মানে:

  • P = Proportional
  • I = Integral
  • D = Derivative

PID Controller এমন একটা অ্যালগরিদম যেটা কোনও সিস্টেমকে (যেমন গাড়ি, ফ্যান, তাপমাত্রা কন্ট্রোল, ইত্যাদি) ঠিক মত নিয়ন্ত্রণ করতে সাহায্য করে।

def nec_generate(command_hex: str):
HEADER = ["0158", "00B0"] # 9ms + 4.5ms
BIT_0 = ["0017", "0017"]
BIT_1 = ["0017", "0041"]
STOP = ["0017"]
TAIL = ["05A5", "0158", "0056", "0017", "0E5B"]
# Pronto preamble
pronto = ["0000", "006C", "0022", "0002"]
pronto.extend(HEADER)
@chayanforyou
chayanforyou / ideviceforward
Created October 27, 2024 14:02 — forked from gabrc52/ideviceforward
Forward iOS device from host to guest (OSX-KVM)
#!/bin/bash
# Debug
set -o xtrace
GUEST_IP=192.168.122.221
HOST_IP=192.168.122.1
# Wipe the current usbfluxd, usbmuxd, and socat:
sudo killall usbfluxd
@chayanforyou
chayanforyou / android_tools.sh
Created September 15, 2024 14:04 — forked from kriware/android_tools.sh
Auto install tools for android reversing in Ubuntu 20.04
#!/bin/bash
###################################################################
#Description : Script for install tools for android reversing
# Testing in Ubuntu 20.04
# Run as root
# Tools:
# - APKtool
# - Jadx
# - adb