Skip to content

Instantly share code, notes, and snippets.

Yifan Gao gaoyifan

Block or report user

Report or block gaoyifan

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
@gaoyifan
gaoyifan / joinMP4
Created Dec 26, 2013
append lots of mp4 in one mp4 file
View joinMP4
file=`find . -name '*.mp4' | sed 's/^\.\// -cat "/g' | tr '\n' '"'`
#echo $file
echo "MP4Box $file output.mp4" | bash
@gaoyifan
gaoyifan / bmon-3.1-patch.diff
Created Jun 16, 2014
bmon-3.1 patch for Homebrew
View bmon-3.1-patch.diff
diff --git a/Makefile.in b/Makefile.in
index 6a94c01..0cfbd52 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.13.2 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
View getCPUtime.cpp
long long getCPUtime()
{
unsigned int time_low,time_high;
asm("rdtsc \n\t");
asm("movl %%eax, %0\n\t":"=g"(time_low));
asm("movl %%edx, %0\n\t":"=g"(time_high));
return ((long long)time_high << 32) | time_low;
}
@gaoyifan
gaoyifan / RTAI installation for ubuntu 14.04.md
Last active Mar 17, 2019
RTAI installation for ubuntu 14.04
View RTAI installation for ubuntu 14.04.md

RTAI installation for ubuntu 14.04

Preparation

download and unzip

cd /usr/src
curl -L https://www.rtai.org/userfiles/downloads/RTAI/rtai-4.1.tar.bz2 | tar xj
curl -L https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.10.32.tar.xz | tar xJ
curl -L http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.10.32-saucy/linux-image-3.10.32-031032-generic_3.10.32-031032.201402221635_amd64.deb -o linux-image-3.10.32-generic-amd64.deb
@gaoyifan
gaoyifan / ubuntu-mount-new-disk.md
Last active Apr 8, 2019
ubuntu 添加新硬盘
View ubuntu-mount-new-disk.md

ubuntu 添加新硬盘

查看硬盘:

# fdisk -l
...
Disk /dev/sdb: 274.9 GB, 274877906944 bytes
255 heads, 63 sectors/track, 33418 cylinders, total 	536870912 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
@gaoyifan
gaoyifan / ubuntu-install-RTT-base-on-RTAI.md
Last active Oct 27, 2016
RTT installation for ubuntu14.04 base on RTAI kernel
View ubuntu-install-RTT-base-on-RTAI.md

RTT installation for ubuntu14.04 base on RTAI kernel

install requirement (assuming that use the image I provided)

apt-get install build-essential cmake libxerces-c2-dev omniorb libboost-all-dev doxygen

get RTT source

cd /usr/src
git clone git://gitorious.org/orocos-toolchain/rtt.git

add environment varible

export RTAI_ROOT_DIR=/usr/realtime
export RTAI_INCLUDE_DIR=$RTAI_ROOT_DIR/include
export RTAI_LIBRARY=$RTAI_ROOT_DIR/lib
@gaoyifan
gaoyifan / google-fonts-proxy
Last active Mar 24, 2020
google-fonts-proxy
View google-fonts-proxy
server {
listen 80;
listen 443;
listen [::]:80;
listen [::]:443;
server_name fonts.lug.ustc.edu.cn;
access_log /var/log/nginx/revproxy_access.log;
error_log /var/log/nginx/revproxy_error.log;
View png2bin.go
package main
import (
"bytes"
"encoding/binary"
"fmt"
"image/png"
"os"
)
View keybase.md

Keybase proof

I hereby claim:

  • I am gaoyifan on github.
  • I am ylgaoyifan (https://keybase.io/ylgaoyifan) on keybase.
  • I have a public key whose fingerprint is 9729 B528 F023 EBA7 C4FE 8318 50E3 DB81 7CCE F878

To claim this, I am signing this object:

View dmesg-mirrors-Wed Sep 28 02:22:43 CST 2016
[ 0.573915] pci 0000:00:1a.0: reg 0x20: [io 0x9e80-0x9e9f]
[ 0.574011] pci 0000:00:1a.0: System wakeup disabled by ACPI
[ 0.574059] pci 0000:00:1a.1: [8086:3a38] type 00 class 0x0c0300
[ 0.574098] pci 0000:00:1a.1: reg 0x20: [io 0x9e20-0x9e3f]
[ 0.574194] pci 0000:00:1a.1: System wakeup disabled by ACPI
[ 0.574240] pci 0000:00:1a.2: [8086:3a39] type 00 class 0x0c0300
[ 0.574280] pci 0000:00:1a.2: reg 0x20: [io 0x9dc0-0x9ddf]
[ 0.574373] pci 0000:00:1a.2: System wakeup disabled by ACPI
[ 0.574429] pci 0000:00:1a.7: [8086:3a3c] type 00 class 0x0c0320
[ 0.574449] pci 0000:00:1a.7: reg 0x10: [mem 0xfaaf6000-0xfaaf63ff]
You can’t perform that action at this time.