Skip to content

Instantly share code, notes, and snippets.

View zhustec's full-sized avatar
💭
I maybe very slow to respond.

Zhustec zhustec

💭
I maybe very slow to respond.
View GitHub Profile
@zhustec
zhustec / calculate.py
Last active May 3, 2020 05:36
Calculate spherical distance and azimuth of waypoints
#!/usr/bin/env python3
import numpy as np
def calc_params(points):
"""Calculate some shared intermediate parameters
"""
points = np.array(points)
curr_points, next_points = points[:-1, :], points[1:, :]
@zhustec
zhustec / nginx-jupyter.conf
Last active April 4, 2020 03:34
Nginx jupyter
server {
listen 80;
server_name ****.*****.***;
location / {
proxy_pass http://localhost:8888;
proxy_set_header Host $host;
}
location ~ (/api/kernels/|/terminals/) {
@zhustec
zhustec / input_event.c
Last active August 16, 2024 08:10
Linux input event, including Mouse, Keyboard, Touchpad.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/select.h>
#include <linux/input.h>
@zhustec
zhustec / Makefile
Created January 21, 2015 06:03
Linux kernel module
ifneq ($(KERNELRELEASE),)
obj-m := hello.o
else
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
all:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules