Skip to content

Instantly share code, notes, and snippets.

lj8385174

Block or report user

Report or block lj8385174

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@lj8385174
lj8385174 / upgrade-gcc-4.9.sh
Last active Nov 20, 2018 — forked from huacnlee/upgrade-gcc-4.9.sh
Upgrade GCC 4.9 on Ubuntu Server
View upgrade-gcc-4.9.sh
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.9 g++-4.9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9
# if you are embeded arm system, try use the following states
# sudo update-alternatives --install /usr/bin/arm-linux-gnueabihf-gcc arm-linux-gnueabihf-gcc /usr/bin/arm-linux-gnueabihf-gcc-4.9 60 --slave /usr/bin/arm-linux-gnueabihf-g++ arm-linux-gnueabihf-g++ /usr/bin/arm-linux-gnueabihf-g++-4.9
@lj8385174
lj8385174 / tslgameNetUsage.py
Created Dec 7, 2017
tslagame network usage inspector
View tslgameNetUsage.py
import os
import psutil
import re
def find_procs_by_name(name):
"Return a list of processes matching 'name'."
assert name, name
ls = []
for p in psutil.process_iter():
name_, exe, cmdline = "", "", []
View openvpn-2.3.6-obfs.patch
--- src/openvpn/options.c.orig 2012-12-17 17:36:07.000000000 +0800
+++ src/openvpn/options.c 2013-03-07 23:21:26.230153027 +0800
@@ -62,6 +62,10 @@
#include "memdbg.h"
+extern char* _socket_obfs_salt;
+extern int _socket_obfs_salt_len;
+extern int _socket_obfs_padlen;
+
View LLA2ECEF.matlab
% LLA2ECEF - convert latitude, longitude, and altitude to
% earth-centered, earth-fixed (ECEF) cartesian
%
% USAGE:
% [x,y,z] = lla2ecef(lat,lon,alt)
%
% x = ECEF X-coordinate (m)
% y = ECEF Y-coordinate (m)
% z = ECEF Z-coordinate (m)
% lat = geodetic latitude (radians)
@lj8385174
lj8385174 / setupcomnode.sh
Created Jun 1, 2017
setup communication node
View setupcomnode.sh
#!/bin/bash
# setup augmavconn and libmavconn environment
# Author Lai Jun, <laijun@nudt.edu.cn>
# 2017.5.21
LibmavconnGit='https://git.oschina.net/smarteyes-comm/libmavconn.git'
augmavconnGit='https://git.oschina.net/smarteyes-comm/augmavconn.git'
CommunicationGit='https://git.oschina.net/smarteyes-comm/communication.git'
p=$(pwd)
WS_ROOT=$p/catkin_libaugmavconn_ws
echo "Current folder: $p"
@lj8385174
lj8385174 / P900.py
Last active Apr 10, 2017
automatically P900 work mode set
View P900.py
# -*- code: utf-8 -*-
import subprocess as sub
import serial
from serial.tools.list_ports import comports
import re
import time
import sys
def searchAllSerialPorts():
'''
@lj8385174
lj8385174 / mergeFile.py
Last active Oct 31, 2017
An pdf merge tool to auto remove annotations and merge papers
View mergeFile.py
# -*- coding:utf-8 -*-
Despriptor=r'''
An pdf merge tool to auto remove annotations and merge papers
work-flow:
1. Export bibtex with attachment files throgh Zotero(https://www.zotero.org)
2. cd to the export root folder, and excute the command `mergeFile.py -t yourtitle`
Author: Lai Jun(mfarymail\#gmail.com)
View timestrForFile.m
function [str] = timestrForFile( num )
% generate a timestamp for file
% this time stamp has eliminated charactors forbidden in filename
% num is a num for time stamp, now is the default.
if nargin==0
num = now;
end
View cartesian.py
import numpy as np
def cartesian(arrays, out=None):
"""
Generate a cartesian product of input arrays.
Parameters
----------
arrays : list of array-like
1-D arrays to form the cartesian product of.
@lj8385174
lj8385174 / resampleSystematic.m
Created Oct 17, 2016
resample method in particle filter
View resampleSystematic.m
function [ indx ] = resampleSystematic(w,N)
Q = cumsum(w);
T = linspace(0,1-1/N,N) + rand(1)/N;
T(N+1) = 1;
i=1;
j=1;
indx = zeros(N,1);
You can’t perform that action at this time.