Skip to content

Instantly share code, notes, and snippets.

View jamilg's full-sized avatar

Jamil Gasimov jamilg

  • Vilnius, Lithuania
View GitHub Profile
@Alienmario
Alienmario / mi_home_external_automation.md
Last active May 24, 2025 06:47
Mi home external automation (Non rooted, Android 11)
  1. Create a manual scene in Mi Home for the device you'd like to control
  2. Use Http Toolkit to figure out the scene id.
    • Install the app on PC and Android, follow the instructions - install CA certificate and connect
    • Set to only intercept the Mi home app
    • While snooping, start the scene in Mi home, then you can disconnect http toolkit
    • Look for this request: https://de.api.io.mi.com/app/scene/start
    • The request body should look like this (actual values replaced with *) data=*&rc4_hash__=*&signature=*&_nonce=*&ssecurity=*
    • You will need the values for data, nonce and ssecurity. Run each one by https://www.urldecoder.org/.
@socram8888
socram8888 / rc4mi.py
Last active January 13, 2025 16:10 — forked from h3ku/rc4mi.py
Encryption and decryption tool for Xiaomi Mi Home's API
from base64 import b64decode, b64encode
import hashlib, argparse
def rc4mi(data, key):
S, j, out = bytearray(range(256)), 0, bytearray()
for i in range(256):
j = (j + key[i % len(key)] + S[i]) % 256
S[i], S[j] = S[j], S[i]
@MastaP
MastaP / MinCut.java
Created April 5, 2012 21:02
Finding minimum cuts in undirected graph using contraction algorithm
import java.io.*;
import java.util.*;
/**
* https://class.coursera.org/algo/quiz/attempt?quiz_id=52
*/
public class MinCut {
private static class Graph {