Skip to content

Instantly share code, notes, and snippets.

View Yourens's full-sized avatar
🎯
Focusing

Youren Shen Yourens

🎯
Focusing
View GitHub Profile
@Yourens
Yourens / array.rs
Last active September 24, 2020 02:56
// This code snippet comes from
// https://github.com/strake/linea.rs/blob/4588e13e26c9130335a7ebbf5683a6a0679619b6/src/lib.rs
// for operating an array multiple times.
fn zip_elements<A, B, C, M, N, F: FnMut(A, B) -> C>(Matrix(a): Matrix<A, M, N>,
Matrix(b): Matrix<B, M, N>,
mut f: F) -> Matrix<C, M, N>
where M: ArrayLength<A> + ArrayLength<B> + ArrayLength<C>,
N: ArrayLength<GenericArray<A, M>> + ArrayLength<GenericArray<B, M>> +
ArrayLength<GenericArray<C, M>> {
let mut c: GenericArray<GenericArray<C, M>, N> = unsafe { mem::uninitialized() };
#!/usr/bin/env bash
#Usage If you want to install toolchain at a high privilege level location: sudo ./buildtoolchain.sh
mkdir patch
cd patch
echo 'diff --git a/CMakeLists.txt b/CMakeLists.txt
index aa0b124..abe66be 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -459,6 +459,8 @@ set(LIBCXXABI_LIBUNWIND_INCLUDES "${LIBCXXABI_LIBUNWIND_INCLUDES}" CACHE PATH
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from os import walk
import sys
import zipfile
#print "Processing File " + sys.argv[1]
def unzip(filename):
#include <stdio.h>
int function (int a, int b, int c){
char buffer[14];
int sum;
int *ret;
printf("%p\n", __builtin_return_address(1));
ret = buffer;
printf("%lx\t%lx\n",ret, *ret);
#/bin/bash
export Local_Result=""
export fastest="999999999"
export fastest_server="NO_SERVER!"
echo "" > output
for server in `cat ./server.list`
do
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 63
model name : Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz
stepping : 2
microcode : 0x2b
cpu MHz : 1215.039
cache size : 30720 KB
physical id : 0
len = (len + 0x1f) & ~0x1f;
arg_ptr = (uintptr_t *)(sp - len);
7001ed44: 48 98 cdqe
7001ed46: 48 8d 84 c1 00 01 00 lea rax,[rcx+rax*8+0x100]
7001ed4d: 00
count_args(argv, &argc, &tmp);
len += tmp;
count_args(envv, &envc, &tmp);
len += tmp;
[345334.759580] vmx: enabled EPT A/D bits
[345334.759623] vmx: created VCPU (VPID 1)
[345335.425232] pcidma 0000:03:00.0: claimed
[345335.826892] ept: failed to get user page 8
[345335.826895] vmx: page fault failure GPA: 0x8, GVA: 0x8
[345335.826897] vmx: --- Begin VCPU Dump ---
[345335.826898] vmx: CPU 1 VPID 1
[345335.826899] vmx: RIP 0x000000006f00c141 RFLAGS 0x00010246
[345335.826900] vmx: RAX 0x0000000000000000 RCX 0x0000000000000000
[345335.826901] vmx: RDX 0x0000000000000000 RBX 0x0000000000000001
CPU 01| 15:17:28 <4>: init: barrier after al CPU initialization
CPU 01| 15:17:28 <4>: init: module hw SUCESS
CPU 01| 15:17:28 <4>: sandbox: loading segment - va 0x000000000, len 25150
CPU 01| 15:17:28 <4>: sandbox: loading segment - va 0x000225bc0, len 15a8
sandbox: got unexpected G3 page fault at addr 8, fec 4
dune: --- Begin Trap Dump ---
dune: RIP 0x000000006f00c141
dune: CS 0x33 SS 0x2b
dune: ERR 0x00000004 RFLAGS 0x00010046
dune: RAX 0x0000000000000000 RCX 0x0000000000000000
host_addr="172.16.1.1/24"
gateway_addr="172.161.1.1"
port=1234
devices="0:06:00.0"
cpu=0
batch=64
loader_path="/lib64/ld-linux-x86-64.so.2"