Skip to content

Instantly share code, notes, and snippets.

View paranlee's full-sized avatar
🐧
Run RISC-V run!

Paran Lee paranlee

🐧
Run RISC-V run!
View GitHub Profile
@paranlee
paranlee / quick_sort_mt.cpp
Created September 5, 2022 14:29 — forked from theodoregoetz/quick_sort_mt.cpp
parallel quicksort in C++11
/**
* g++ -std=c++14 quick_sort_mt.cpp -pthread && ./a.out 10000 1 1
*
*
* This works:
* ./a.out 10000 1 1
*
* This fails (unpredictably!):
* ./a.out 100000 1 1
**/
@paranlee
paranlee / gist:ad5e97d7c70a79fad702632030e46a07
Created August 25, 2022 17:05 — forked from sing1ee/gist:3087723
fibonacci by dynamic programming
# !/usr/bin/python
# -*- encoding: utf-8 -*-
import sys
dp = []
for i in range(100):
dp.append(0)
dp[0] = 0
dp[1] = 1
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/slab.h>
struct birthday {
int day;
int month;
int year;
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/tracepoint.h>
#include <asm/syscall.h>
#include <linux/sched.h>
#include <linux/fdtable.h>
#include <linux/slab.h>
#include <linux/delay.h>
@paranlee
paranlee / hide.c
Created August 17, 2022 15:27 — forked from slashdevsda/hide.c
Testing IDS with "invisible lkm"
/* tested on Linux 3.14
*
*/
#include <linux/kernel.h>
#include <linux/rculist.h>
#include <linux/moduleloader.h>
static LIST_HEAD(modules);
#define MODULE_NAME "module"
@paranlee
paranlee / Output
Created August 16, 2022 05:26 — forked from kumarabekur/Output
TEEC_RequestCancellation host and TA
root@imx6ul-iwg18m-twr-pos:~# tee-supplicant &
[1] 645
root@imx6ul-iwg18m-twr-pos:~# hello_world
RET value =0
### Thread ###
DEBUG: USER-TA:TA_CreateEntryPoint:42: has been called
FLOW: USER-TA: tee_user_mem_alloc:343: Allocate: link:[0x111b98], buf:[0x111ba8:16]
DEBUG: USER-TA:TA_OpenSessionEntryPoint:82: Hello World!
DEBUG: USER-TA:TA_OpenSessionEntryPoint:88: *****TA_OpenSessionEntryPoint***CANCEL FLAG =0
DEBUG: USER-TA:TA_OpenSessionEntryPoint:92: *******TA_OpenSessionEntryPoint******UNMASK FLAG =1
@paranlee
paranlee / create_patch.sh
Created August 16, 2022 05:23 — forked from stokito/create_patch.sh
git: create a single patch file with multiple commits
# last three commits
git format-patch -3 --stdout > multi_commit.patch
# all commits that are in your branch and not in master into a single patch file multi_commit.patch
git format-patch --signoff master --stdout > multi_commit.patch
# create patches in the folder ~/output/directory/ for all commits that are in your branch and not in master
git format-patch -o ~/output/directory/ --signoff master
@paranlee
paranlee / xen-qemu-aarch64.sh
Last active April 14, 2023 15:32 — forked from stewdk/xen-qemu-aarch64.sh
All-in-one script to run Xen on qemu-system-aarch64
#!/bin/bash -ex
# Copyright (c) 2018, DornerWorks, Ltd.
# Author: Stewart Hildebrand
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
# following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
# disclaimer.
@paranlee
paranlee / build.sh
Created August 14, 2022 05:18 — forked from julianxhokaxhiu/build.sh
How to build minimal AARCH64 QEMU Static from sources with EXECVE
#!/bin/bash
#
# IMPORTANT!
# At the moment this script is forged only for Debian ( tested on 8.x release ).
# Although my efforts were put on building this also on Arch Linux or Alpine, at the moment only Debian seems to be able to build it.
# Also, not sure why these instructions where nowhere on the internet, therefore I leave them here for whoever need them.
#
###########
# Add Backports repo support