Skip to content

Instantly share code, notes, and snippets.

View zhujunsan's full-sized avatar
🌧️
Nothing but the rain.

San zhujunsan

🌧️
Nothing but the rain.
View GitHub Profile
@zvldz
zvldz / soft_hack.md
Last active April 18, 2024 00:46
soft_hack.md

Soft hack to open telnet

You need gateway 3(mgl03) connected to MiHome. And also ip and gateway token.

1 way (recommended)

Via XiaomiGateway3 component.

You must input in the 'Open Telnet command' field(as it is without changing anything):

{"method":"set_ip_info","params":{"ssid":"\"\"","pswd":"123123 ; passwd -d admin ; echo enable > /sys/class/tty/tty/enable; telnetd"}}
@BenjaminPoncet
BenjaminPoncet / ffmpeg-wrapper
Last active March 29, 2024 10:11
Synology VideoStation ffmpeg wrapper with DTS, EAC3 and TrueHD support. This project is no longer maintained: Please see the following projects: https://github.com/darknebular/Wrapper_VideoStation/ - https://github.com/AlexPresso/VideoStation-FFMPEG-Patcher
#!/bin/bash
rev="12"
_log(){
echo "$(date '+%Y-%m-%d %H:%M:%S') - ${streamid} - $1" >> /tmp/ffmpeg.log
}
_log_para(){
echo "$1" | fold -w 120 | sed "s/^.*$/$(date '+%Y-%m-%d %H:%M:%S') - ${streamid} - = &/" >> /tmp/ffmpeg.log
@slava-vishnyakov
slava-vishnyakov / readme.md
Last active May 7, 2024 04:49
How to upload images with TipTap editor
  1. Create a file Image.js from the source below (it is almost a copy of Image.js from tiptap-extensions except that it has a constructor that accepts uploadFunc (function to be called with image being uploaded) and additional logic if(upload) { ... } else { ... previous base64 logic .. } in the new Plugin section.
import {Node, Plugin} from 'tiptap'
import {nodeInputRule} from 'tiptap-commands'

/**
 * Matches following attributes in Markdown-typed image: [, alt, src, title]
 *
@amcolash
amcolash / ATTiny + Micronucleus
Last active April 23, 2024 21:28
ATTiny85 + micronucleus using an AVR programmer
This gist is a list of instructions that I used to program my ATTiny85s with Micronucleus. They worked for me, but your mileage may vary! I would highly recommend starting by looking at the SparkFun article linked at the bottom for schematics and more in-depth info. This gist is mostly just a copy/paste list.
## Required:
- ATTiny85
- AVR programmer
- 1 uF capacitor
- Micronucleus FW: https://github.com/micronucleus/micronucleus/releases
- avrdude: http://www.nongnu.org/avrdude/
## Setup:
@marcan
marcan / canon-ef-protocol-notes.md
Last active May 16, 2024 20:47
Canon EF protocol notes

Testing done using a Canon EOS 600D and a Canon EF-S18-55mm f/3.5-5.6 IS II.

Pinout

  1. VBAT
  2. DET (common with P-GND on lens side)
  3. P-GND
  4. VDD
  5. DCL
  6. DLC
#!/usr/bin/env python2
# lrdcq
# usage python2 unwxapkg.py filename
import sys, os
import struct
class WxapkgFile(object):
nameLen = 0
@orenitamar
orenitamar / Dockerfile
Last active March 22, 2024 05:13
Installing numpy, scipy, pandas and matplotlib in Alpine (Docker)
# Below are the dependencies required for installing the common combination of numpy, scipy, pandas and matplotlib
# in an Alpine based Docker image.
FROM alpine:3.4
RUN echo "http://dl-8.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
RUN apk --no-cache --update-cache add gcc gfortran python python-dev py-pip build-base wget freetype-dev libpng-dev openblas-dev
RUN ln -s /usr/include/locale.h /usr/include/xlocale.h
RUN pip install numpy scipy pandas matplotlib
#! /bin/sh
# 请自行获取下列4个变量
# TOKEN由 “安全中心 - 用户管理” 获取,格式为 ID,TOKEN
# DOMAIN_ID、RECORD_ID 可以从DNSPod控制台的AJAX记录JSON返回值获取
# SUB_DOMAIN 自行填写
LOGIN_TOKEN=
DOMAIN_ID=
RECORD_ID=
var decode = function(save){
return LZString.decompressFromBase64(save.split("|")[1].substring(16));
}
var encode = function(json){
return btoa("1.0.19") + "|" + btoa("SAVE HAX0R3D") + LZString.compressToBase64(json);
}
//- As you may know, Laravel 5 provides the Elixir to compile assets with no pain.
These mixins is for those of you who want to use Jade power combined with that of Laravel Blade.
The syntax mimic Blade statements, however identation differs in some cases.
- var newline = "\r\n"
- var loopIterator = '$iterator'
//- @extends mixin
Example: +extends('layouts/master')
Compiled: @extends('layouts/master')