Skip to content

Instantly share code, notes, and snippets.

zsrkmyn / readfile.c
Created Aug 22, 2019
A simple read file function for x86_64 Linux implemented in asm
View readfile.c
#include <sys/syscall.h>
#include <stddef.h>
#include <fcntl.h>
int readfile(const char *file, char *buf, size_t size)
int ret;
asm (
"mov %[mode], %%rsi \n\t"
"mov %[open], %%rax \n\t"
View dcl.c
* My 'dcl' implementation of <the C programming language> chap 5.12.
* Slightly different from the given implementation.
* Using left recursion elimination to expand 'dirdcl':
* dcl -> optional *'s dirdcl
* dirdcl -> name
* | (dcl)
* | dirdcl()
* | dirdcl[optional size]
zsrkmyn /
Created Jul 31, 2017
Dvorak Vi bindings for IPython
# put this file in ~/.ipython/profile_default/startup
# d,h,t,n for move in ViNavigationMode and ViSelectionMode
# jj to kill a line
# jf/F<char> to kill until meeting <char>
from prompt_toolkit.filters.cli import ViNavigationMode, ViSelectionMode, ViMode
from prompt_toolkit.filters import Always, IsReadOnly
from IPython import get_ipython
from import create_operator_decorator, create_text_object_decorator, TextObject
from prompt_toolkit.document import Document
from prompt_toolkit.buffer import ClipboardData
zsrkmyn / debian-mips.txt
Created Jan 19, 2016
View debian-mips.txt
1. 下载镜像{,el}/ ; mips 为大端,mipsel 为小端
2. 设置宿主机网络
#$ cat network_setup
sudo ip link add qbr0 type bridge
sudo ip addr add dev qbr0
sudo ip link set qbr0 up
# sudo dnsmasq -C dnsmasq.conf # for dynamic ip support
zsrkmyn / Rvalue_ref.cpp
Last active Aug 29, 2015
C++ 学习笔记
View Rvalue_ref.cpp
#include <iostream>
#include <algorithm>
#include <cstring>
#include <memory>
class MyString {
// Common constructor
MyString(const char * str) :

Keybase proof

I hereby claim:

  • I am zsrkmyn on github.
  • I am zsrkmyn ( on keybase.
  • I have a public key whose fingerprint is 0285 FB69 00D1 0203 0550 F20A 3490 8FFB C0BF AC35

To claim this, I am signing this object: