ncurses

源码安装nginx到指定目录

让人想犯罪 __ 提交于 2020-03-05 11:38:12
首先是全部步骤概括 yum install libaio ncurses gcc gcc-c++ cmake ncurses-devel wget yum install pcre-devel zlib-devel wget http://nginx.org/download/nginx-1.16.1.tar.gz # 下载源码包 tar -zxvf nginx-1.16.1.tar.gz cd nginx-1.16.1 ./configure --prefix=/opt/nginx1.16 # 这里指定安装目录 make && make install useradd www -s /bin/false vi /opt/nginx1.16/conf/nginx.conf # 修改配置文件 # 第一行去掉前面井号并改为 user www; /opt/nginx1.16/sbin/nginx #启动nginx #以下为可选 /opt/nginx1.16/sbin/nginx -s stop #停止 /opt/nginx1.16/sbin/nginx -s reload #重新载入配置 <!--more--> 1.安装编译器和依赖 yum install libaio ncurses gcc gcc-c++ cmake ncurses-devel wget yum install

这是一个可以显示Linux命令的工具

风格不统一 提交于 2020-02-26 10:49:54
rogress进度查看器是一个简单的程序,可用于显示[neiqian]Coreutils[/neiqian] 命令 的进度。它使用来自文件描述符的信息来确定 命令 的进度。Progress的优点在于它可以与其他 Linux 命令一起使用,比如[neiqian]watch[/neiqian]。 实验环境 Centos 7.7 Minimal Progress工具的github地址:https://github.com/Xfennec/progress 安装 Progress工具依赖ncurses库,先安装ncurses-devel然后再编译安装progress [root@localhost ~]# yum -y install ncurses-devel [root@localhost ~]# git clone https://github.com/Xfennec/progress [root@localhost ~]# cd progress/ [root@localhost progress]# make && make install 运行progress 如果没有命令在运行,那么progress程序将退出并告诉你,没有命令正在运行。 [root@localhost ~]# progress No command currently running: cp, mv, dd,

how to get a correctly sized window in ncurses

故事扮演 提交于 2020-02-06 09:07:45
问题 I am trying out ncurses programming in C on Linux (Mint) and am having a strange problem. I keep getting windows with the wrong number of columns for the first and final lines. For example, with this code found on StackOverflow #include <ncurses.h> int main(){ initscr(); WINDOW * win = newwin(10,50,10,10); box(win,0,0); wrefresh(win); wgetch(win); endwin(); return 0; } I get this output: ┌─┐ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─┘ As if the first and final lines are only three columns wide. If I

How do I port this program from conio to curses?

佐手、 提交于 2020-01-22 19:52:10
问题 I wrote this simple program on Windows. Since Windows has conio, it worked just fine. #include <stdio.h> #include <conio.h> int main() { char input; for(;;) { if(kbhit()) { input = getch(); printf("%c", input); } } } Now I want to port it to Linux, and curses/ncurses seems like the right way to do it. How would I accomplish the same using those libraries in place of conio? 回答1: #include <stdio.h> #include <ncurses.h> int main(int argc, char *argv) { char input; initscr(); // entering ncurses

Read a string with ncurses in C++

依然范特西╮ 提交于 2020-01-21 11:45:11
问题 I'm writing a text-based game in C++. At some point, I ask the user to input user names corresponding to the different players playing. I'm currently reading single char from ncurses like so: move(y,x); printw("Enter a char"); int char = getch(); However, I'm not sure how to a string. I'm looking for something like: move(y,x); printw("Enter a name: "); std::string name = getstring(); I've seen many different guides for using ncurses all using a different set of functions that the other doesn

Read a string with ncurses in C++

不打扰是莪最后的温柔 提交于 2020-01-21 11:45:07
问题 I'm writing a text-based game in C++. At some point, I ask the user to input user names corresponding to the different players playing. I'm currently reading single char from ncurses like so: move(y,x); printw("Enter a char"); int char = getch(); However, I'm not sure how to a string. I'm looking for something like: move(y,x); printw("Enter a name: "); std::string name = getstring(); I've seen many different guides for using ncurses all using a different set of functions that the other doesn

Linux: Pipe into Python (ncurses) script, stdin and termios

送分小仙女□ 提交于 2020-01-21 05:01:09
问题 Apparently this is almost a duplicate of "Bad pipe filedescriptor when reading from stdin in python - Stack Overflow"; however, I believe this case is slightly more complicated ( and it is not Windows specific, as the conclusion of that thread was ). I'm currently trying to experiment with a simple script in Python: I'd like to supply input to the script - either through command line arguments; or by 'pipe'-ing a string to this script - and have the script show this input string using a

iftop编译使用

[亡魂溺海] 提交于 2020-01-19 13:55:18
一、编译依赖库libpcap 1.下载libpcap 下载路径:http://www.tcpdump.org/release/libpcap-1.9.1.tar.gz 2.configure配置 ./configure CC=arm-histbv320-linux-gcc --host=arm-histbv320-linux --prefix=/home/xxx/0723/TVOS_DBS/platform/linux_h5/jznginx 3.make make install make make install 二、编译依赖库ncurses 1.下载ncurses 下载路径:http://ftp.gnu.org/gnu/ncurses/ncurses-6.0.tar.gz 2.configure配置 ./configure CC=arm-histbv320-linux-gcc --host=arm-histbv320-linux --prefix=/home/xxx/0723/TVOS_DBS/platform/linux_h5/jznginx --with-shared 3.make make install make make install 三、编译iftop 1.下载iftop 下载路径:http://www.ex-parrot.com/~pdw/iftop

How to read a key in Go but continue application if no key pressed within x seconds?

醉酒当歌 提交于 2020-01-17 06:52:10
问题 This is an easy way to read a key from the console reader := bufio.NewReader(os.Stdin) // ... func readKey() rune { char, _, err := reader.ReadRune() if err != nil { fmt.Println("Error reading key: ", err) } return char } // ... fmt.Println("Checking keyboard input...") loop: for { keyb := readKey() switch keyb { case 'x': fmt.Println("x key pressed, exiting loop") break loop } } However the issue is the application always waits for a key to be read. What if you want to wait only 5 seconds

GNU/Linux replacements for Turbo C functions `clrscr` and `cprintf`

时光总嘲笑我的痴心妄想 提交于 2020-01-15 03:15:52
问题 I just moved to Linux for just a month. I've used Borland Turbo C for C programming but some of these functions do not work in GNU/Linux, so looking for help. These are some of the functions I would like to replace: - gotoxy - cprintf - clrscr - initgraph/graphics.h I would appreciate some code examples showing how to use any replacements. 回答1: In linux, you can use the ncurses library to use the terminal as a text buffer: move the cursor around, and write text. It can also draw windows and