随笔分类 -  unix/linux

vi命令行命令的积累
摘要:统计单词评率 :%s/string/&/gn just replace string with what you want to count n查看next word出现的位置 阅读全文

posted @ 2019-11-11 19:52 CreatorKou 阅读(138) 评论(0) 推荐(0)

vmware虚拟机网络配置(物理机能用ssh连接虚拟机, 虚拟机能共享物理机网卡上外网)仅主机模式,nat模式应该也可以
摘要:1.环境: 物理机:windows7 虚拟机:centos7 ...xx.xx.x 虚拟化软件:vmware 13 2.准备阶段: vmware安装centos操作系统(easy),网卡地址简单配置,虚拟网卡连接方式先设置为“仅主机模式”。 3.物理机配置 在物理机win7中, win+r, ser 阅读全文

posted @ 2019-10-17 20:12 CreatorKou 阅读(1561) 评论(0) 推荐(0)

scatter/gather IO原理
摘要:https://stackoverflow.com/questions/10520182/linux-when-to-use-scatter-gather-io-readv-writev-vs-a-large-buffer-with-frea The main convenience offered 阅读全文

posted @ 2019-10-10 19:50 CreatorKou 阅读(358) 评论(1) 推荐(0)

linux修改环境变量的三种方式,全局修改两种,用户范围修改一种
摘要:全局修改: 方法一: 在/etc/profile文件中添加变量【对所有用户生效(永久的)】 用VI在文件/etc/profile文件中增加变量,该变量将会对Linux下所有用户有效,并且是“永久的”。 要让刚才的修改马上生效,需要执行以下代码 # source /etc/profile 方法二: 在 阅读全文

posted @ 2019-09-20 14:32 CreatorKou 阅读(2482) 评论(0) 推荐(0)

lseek判定文件是否可以seek/是否是管道FIFO(FIFO不能lseek)
摘要:off_t currpos; currpos = lseek(fd,0,SEEK_CUR) 对lseek的成功调用会返回心得文件偏移量,如果文件描述符file descriptor指向的是一个pipe,FIFO,socket,lseek会将errno设置为ESPIPE,然后返回-1. 阅读全文

posted @ 2018-07-10 17:14 CreatorKou 阅读(239) 评论(0) 推荐(0)

认真学习deb文件的操作,避免许多坑
摘要:https://www.cyberciti.biz/faq/how-to-extract-a-deb-file-without-opening-it-on-debian-or-ubuntu-linux/ mysql官网下载了connector/j的deb包不知道怎么用,只会dpkg -i xx.de 阅读全文

posted @ 2018-06-16 00:24 CreatorKou 阅读(161) 评论(0) 推荐(0)

netty:本地client无法连接远程server(阿里云)
摘要:需要在阿里云控制台,设置防火墙,添加规则:全部TCP+UDP,端口范围:1/65535 阅读全文

posted @ 2018-06-14 10:11 CreatorKou 阅读(479) 评论(0) 推荐(0)

服务器开发需要学习的基础工具
摘要:因为服务器在远程,无法使用ide,only command line 需要在本地编代码,然后通过git传到服务器,服务器使用makefile编译,一些批处理需要写成shell脚本; 所以,需要学习git,makefile,编译命令的各种选项和用法,shell脚本这些基本工具。 阅读全文

posted @ 2018-06-14 00:20 CreatorKou 阅读(373) 评论(0) 推荐(0)

java makefile学习实践(编译的javac命令写在makefile中,运行命令java写在shell脚本中)
摘要:学习makefile教程,ubuntu中文网 1.写一个简单的java项目,不需要外部jar,用的简单的 hellocat Hellocat.java Cat.java makefile 执行的时候还得输入java Hellocat,这个项目比较小无所谓,如果遇到大的项目,各种package,需要调 阅读全文

posted @ 2018-06-14 00:12 CreatorKou 阅读(780) 评论(0) 推荐(0)

ssh远程登录和git远程仓库传输
摘要:学习了廖的git教程,网上找了一些ssh的知识,然后开始实践: 工具:阿里云服务器ubuntu16.04LTS(安装git) 本地主机,ubuntu16.04 LTS(git,ssh) 步骤: 1.阿里云官网:配置阿里云服务器的远程连接信息: 在阿里云控制台,远程连接,客户端使用账号密码连接,设置密 阅读全文

posted @ 2018-06-13 23:51 CreatorKou 阅读(224) 评论(0) 推荐(0)

ubuntu apt-get提示no dependencys怎么办
摘要:This would install any dependencies that your previous installs missed. I just corrected my teamviewer and VNC installs. 阅读全文

posted @ 2018-05-28 14:27 CreatorKou 阅读(190) 评论(0) 推荐(0)

pthread编译选项(命令行,codeblocks)
摘要:通过命令行编译: For Linux the correct command is: gcc -pthread -o term term.c In general, libraries should follow sources and objects on command line, and -l 阅读全文

posted @ 2018-03-13 21:10 CreatorKou 阅读(413) 评论(0) 推荐(0)

学习apue的pthread synchronize之condition variables
摘要:学习apue11.6.6 condition variables实践: 使用书上的condition variables和wait函数 参考c++11 的condition variables:http://blog.csdn.net/hujingshuang/article/details/705 阅读全文

posted @ 2018-03-13 21:07 CreatorKou 阅读(183) 评论(0) 推荐(0)

pthreads之joinable和detach函数
摘要:Joinable and Detached Threads http://www.domaigne.com/blog/computing/joinable-and-detached-threads/ Introduction By default, created threads are joina 阅读全文

posted @ 2018-03-12 22:13 CreatorKou 阅读(330) 评论(0) 推荐(0)

c++指针空间大小的决定因素
摘要:在学习apue的11.5 Threads时,有一个实例代码,其中有一个打印地址fp的语句printf(" structure at 0x%lx\n", (unsigned long)fp);为什么要将指针变量fp强制转换为unsigned long再打印呢,(为了兼容unix的各种分支平台)以前学习 阅读全文

posted @ 2018-03-12 19:56 CreatorKou 阅读(1338) 评论(0) 推荐(0)

理解apue中的signal function函数指针概念
摘要:#include <signal.h>void (*signal(int signo, void (*func)(int)))(int);Returns: previous disposition of signal (see following) if OK, SIG_ERR on error s 阅读全文

posted @ 2018-03-07 20:13 CreatorKou 阅读(215) 评论(0) 推荐(0)

导航