Skip to content

Instantly share code, notes, and snippets.

@bl4ck5un
bl4ck5un / ias_test.cpp
Created December 30, 2016 03:31
contact IAS (Intel Attestation Service) via REST API
#include "restclient-cpp/connection.h"
#include "restclient-cpp/restclient.h"
#include <iostream>
#include <string>
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include <stdexcept>
@bl4ck5un
bl4ck5un / sgx_status.h
Last active May 2, 2018 02:15
To fix the missing "sgx_status.h" error in https://shwetasshinde24.github.io/Panoply/
/**
*
* Copyright(c) 2011-2016 Intel Corporation All Rights Reserved.
*
* The source code contained or described herein and all documents related to
* the source code ("Material") are owned by Intel Corporation or its suppliers
* or licensors. Title to the Material remains with Intel Corporation or its
* suppliers and licensors. The Material contains trade secrets and proprietary
* and confidential information of Intel or its suppliers and licensors. The
* Material is protected by worldwide copyright and trade secret laws and treaty
@bl4ck5un
bl4ck5un / ias_test.py
Created December 30, 2016 03:30
contact IAS via REST API
import requests as rq
import httpsig
import json
import pprint
KEY_DIR = '/home/fan/Downloads/att_keys'
cert=(KEY_DIR + '/client.crt', KEY_DIR + '/client.key')
def print_headers(headers):
print 'HEADERS: '
@bl4ck5un
bl4ck5un / sgx_v1.9.0.sh
Created October 2, 2017 21:20
Install SGX SDK v1.9.0
#!/bin/sh -e
SGX_SDK_BIN=sgx_sdk.bin
wget -O $SGX_SDK_BIN https://download.01.org/intel-sgx/linux-1.9/sgx_linux_ubuntu16.04.1_x64_sdk_1.9.100.39124.bin
chmod a+x $SGX_SDK_BIN
echo -e 'no\n/opt/intel' | sudo ./$SGX_SDK_BIN
echo 'source /opt/intel/sgxsdk/environment' >> ~/.zshrc
@bl4ck5un
bl4ck5un / Application.sol
Created April 17, 2017 01:24
Application Contract for Town Crier
contract Application {
event Request(int64 requestId, address requester, uint dataLength, bytes32[] data);
event Response(int64 requestId, address requester, uint64 error, uint data);
event Cancel(uint64 requestId, address requester, bool success);
uint constant MIN_GAS = 30000 + 20000;
uint constant GAS_PRICE = 5 * 10 ** 10;
uint constant TC_FEE = MIN_GAS * GAS_PRICE;
uint constant CANCELLATION_FEE = 25000 * GAS_PRICE;
@bl4ck5un
bl4ck5un / gruvbox.theme
Created December 21, 2015 01:47 — forked from 4Evergreen4/gruvbox.theme
Gruvbox dark theme for xfce4-terminal (put this in ~/.xfce4/config/terminal/terminalrc)
ColorForeground=#f2f2e5e5bcbc
ColorBackground=#323230302f2f
ColorCursor=#d65bc4cd8ca1
ColorPalette=#323230302f2f;#cccc24241d1d;#989897971a1a;#d7d799992121;#454585858888;#b1b162628686;#68689d9d6a6a;#929283837474;#1d1d20202121;#fbfb49493434;#b8b8bbbb2626;#fafabdbd2f2f;#8383a5a59898;#d3d386869b9b;#8e8ec0c07c7c;#b9b9a6a69393
@bl4ck5un
bl4ck5un / fan.tex
Last active October 22, 2015 03:18
My LaTeX macros and etc.
% geometry
\usepackage[letterpaper]{geometry}
% code listing
\usepackage[usenames, dvipsnames]{xcolor}
\usepackage{listings}
\lstset{language=C++,
basicstyle=\ttfamily,
keywordstyle=\color{blue}\ttfamily,
stringstyle=\color{red}\ttfamily,
@bl4ck5un
bl4ck5un / fan_comment.tex
Created October 15, 2015 04:15
Fan's comment with red color and sf font.
\newcommand{\fan}[1]{\textcolor{red}{[\textsf{Fan: #1}]}}
lpr -P cupsprint1_coecis_cornell_edu -o sides=two-sided-long-edge report.pdf
@bl4ck5un
bl4ck5un / python_argparse.py
Created October 7, 2015 19:51
Dead simple argparse example
# from http://stackoverflow.com/a/7427376/1616210
parser = argparse.ArgumentParser(description='Description of your program')
parser.add_argument('-f','--foo', help='Description for foo argument', required=True)
parser.add_argument('-b','--bar', help='Description for bar argument', required=True)
args = vars(parser.parse_args())
if args['foo'] == 'Hello':
# code here
if args['bar'] == 'World':