Skip to content

Instantly share code, notes, and snippets.

View mssun's full-sized avatar

Mingshen Sun mssun

View GitHub Profile
@mssun
mssun / teaclave-sgx-sdk-fs-example.rs
Last active October 30, 2020 22:57
teaclave-sgx-sdk-fs-example.rs
use teaclave_sgx_sdk::fs::{RepoOpener, OpenOptions};
use std::io::prelude::*;
use std::io::{Seek, SeekFrom};
use std::path::Path;
// The most core parts of this module are `Repo` and `File`, which provides most
// API for file system operations and file data I/O.
//
@mssun
mssun / sgx-toolchain.sh
Created July 11, 2019 04:42
sgx-toolchain.sh
#!/bin/bash
sudo apt-get install -q -y libssl-dev libcurl4-openssl-dev libprotobuf-dev
sudo apt-get install -q -y build-essential python
mkdir sgx-toolchain && pushd sgx-toolchain
wget https://download.01.org/intel-sgx/linux-2.5/ubuntu18.04-server/libsgx-enclave-common-dbgsym_2.5.101.50123-bionic1_amd64.ddeb
wget https://download.01.org/intel-sgx/linux-2.5/ubuntu18.04-server/libsgx-enclave-common-dev_2.5.101.50123-bionic1_amd64.deb
wget https://download.01.org/intel-sgx/linux-2.5/ubuntu18.04-server/libsgx-enclave-common_2.5.101.50123-bionic1_amd64.deb
wget https://download.01.org/intel-sgx/linux-2.5/ubuntu18.04-server/sgx_linux_x64_driver_f7dc97c.bin
@mssun
mssun / lib.rs
Created June 25, 2018 18:10
A Rust unsafe code auto-translated by C2Rust with memory issue
#![allow ( dead_code )]
#![allow ( mutable_transmutes )]
#![allow ( non_camel_case_types )]
#![allow ( non_snake_case )]
#![allow ( non_upper_case_globals )]
#![allow ( unused_mut )]
extern crate libc;
#[no_mangle]
pub unsafe extern "C" fn insertion_sort(n: libc::c_int, p: *mut libc::c_int)
-> () {
@mssun
mssun / coreutils.patch
Created August 25, 2017 06:26
coreutils.patch
diff --git a/Makefile b/Makefile
index 6b650b9..3f1b55c 100644
--- a/Makefile
+++ b/Makefile
@@ -246,7 +246,7 @@ endif
# Libaries to install
LIBS :=
ifneq (,$(findstring stdbuf, $(INSTALLEES)))
-LIBS += libstdbuf.$(DYLIB_EXT)
+# LIBS += libstdbuf.$(DYLIB_EXT)
@mssun
mssun / ion-patch.patch
Last active August 25, 2017 03:52
ion patch
diff --git a/Cargo.toml b/Cargo.toml
index 6aa6b69..33d2127 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -35,7 +35,7 @@ glob = "0.2"
# Provides a macro for lazily-evalulated statics
lazy_static = "0.2"
# Provides the line editor / prompt for the shell
-liner = { git = "https://github.com/MovingtoMars/liner/" }
+liner = { git = "https://github.com/mssun/liner/", branch = "terminal-size-patch" }

Keybase proof

I hereby claim:

  • I am mssun on github.
  • I am mssun (https://keybase.io/mssun) on keybase.
  • I have a public key whose fingerprint is 7BA0 B91E 1151 852B 6937 8EB0 05A0 4DF1 D392 4D99

To claim this, I am signing this object:

@mssun
mssun / build.sh
Last active December 10, 2016 14:31
Script for Building Android Toolchain (both host and target arm-linux-androideabi)
#!/bin/bash
# You need to fix several header error before compiling.
# For more information, please read: http://blog.mssun.me/technology/android/build-android-toolchain/
export PWD=`pwd`
export PREFIX=${PWD}/system
export NDK_HOME=/xxx/aosp/android-ndk-r10e
export CROSS_COMPILE=${NDK_HOME}/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-
export PATH=${NDK_HOME}/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin:$PATH
export SYSROOT=${NDK_HOME}/platforms/android-21/arch-arm