[linux]shell自动化版本控制

2016-6-14 写技术

中午“夜深人静”时分,写了个版本控制脚本,放在代码编译的开头,以后再也不用手动修改软件的版本号了,爽到没朋友有没有? #!/bin/bash tmp=`sed -n 's/.*VERSION.*"\(.*\)"/\1/p' version.h` echo tmp cnt=`echo $tmp | tr . "\n" | wc -l` a=0;b=0;c=0 if [ $cnt == 3 ]; then a=`echo $tmp|sed -n 's/\(.*\)\.\(.*\)\.\(.*\)/\1/p'` b=`echo $tmp|sed...

阅读全文>>

标签: linux

评论(0) 浏览(1251)

[linux]Let mosquitto support websockets

2016-5-11 写技术

1.Install libwebsockets  $ wget http://git.libwebsockets.org/cgi ... 3-firefox-36.tar.gz  $ tar zxvf libwebsockets-1.4-chrome43-firefox-36.tar.gz  $ cd libwebsockets-1.4-chrome43-firefox-36  $ mkdir build  $ cd build  $ cmake ..  $ make install  $ ldco...

阅读全文>>

标签: linux

评论(1) 浏览(2678)

[linux]mosquitto开启实名登录

2016-4-15 写技术

1.修改mosquitto.conf #allow_anonymous true #password_file 改为 allow_anonymous false password_file /xxx/xxx/user.pass 2.产生密码文件user.pass mosquitto_passwd -b ./user.pass username password  注意文件路径

阅读全文>>

标签: linux

评论(1) 浏览(1698)

[linux]最大线程数受多个原因制约

2016-3-10 写技术

用 cat /proc/sys/kernel/threads-max 检查一下系统支持的最大线程数,一般来说数字都很大。但实际上用户创建线程的数量还是受几方面制约的。 1、PTHREAT_THREAD_MAX 这个值描述了单个用户进程可创建的最大线程数,直接修改并无效果,得在修改后重新编译C库才能起作用,除非有特殊要求,否则就小题大做了。 2、linux 中每个线程分配的栈空间缺省为8M,分配给用户编程的地址空间为3G,因此纯理论上包括主线程在内最大线程数不超过 3 * 1024 / 8 = 384 个,加上代码段,数据段等开销,这个数字还要减少。因此减少每个线程的栈大小可以增加创...

阅读全文>>

标签: linux

评论(0) 浏览(1515)

[linux]Change the limit of file uploading in ubuntu

2016-3-10 写技术

vi /etc/php5/apache2/php.ini upload_max_filesize = 2M  memory_limit = 128M  post_max_size = 8M sudo /etc/init.d/apache2 restart

阅读全文>>

标签: linux

评论(0) 浏览(1162)

[linux]Solution of "cannot open shared object file"

2016-3-4 写技术

"./sub: error while loading shared libraries: libmosquitto.so.1: cannot open shared object file: No such file or directory" Assuming you have installed the libraries to /usr/local/lib, which is the default, the correct answer is to run /sbin/ldconfig as root/sudo. On some systems you will need to ...

阅读全文>>

标签: linux

评论(0) 浏览(1421)

[linux]查看端口使用情况

2016-3-4 写技术

查看端口使用情况,使用netstat命令。 查看已经连接的服务端口(ESTABLISHED netstat -a 查看所有的服务端口(LISTEN,ESTABLISHED)     netstat -ap   查看8080端口,则可以结合grep命令:     netstat -ap | grep 8080   如查看8888端口,则在终端中输入: lsof -i:8888   若要停止使用这个端口的程序,使用kill +对应的pid即可

阅读全文>>

标签: linux

评论(0) 浏览(1294)

[linux]Errors while making mosquitto in a new PC of Ubuntu12.04.

2016-3-4 写技术

Make mosquitto in a new PC of Ubuntu12.04.There is some errors: 1."openssl/*.h: No such file or directory"  install libssl-dev 2."ares.h: No such file or directory" install libc-ares-dev install libc-ares2 3."g++: command not found" install g++ 4."uuid/uuid.h No such file or dir...

阅读全文>>

标签: linux

评论(0) 浏览(1235)

[linux]一些常用的命令(2)

2016-3-4 写技术

1、man命令 该命令可以显示指定命令的用法和描述。 语法: man <command name> man ls root@nicholas:~# man ls LS(1)                            User Commands                           ...

阅读全文>>

标签: linux

评论(0) 浏览(1232)

[linux]一些常用的命令(1)

2016-3-4 写技术

1 ‘who -r’ 和 ‘runlevel’ 命令可以用来查看当前的Linux服务器的运行级别。 2 用 “route -n” 和 “netstat -nr” 命令,我们可以查看默认网关。除了默认的网关信息,这两个命令还可以显示当前的路由表。 3 在CentOS 5.X / RHEL 5.X中,可以用mkinitrd命令来创建初始化内存盘文件,举例如下: # mkinitrd -f -v /boot/initrd-$(uname -r).img $(uname -r) 如果你想要给特定的内核版本创建初始化内存盘,你就用所需的内核名替换掉 ‘uname -r’ 。 在Cent...

阅读全文>>

标签: linux

评论(0) 浏览(1197)

Powered by anycle 湘ICP备15001973号-1