Skip to content

Instantly share code, notes, and snippets.

View zhangpf's full-sized avatar
🏠
Working from home

zhangpf

🏠
Working from home
View GitHub Profile
@zhangpf
zhangpf / timens.c
Created February 13, 2020 01:53
Code to demonstrate the time namespace in linux kernel v5.6
#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/wait.h>
#include <time.h>
#include <sys/time.h>
#include <stdio.h>
#include <sched.h>
#include <string.h>
#include <errno.h>
#include <signal.h>
@zhangpf
zhangpf / rCore_redis.sh
Created November 18, 2019 04:42
Redis benchmark on rCore
#create a tap device and set ip address
sudo ip tuntap add dev qemu mode tap user $USER
sudo ip link set qemu up
sudo ip addr add 10.0.0.3/24 dev qemu
git clone https://github.com/rcore-os/rCore.git --recursive
cd rCore/user
make sfsimg prebuilt=1 arch=x86_64
cd ../kernel
make build arch=x86_64
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/stat.h>
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Howto build a rust compiler for the Raspberry Pi on Debian 7.1 (wheezy)

sudo apt-get install git build-essential
test `uname -m` = x86_64 && sudo apt-get install ia32-libs
git clone https://github.com/raspberrypi/tools.git
export PATH=$PWD/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin:$PATH
git clone http://github.com/mozilla/rust.git
cd rust
./configure --target-triples=arm-unknown-linux-gnueabihf

make