Skip to content

Instantly share code, notes, and snippets.

View stark's full-sized avatar

Abhishek stark

  • Arpanet
View GitHub Profile
@stark
stark / quote.pl
Created May 5, 2016 16:52 — forked from dcat/quote.pl
quote.pl for weechat
#!/usr/bin/env perl -w
use strict;
use utf8;
sub quote_cb {
my ($data, $mod, $mod_data, $msg) = @_;
if ($msg =~ /^>/) {
$msg="\x03" . int(rand(15)) . $msg;
}
@stark
stark / pr.md
Created October 15, 2016 17:54 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@stark
stark / tpm2.md
Created September 24, 2019 15:11 — forked from jblang/tpm2.md
TPM2 Protocol Description

TPM2 Protocol Implementation

Introduction

Frame data is transferred inside packets (similar to DMX, for example). A frame is an image representing a matrix or a light scene.

The packets start and end with one-byte characters. In between are a few control bytes followed by the payload. There is no set size for a payload; it is transmitted with each packet. This makes the protocol quite flexible. There are enough bytes in a single packet for an RGB matrix with 21,845 pixels, but if you just want to control an RGBW lamp, that only requires 9 bytes. The variable frame size means there is no overhead, allowing for maximum transfer speed.

TPM2 Packet Structure