zoukankan      html  css  js  c++  java
  • 常用小工具集

    EXPORT

    #   if defined( MP4V2_EXPORTS )
    #       define MP4V2_EXPORT __declspec(dllexport)
    #       define MP4V2_EXPORT __declspec(dllimport)
    #       define MP4V2_EXPORT
    #   define MP4V2_EXPORT __attribute__((visibility("default")))

     

    gdb--带参数

    https://www.cnblogs.com/helloweworld/p/4372936.html

     

    SIGPIPE

    struct sigaction sa;
    sa.sa_handler = SIG_IGN;
    sigaction( SIGPIPE, &sa, 0 );
        
         
    #include <signal.h>
    void handle_pipe(int sig)
    {
    //do nothing
    }
    int main()
    {
        struct sigaction sa;
        sa.sa_handler = handle_pipe;
        sigemptyset(&sa.sa_mask);
        sa.sa_flags = 0;
        sigaction(SIGPIPE,&sa,NULL);
    //do something
    }

     

     

    https://www.cnblogs.com/zxc2man/p/7660240.html

     

    linux kernel debug

    https://www.ibm.com/developerworks/cn/linux/l-kdbug/index.html

    https://www.ibm.com/developerworks/cn/linux/l-cn-dumpanalyse/index.html

    https://www.cnblogs.com/dhcn/p/10898843.html

     

    linux coredump

    ulimit -c
    
    ulimit -c unlimited
    
    ulimit -a
    
    vi /etc/profile
    ulimit-c unlimited
    
    vi /etc/rc.local
    echo "/data/coredump/core.%e.%p" >/proc/sys/kernel/core_pattern
    
    gdb
    core-file /data/coredump/core.test.9198
    
    #gdb ./test core.xxxxx
    
    where or bt

     

    #include<stdio.h>
    
    void core_test1(){
     int i=0;
     scanf("%d",i);
     printf("%d
    ",i);
    }
    void core_test2(){
     char *ptr = "my name is hello world";
     *ptr = 0;
    }
     
    int main(){
     core_test1();
     return 0;
    }

    g++ -g core.cpp -o test 

     

     

    ps -ef |grep gb28181-ms

     

    screen -ls

    screen -r id

    screen -D -r id

    ctrl + a + d 退出

     

    linux文件/目录属性

    -rw------- (600) 只有所有者才有读和写的权限

    -rw-r--r-- (644) 只有所有者才有读和写的权限,组群和其他人只有读的权限

    -rwx------ (700) 只有所有者才有读,写,执行的权限

    -rwxr-xr-x (755) 只有所有者才有读,写,执行的权限,组群和其他人只有读和执行的权限

    -rwx--x--x (711) 只有所有者才有读,写,执行的权限,组群和其他人只有执行的权限

    -rw-rw-rw- (666) 每个人都有读写的权限

    -rwxrwxrwx (777) 每个人都有读写和执行的权限

    chrome离线安装

    https://www.jianshu.com/p/7c93b62387ab

    linux nc

    https://linux.die.net/man/1/nc

    Ubuntu环境下SSH服务安装、SSH远程登录以及SSH数据传输

    https://www.cnblogs.com/asyang1/p/9467646.html

    minicom配置

    sudo minicom -s

    dos2unix

    sudo apt-get -y install dos2unix

    find . -type f -exec dos2unix {} ;

     

    windows下对127.0.0.1抓包, RawCap很方便

    https://blog.csdn.net/sunny_ss12/article/details/51460848

     

    code::blocks clion atom vscode

     

    ubuntu安装atom

    https://blog.csdn.net/hao5743/article/details/52056194

    ubuntu安装vscode

    sudo apt-get install software-properties-common python-software-properties
    sudo add-apt-repository ppa:ubuntu-desktop/ubuntu-make
    sudo apt-get update
    sudo apt-get install ubuntu-make
    umake web visual-studio-code
    umake web visual-studio-code --remove

     

    code.visualstudio.com

    sudo  dpkg  -i   code_1.44.2-1587059832_amd64.deb

     

    gcc升降级

    https://blog.csdn.net/agenih/article/details/79491366

    https://blog.csdn.net/betty13006159467/article/details/78394974

     

    git 一个分支完全覆盖另一个分支

    1,git push origin develop:master -f
    就可以把本地的develop分支强制(-f)推送到远程master

    2,
    git checkout master // 切换到旧的分支
    git reset –hard develop // 将本地的旧分支 master 重置成 develop
    git push origin master –force // 再推送到远程仓库

    liaoxuefeng git

    https://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/001375840038939c291467cc7c747b1810aab2fb8863508000

    14、树梅派

    树梅派应用56:用树莓派搭建Git私有服务器

    https://blog.csdn.net/huayucong/article/details/54407143

    树梅派应用58:使用ngrok将树莓派web服务映射到公网

    https://blog.csdn.net/huayucong/article/details/54407189

    13、Linaro Toolchain

    https://www.linaro.org/downloads/

    Linaro provides monthly GCC source archive snapshots of the current Linaro GCC release branch, as well as quarterly releases of pre-built Linaro GNU cross-toolchain binary archives.

    The following tables provide direct access to the most common Linux and bare-metal ABI variants of the Linaro binary cross-toolchain quarterly releases. Both x86_64 Linux and Mingw32 (MS Windows compatible) host binaries are provided:

    Latest Linux Targeted Binary Toolchain Releases

    arm-linux-gnueabihf 32-bit ARMv7 Cortex-A, hard-float, little-endian Release-Notes Binaries Source
    armv8l-linux-gnueabihf 32-bit ARMv8 Cortex-A, hard-float, little-endian Release-Notes Binaries Source
    aarch64-linux-gnu 64-bit ARMv8 Cortex-A, little-endian Release-Notes Binaries Source

    Latest Bare-Metal Targeted Binary Toolchain Releases

    arm-eabi 32-bit ARMv7 Cortex-A, soft-float, little-endian Release-Notes Binaries Source
    aarch64-elf 64-bit ARMv8 Cortex-A, little-endian Release-Notes Binaries Source

    12、交叉编译lrzsz实现arm串口xmodem,ymodem,zmodem协议的lrz和lsz数据收发

    http://blog.chinaunix.net/uid-20564848-id-74714.html

    11、各种视音频封装格式分析

    http://blog.csdn.net/leixiaohua1020/article/details/17934487

    10、USB 调试工具(python2.7 + Tkinter + pyusb/pywinusb)

    http://www.cnblogs.com/jakeyChen/p/4463530.html

     https://github.com/Qbicz/ChibiOS-mems-usb

    9、串口调试工具(Python2.7+pyserial+Tkinter)

    http://www.cnblogs.com/jakeyChen/p/4465281.html

    8、在windows上用adb安装android apk

     adb工具:http://files.cnblogs.com/files/dong1/adb1.0.32.zip

    用ADB(Android Debug Bridge)实时监测Android程序的运行

    https://blog.csdn.net/peibaoyi/article/details/9422487

    7、VIM安装插件

    1)sudo apt-get install ctags

    2)ctags -R

     http://www.cnblogs.com/ynxf/p/5922661.html

    http://www.cnblogs.com/zhaoyl/p/4078164.html

    6、CheckTool:CRC校验、累加和校验、异或和校验专业校验工具V1.1

    http://www.cnblogs.com/tdyizhen1314/archive/2012/10/10/2718808.html

    5、keil mdk __attribute__用法

    4、beyond compare 30天评估期到期

    beyond compare 4你的30天评估期到期,那时候也打不开软件,输入不了注册码,然后也不想花过多时间搞这玩意,简单,一步解决问题。

    找到beyond Compare 4文件夹下面的BCUnrar.dll,将其删掉或者重命名,再重新打开接着使用。windows下可行,linux没试。

    3、PL2303驱动

    http://www.prolific.com.tw/US/ShowProduct.aspx?pcid=41&showlevel=0017-0037-0041

    2、repo应用

    下了好几个repo都不靠谱,运行报错

    fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle

    fatal: error [Errno 101] Network is unreachable

    解决方法,先单独克隆repo,然后将git-repo里面的repo文件复制到用户根目录下的bin目录里,在同步源码的工作目录新建.repo文件夹,把git-repo重命名为repo复制到.repo目录下:

    git clone https://gerrit-googlesource.lug.ustc.edu.cn/git-repo

    重新初始化:

    repo init -u https://github.com/intel-ndg/manifest -b v4.1 -m default.xml

    同步开始

    repo sync -j5

    1、代码托管

    1)github公共空间免费,私有空间收费。

    2)gitlab完全免费再加送整个系统

    3)bitbucket比github更好用

     

    git 一个分支完全覆盖另一个分支

    1)

    git push origin develop:master -f
    就可以把本地的develop分支强制(-f)推送到远程master

    2)
    git checkout master // 切换到旧的分支
    git reset –hard develop // 将本地的旧分支 master 重置成 develop
    git push origin master –force // 再推送到远程仓库

    git合并分支

    dong@ubuntu:~/z1/demo$ git branch
    * aaa
    dong@ubuntu:~/z1/demo$ git checkout -b xxx
    切换到一个新分支 'xxx'
    dong@ubuntu:~/z1/demo$ git branch
      aaa
    * xxx
    dong@ubuntu:~/z1/demo$ git merge aaa
    Already up-to-date.
    dong@ubuntu:~/z1/demo$ git branch -D aaa
    已删除分支 aaa(曾为 439e803)。
    dong@ubuntu:~/z1/demo$ git branch
    * xxx
    dong@ubuntu:~/z1/demo$ git push -u origin xxx
    Counting objects: 62, done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (9/9), done.
    Writing objects: 100% (9/9), 781 bytes | 0 bytes/s, done.
    Total 9 (delta 7), reused 0 (delta 0)
    To git@172.16.23.76:/home/pi/workspace/git/demo.git
       e7b3d0c..439e803  xxx -> xxx
    分支 xxx 设置为跟踪来自 origin 的远程分支 xxx。
    dong@ubuntu:~/z1/demo$ git log
    commit 439e8034030ae75ba112740f3662769eded6c49b
    Author: dong <15019442511@163.com>
    Date:   Thu Sep 27 02:28:24 2018 -0700

        合并aaa分支

    临时合并分支
    git checkout -b tmp
    git branch --set-upstream-to=origin/tmp tmp
    git pull

    log:
    dong@ubuntu:~/1/qbox10$ git checkout -b zdd
    M    application/business_layer/src/bl_warn.c
    切换到一个新分支 'zdd'
    dong@ubuntu:~/1/qbox10$ git status
    位于分支 zdd
    尚未暂存以备提交的变更:
      (使用 "git add <文件>..." 更新要提交的内容)
      (使用 "git checkout -- <文件>..." 丢弃工作区的改动)

        修改:         application/business_layer/src/bl_warn.c

    未跟踪的文件:
      (使用 "git add <文件>..." 以包含要提交的内容)

        lib/nmea/lib/libnmea_so.so
        source/rtklib/src/interface/libinterface.a
        source/rtklib/src/interface/libmain.a

    修改尚未加入提交(使用 "git add" 和/或 "git commit -a")
    dong@ubuntu:~/1/qbox10$ git merge wwx
    Already up-to-date.
    dong@ubuntu:~/1/qbox10$ git add application/business_layer/src/bl_warn.c
    dong@ubuntu:~/1/qbox10$ git commit -m "
    > 适配服务器角色
    > "
    [zdd eb88d3a] 适配服务器角色
     1 file changed, 4 insertions(+), 4 deletions(-)
    dong@ubuntu:~/1/qbox10$ git branch -D wwx
    已删除分支 wwx(曾为 b1a4a13)。
    dong@ubuntu:~/1/qbox10$ git branch
    * zdd
    dong@ubuntu:~/1/qbox10$ git push -u origin zdd
    Counting objects: 54, done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (6/6), done.
    Writing objects: 100% (6/6), 531 bytes | 0 bytes/s, done.
    Total 6 (delta 5), reused 0 (delta 0)
    To git@172.16.23.248:/home/workspace/git/qbox10.git
       6141bb1..eb88d3a  zdd -> zdd
    分支 zdd 设置为跟踪来自 origin 的远程分支 zdd。
    dong@ubuntu:~/1/qbox10$

    合并分支

    dong@ubuntu:~$ git clone -b merge git@172.16.xx.yyy:/home/workspace/git/project.git
    正克隆到 'project'...
    remote: Counting objects: 23917, done.
    remote: Compressing objects: 100% (14341/14341), done.
    remote: Total 23917 (delta 12822), reused 18505 (delta 8786)
    接收对象中: 100% (23917/23917), 293.18 MiB | 11.13 MiB/s, done.
    处理 delta 中: 100% (12822/12822), done.
    检查连接... 完成。
    dong@ubuntu:~$ cd project/
    dong@ubuntu:~/project$ git branch -a
    * merge
      remotes/origin/HEAD -> origin/master
      remotes/origin/master
      remotes/origin/merge
      remotes/origin/zdd
    dong@ubuntu:~/project$ git chekout zdd
    git:'chekout' 不是一个 git 命令。参见 'git --help'。

    您指的是这个么?
        checkout
    dong@ubuntu:~/project$ git checkout zdd
    分支 zdd 设置为跟踪来自 origin 的远程分支 zdd。
    切换到一个新分支 'zdd'
    dong@ubuntu:~/project$ git merge merge
    更新 e9b175d..ffa355b
    Fast-forward
     .gitignore                                         |    2 +
     CMakeLists.txt                                     |   24 +-

    ...

    ...
    dong@ubuntu:~/project$ git push origin zdd
    Total 0 (delta 0), reused 0 (delta 0)
    To git@172.16.xx.yyy:/home/workspace/git/project.git
       e9b175d..ffa355b  zdd -> zdd
    dong@ubuntu:~/project$

    4步

    git clone -b tmp git@172.16.xx.yyy:/home/workspace/git/project.git

    git branch -a

    git chekout zdd

    git merge tmp

    ssh key

    https://blog.csdn.net/yunna520/article/details/83346207

  • 相关阅读:
    病毒
    最短母串
    单词
    Censoring
    玄武密码
    Keywords Search
    聚会
    异象石
    暗的连锁
    pat 1048. Find Coins (25)
  • 原文地址:https://www.cnblogs.com/dong1/p/6936672.html
Copyright © 2011-2022 走看看