Skip to content

Instantly share code, notes, and snippets.

@joshgiesbrecht
joshgiesbrecht / HOWTO-CHIP.md
Last active March 29, 2023 12:52
How to get (re)started with a (Pocket)C.H.I.P.
@zvldz
zvldz / soft_hack.md
Last active May 23, 2024 11:34
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"}}
@scottgarner
scottgarner / WebSocketBridge.cs
Created April 18, 2019 04:59
Unity WebSocket Bridge using System.Net.WebSockets
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Net.WebSockets;
using UnityEngine;
import preact from 'preact';
import PropTypes from 'prop-types';
// installs global prop type checking for app preact components
preact.options.vnode = vnode => {
let Component = vnode.nodeName;
if (Component.propTypes) {
PropTypes.checkPropTypes(
Component.propTypes,
vnode.attributes
@NemoAlex
NemoAlex / frpc
Created August 20, 2018 14:42
/etc/init.d/frpc on OpenWrt
#!/bin/sh /etc/rc.common
START=99
USE_PROCD=1
start_service() {
procd_open_instance "frpc"
procd_set_param command /root/frp/frpc -c /root/frp/frpc.ini
procd_set_param stdout 1
procd_set_param stderr 1
@pissang
pissang / echarts-svg.js
Last active March 2, 2024 15:27
Server side SVG rendering of ECharts
const echarts = require("echarts");
const Canvas = require('canvas');
const {JSDOM} = require('jsdom');
const fs = require('fs');
echarts.setCanvasCreator(() => {
return new Canvas(100, 100);
});
const {window} = new JSDOM();
global.window = window;
@nadavrot
nadavrot / Matrix.md
Last active July 16, 2024 10:05
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

@dentechy
dentechy / WSL-ssh-server.md
Last active July 14, 2024 03:54
A step by step tutorial on how to automatically start ssh server on boot on the Windows Subsystem for Linux

How to automatically start ssh server on boot on Windows Subsystem for Linux

Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.

  1. Edit the /etc/ssh/sshd_config file by running the command sudo vi /etc/ssh/sshd_config and do the following
    1. Change Port to 2222 (or any other port above 1000)
    2. Change PasswordAuthentication to yes. This can be changed back to no if ssh keys are setup.
  2. Restart the ssh server:
    • sudo service ssh --full-restart
  3. With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on:
@thedreamwork
thedreamwork / unwxapkg.py
Last active March 4, 2022 07:22
unpack wxapkg
#!/usr/bin/python
# usage python unwxapkg.py filename
import sys,os
import struct
class WxapkgFile:
nameLen = 0
name = ""