Skip to content

Instantly share code, notes, and snippets.

Avatar

Yuchen Ying yegle

  • Google
  • San Francisco Bay Area
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am yegle on github.
  • I am yegle (https://keybase.io/yegle) on keybase.
  • I have a public key ASDxv0qT6AKb8q38_N-h7bdy-9s5_b1xiwzp54pi6irGxwo

To claim this, I am signing this object:

@yegle
yegle / looping-over-tuple-vs-list.md
Last active Jul 11, 2019
Looping over tuple is slightly faster than looping over list
View looping-over-tuple-vs-list.md

Looping over a tuple is faster than looping over a list in Python2

In Python2:

In [1]: def loop_list():    
   ...:     for i in [1, 2, 3]:                          
   ...:         pass        
   ...:                     

In [2]: def loop_tuple():   
@yegle
yegle / bash-invocation.md
Created Jan 5, 2012
Bash Shell启动方式与RC脚本
View bash-invocation.md

Bash Shell启动方式与rc脚本

Shell的不同分类

根据启动Bash Shell的方式不同,对Shell有两种分类方式

登录Shell与非登录Shell

根据Shell的启动方式不同,可以将Shell分为

View keybase.md

Keybase proof

I hereby claim:

  • I am yegle on github.
  • I am yegle (https://keybase.io/yegle) on keybase.
  • I have a public key ASA_sLGmpOa5Duyf2sYyu-22gA5UrZf_4dlrv7FG6619FAo

To claim this, I am signing this object:

View gist:9ac2bf04fcf73bb9bc8b3ce15e63a4c6
$ curl -I https://www.autonomous.ai -H 'accept-language: en,zh-CN;q=0.9,zh;q=0.8'
HTTP/2 500
server: nginx
date: Wed, 27 May 2020 06:46:20 GMT
content-type: text/html; charset=utf-8
content-length: 58788
set-cookie: lang=zh-CN; Max-Age=315360000; Path=/; Expires=Sat, 25 May 2030 06:46:20 GMT
access-control-allow-origin: *
access-control-allow-methods: GET, POST, OPTIONS, PUT, PATCH, DELETE
access-control-allow-headers: X-Requested-With,content-type
@yegle
yegle / how-kernel-handles-send-system-call.md
Last active Sep 21, 2020
How Linux kernel handles the send system call
View how-kernel-handles-send-system-call.md

This is a brief introduction about how Linux kernel handles the send system call.

This study is based on kernel version 3.7.2, which is the latest stable kernel when writing this study.

How system call is defined

In the latest kernel, the system call is defined using the SYSCALL_DEFINEx macro, in which x is the number of arguments. For example, in order to find the definition of asmlinkage long sys_sendto(int, void __user *, size_t, unsigned, struct sockaddr __user *, int);, you need to grep for SYSCALL_DEFINE6 because it has 6 arguments.

The definition of the system call send can be found at net/socket.c.

You can’t perform that action at this time.