Skip to content

Instantly share code, notes, and snippets.

@GreyCat
GreyCat / check-release.rb
Created October 30, 2020 01:03
A quick way to validate current state of official builds / release deployments
#!/usr/bin/env ruby
require 'fileutils'
require 'rexml/document'
require 'json'
require 'date'
class VersionInfo
attr_accessor :version
attr_accessor :date

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@GreyCat
GreyCat / Dockerfile
Created April 20, 2019 01:25
Dockerfile for web IDE
# To build: `docker build --tag webide .`
# To run: `docker run --rm -p 4444:4444 webide:latest`
FROM node:lts-stretch
COPY . /webide
WORKDIR /webide
RUN apt-get update && apt-get install -y python-ruamel.yaml
blocks:
- block_type: block_type_extension
body:
body:
application_id:
bytes: 4E 45 54 53 43 41 50 45 32 2E 30
num_bytes: 11
subblocks:
- bytes: 01 00 00
num_bytes: 3
<?xml version="1.0" encoding="UTF-8"?>
<hash>
<blocks type="array">
<block>
<block-type>block_type_extension</block-type>
<body>
<body>
<application-id>
<bytes>4E 45 54 53 43 41 50 45 32 2E 30</bytes>
<num-bytes type="integer">11</num-bytes>
{
"blocks": [
{
"block_type": "block_type_extension",
"body": {
"body": {
"application_id": {
"bytes": "4E 45 54 53 43 41 50 45 32 2E 30",
"num_bytes": 11
},
<?xml version="1.0" encoding="UTF-8"?>
<hash>
<chunks type="array">
<chunk>
<body>
<chunks type="array">
<chunk>
<body>
<version type="integer">700</version>
</body>
chunks:
- body:
chunks:
- body:
version: 700
len: 2
tag: tags_vrsn
- body:
foo1: 8
foo2: 40
{
"chunks": [
{
"body": {
"chunks": [
{
"body": {
"version": 700
},
"len": 2,
@GreyCat
GreyCat / c-struct-to-ksy.rb
Created March 25, 2017 10:53
Convert C struct into Kaitai Struct spec (.ksy)
#!/usr/bin/env ruby
require 'yaml'
TYPE_TO_KSY = {
'uint8_t' => 'u1',
'uint16_t' => 'u2',
'uint32_t' => 'u4',
'uint64_t' => 'u8',