Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# 确保脚本以 root 用户执行
if [ "$(id -u)" -ne 0 ]; then
echo "This script must be run as root."
fi
echo "mounting /dev/vda1 to /mnt"
# 挂载根分区
mount /dev/vda1 /mnt
@tpu01yzx
tpu01yzx / baidu_taxi.py
Created June 22, 2022 08:55
根据baidu地图的SDK获取两两之间出租车的价格等信息.
import time as tm
import pandas as pd
import numpy as np
import requests
import json
from queue import Queue
# 以下部分需要填写
file_path = "" # 数据文件绝对路径,csv格式
rows = 0 #起始行数,默认为0
#
# c.cpp混合编译的makefile模板
#
#
BIN =
CROSS =
CC = $(CROSS)gcc
CPP = $(CROSS)g++
@tpu01yzx
tpu01yzx / Makefile
Created November 19, 2021 07:08
Makefile from ruijie4gzhu
#===============================================================================
#
# Filename: Makefile
# Description:
#
# Usage: make (generate executable )
# make clean (remove objects, executable, prerequisits )
# make tarball (generate compressed archive )
# make zip (generate compressed archive )
#
@tpu01yzx
tpu01yzx / Makeflie
Created November 19, 2021 06:58
Makefile template
#####################################################################
## file : test makefile for build current dir .c ##
## author : jernymy ##
## date-time : 05/06/2010 ##
#####################################################################
CC = gcc
CPP = g++
RM = rm -rf
@tpu01yzx
tpu01yzx / ls.strace
Created July 3, 2019 04:36
The concent of ls.strace
32 execve("/bin/ls", ["ls", "data", "-l"], 0x7ffffa093ec8 /* 20 vars */) = 0
32 brk(NULL) = 0x7fffc24de000
32 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
32 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
32 openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
32 fstat(3, {st_mode=S_IFREG|0644, st_size=32176, ...}) = 0
32 mmap(NULL, 32176, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fbb4637d000
32 close(3) = 0
32 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
32 openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libselinux.so.1", O_RDONLY|O_CLOEXEC) = 3