Skip to content

Instantly share code, notes, and snippets.

View dreamflyforever's full-sized avatar
🎯
Focusing

杨善锦(Jim) dreamflyforever

🎯
Focusing
View GitHub Profile
@dreamflyforever
dreamflyforever / Makefile
Created November 3, 2016 01:58
This Makefile is apply for any c project.
#############################################################################
#
# It's the part of fos.
# Modified by Shanjin Yang
#
# Generic Makefile for C/C++ Program
#
# License: GPL (General Public License)
# Author: whyglinux <whyglinux AT gmail DOT com>
# Date: 2006/03/04 (version 0.1)
#!/bin/sh
find ./ -name "*.c" -o -name "*.h" -o -name "*.cpp" -o -name "*.py" -o -name "*.s" > cscope.files
cscope -Rbq -i cscope.files
ctags -R --exclude=.git
imap jj <esc>
colorscheme evening
set hlsearch
set incsearch
set autoindent
@dreamflyforever
dreamflyforever / clock_get
Created January 4, 2017 07:44
From chrome://newtab/
#include<time.h>
#include<stdio.h>
#include<stdlib.h>
#define MILLION 1000000
long clock_get()
{
long ret;
struct timespec t;
#!/bin/bash
begin=$(date +%s)
for ((i=0;i<1;i++));do
{
mosquitto_pub -h 120.24.75.220 -p 61613 -u admin -P password -t test -m test
}&
done
wait
end=$(date +%s)
spend=$(expr $end - $begin)
@dreamflyforever
dreamflyforever / pid_stat
Created January 6, 2017 02:04
From chrome://newtab/
pidstat -r -p 27427 -u 2
@dreamflyforever
dreamflyforever / searchInside
Created January 11, 2017 09:46
From chrome://newtab/
/* Search a wireless tool and return its path */
static char * wiToolsPath(const char * tool)
{
char * path;
int i, nbelems;
static const char * paths [] = {
"/sbin",
"/usr/sbin",
"/usr/local/sbin",