跳至主要内容

博文

ncurses与readline结合

  #define _XOPEN_SOURCE 700       /* for wcswidth and 700 is for mbsnrtowcs */ #include<wchar.h> #include<ncurses.h>       /* ncurses.h includes stdio.h */ #include<stdlib.h> #include<string.h> #include<readline/readline.h> #include<locale.h>     int mygetstr( char *str, int y, int x){    WINDOW *win;    int size, col;    int ok = 0;    int width;    wchar_t wstr[80];    char *p;        getmaxyx(stdscr, size, col);        void getaline( char *s){      str = s;      rl_callback_handler_remove();      ok = 1;    }        rl_callback_handler_install( "" , getaline);    win = newwin(1, col-x, y, x);    while (1){      rl_callback_read_char(); ...

libunwind查看其他进程的堆栈

 g++ -g3 -o main main.cpp -std=c++11 -lunwind -lunwind-x86_64 -lunwind-ptrace   #include <iostream> #include <libunwind.h> #include <libunwind-ptrace.h> #include <unistd.h> #include <sys/ptrace.h> #include <sys/wait.h> #include <cxxabi.h> #include <cstdio> int wait4stop ( pid_t pid ) { int status = 99 ; do { if ( waitpid ( pid , & status , 0 ) == - 1 || WIFEXITED ( status ) || WIFSIGNALED ( status )) return 0 ; } while ( ! WIFSTOPPED ( status )); return 1 ; } void get_backtrace ( pid_t pid ) { unw_cursor_t cursor , resume_cursor ; unw_context_t context ; unw_word_t ip , sp , off ; unw_addr_space_t addr_space = unw_create_addr_space ( & _UPT_accessors , __BYTE_ORDER__ ); if ( ! addr_space ) std :: cerr << "Failed to create address space" << std :: e...

Error:Cause: dl.google.com:443 failed to respond

  到电脑根目录下面的.gradle/gradle.properties 把里面的内容修改成 # org.gradle.parallel=true #Fri Jun 29 10:45:08 CST 2018 #systemProp.https.proxyPort=1080 systemProp.http.proxyHost=127.0.0.1 #systemProp.https.proxyHost=127.0.0.1 systemProp.http.proxyPort=1080      在 电脑根目录下面的( 不是项目目录!!!windows10目录在C:\Users\XXX.gradle其中XXX为本地用户名 ) .gradle/gradle.properties中添加如下 #systemProp.https.proxyPort=1080 #systemProp.http.proxyHost=127.0.0.1 #systemProp.https.proxyHost=127.0.0.1 #systemProp.http.proxyPort=1080 org.gradle.jvmargs=-DsocksProxyHost=127.0.0.1 -DsocksProxyPort=1080 因为我用的sock5所以只需要最后的一行,如果是http代理,那就如前面回答,仅保留关于http配置的即可。  

shadowsocks android编译

git clone https://github.com/shadowsocks/shadowsocks-android.git cd shadowsocks-android git submodule update --init --recursive chmod a+rwx ./ -R docker run --rm -v ${PWD}:/build -w /build shadowsocks/android-ndk-go ./gradlew assembleDebug  

亚航 进入人工服务的方式

  不停的问号,最后就会出来人工服务