Skip to content

Instantly share code, notes, and snippets.

View gsora's full-sized avatar
🤙
Vibin'

Gianguido Sorà gsora

🤙
Vibin'
View GitHub Profile
file = open("usb_hid_keys.h", "r")
for line in file:
goodline = line[8:].split(" ")
if line.startswith("#define ") and len(goodline)>1:
key = goodline[0]
value = ""
for i in range(1, len(goodline)):
if goodline[i] == "":
continue
use pddb::Pddb;
use std::io::Read;
use std::io::Write;
use xous::Error;
pub struct PddbMap {
basis_name: String,
dict_name: String,
pddb_inst: pddb::Pddb,
}
@gsora
gsora / .config
Last active May 20, 2020 11:42
OP-TEE Linux config for USB Armory Mk2
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm 5.4.38 Kernel Configuration
#
#
# Compiler: arm-linux-gnueabihf-gcc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008
#
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=90201
@gsora
gsora / ckv.c
Created April 12, 2020 17:43
extremely stupid C key-value store
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define PREAMBLE_DELIM "#preamble#"
#define PREAMBLE_DELIM_LEN 11
#define SPLIT_TOKEN "\n"
#define T PREAMBLE_DELIM"\n""a:int:1\nb:string:31\nc:bool:1\n"PREAMBLE_DELIM"\na:1234\nb:ciaociao ciao come va la vita?\n"
#define FIELD_SZ 128
#define PREAMBLE_LINE_FMT "%[^:]:%[^:]:%lli\n"
@gsora
gsora / vardown.go
Created March 4, 2020 17:10
Markdown preprocessor with variable replacement
package main
import (
"errors"
"fmt"
"io/ioutil"
"log"
"os"
"regexp"
"strings"
@gsora
gsora / openvpn-libressl-static.sh
Last active March 4, 2020 15:10
Builds OpenVPN 2.4.2 with LibreSSL 2.4.5 statically on OpenBSD 6.1
#!/bin/sh
# Originally written by https://image.rayservers.com/ssl/vpn/openvpn+libressl+musl-static-compile.sh
# Dependencies: wget
set -e
set -x
[ ! -d ~/openvpn-libressl ] && mkdir ~/openvpn-libressl
cd ~/openvpn-libressl
### Keybase proof
I hereby claim:
* I am gsora on github.
* I am gsora (https://keybase.io/gsora) on keybase.
* I have a public key ASBQDIK90FrOgGYYz58bSoXShCojDMEgUkRl7sz_CpLVDgo
To claim this, I am signing this object:
Loopback HTTP GET
```
goos: linux
goarch: amd64
pkg: client-localhost
Benchmark_doLoopback-2 6195 209226 ns/op 2617 B/op 35 allocs/op
PASS
ok client-localhost 1.327s
Success: Benchmarks passed.

Keybase proof

I hereby claim:

  • I am gsora on github.
  • I am gsora (https://keybase.io/gsora) on keybase.
  • I have a public key ASC2KIdkmLowEGxM9FgSwwB_pJDm5PAQI5_9tcOAIVwPJAo

To claim this, I am signing this object: