Skip to content

Instantly share code, notes, and snippets.

View tisyang's full-sized avatar
:octocat:
Happy New Year!

TyK tisyang

:octocat:
Happy New Year!
View GitHub Profile
@tisyang
tisyang / ed2k collector
Created August 20, 2013 14:01
ed2k link filter in file or html | ed2k 链接过滤搜集
import io
import re
ed2k_pattern = re.compile(r"ed2k://\|file\|[^/]+?\|/")
file = "a.html"
with open(file, encoding="utf-8") as f:
content = f.read()
p = ed2k_pattern.findall(content)
@tisyang
tisyang / csv2vcf.rb
Last active August 29, 2015 14:02
contacts file csv to vcf (vcards)
fmt = "BEGIN:VCARD\nVERSION:2.1\nFN:{name}\nTEL;CELL;VOICE:{phone}\nEND:VCARD"
File.open("222.csv") do |inn|
File.open("222.vcf", "w") do |out|
while line = inn.gets do
line = line.chomp
content = line.split(",")
name = content[0]
phone = content[1]
res = fmt.sub("{name}", name).sub("{phone}", phone)
@tisyang
tisyang / makefile
Last active December 15, 2017 01:50
Simple makefile template
TARGET = prog
LIBS = -lm
CC = gcc
CFLAGS = -g -Wall
.PHONY: default all clean
default: $(TARGET)
all: default
@tisyang
tisyang / install-ros.sh
Created December 12, 2018 02:51
Ubuntu 16.04 ROS Kinetic 一键安装脚本
#!/usr/bin/env bash
# 安装 ros-kinetic 脚本,适用于 ubuntu 16.04
#set -e
# 检查是否是 root
if [ `whoami` = "root" ];then
echo "$0 SHOULD NOT run as root, EXIT!"
exit 1
fi
@tisyang
tisyang / rtklib-rtcm3.0.txt
Created December 18, 2018 09:48
RTKLIB RTCM3.0 协议转换报文
1006(10)
1004(1) GPS
1012(1) GLONASS
1033(10)
@tisyang
tisyang / pdf2word.sh
Created January 25, 2019 07:34
PDF2WORD
soffice --infilter="writer_pdf_import" --convert-to doc file.pdf
libreoffice --invisible --convert-to docx:"MS Word 2007 XML" file.pdf
@tisyang
tisyang / aarch64.cmake
Created January 31, 2019 00:58
cmake cross compile toolchain files
# this one is important
SET(CMAKE_SYSTEM_NAME Linux)
SET(SYSTEM_NAME aarch64-linux-gnu)
#this one not so much
SET(CMAKE_SYSTEM_VERSION 1)
# specify the cross compiler
SET(CMAKE_C_COMPILER ${SYSTEM_NAME}-gcc)
SET(CMAKE_CXX_COMPILER ${SYSTEM_NAME}-g++)
@tisyang
tisyang / shadowsocks
Created February 12, 2019 01:07
shadowsocks serivce file
#!/bin/sh
### BEGIN INIT INFO
# Provides: shadowsocks
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start shadowsocks
# Description: start shadowsocks
### END INIT INFO
@tisyang
tisyang / mosquitto
Created February 12, 2019 01:19
mosquitto service file for arm linux
#!/bin/sh
### BEGIN INIT INFO
# Provides: mosquitto
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start mosquitto
# Description: start mosquitto
### END INIT INFO
@tisyang
tisyang / LCM交叉编译.md
Last active February 12, 2019 02:00
cross compile lcm for arm linux

需要的源码包

  • zlib-1.2.11
  • libffi-3.2.1
  • glib-2.54.3
  • lcm-1.4.0

根据目标平台不同,需要修改 HOST

  • armel: arm-linux-gnueabi