LMLPHP后院

Wincachegrind Cannot find all target技术

maybe yes 发表于 2017-09-20 09:46

最近用了两个工具,一个 webgrind 一个 wincachegrind。发现两个都是不能用的软件。

使用 wincachegrind 解析 XDebug trace 文件出现报错。

Parser error: At this point at least main instance is expected.

cachegrind.out line number: 2680

CurInst: NULL

Stack: empty

Call buffer: empty

然后使用 wincachegrind 解析 cachegrind.out 文件,依然报错。

Wincachegrind Cannot find all target
Wincachegrind Cannot find all target
Wincachegrind Cannot find all target

Office Word 2013 修改目录级别院内

maybe yes 发表于 2017-09-19 13:37

Office Word 如何修改自动生成的目录级别?一般自动生成的目录默认只有三级,这样很多子目录显示不出来,目录显得非常的短,文本以 Office Word 2013 为例讲解如何设置目录级别。

看图,菜单栏选择->引用->目录。

选择自定义目录。在弹出对话框中选择目录->常规->显示级别,最多可以显示 9 级别。

点击确定后,在自动生成的目录那里,右击->更新域->更新整个目录即可。

Office Word 2013 修改目录级别
Office Word 2013 修改目录级别

OpenResty Lua Redis 加速接口响应技术

maybe yes 发表于 2017-09-19 10:41

本文以完整的示例,展示使用 Nginx、Lua、Redis 对响应速度慢的接口进行加速响应,提供快速的用户体验。代码经过严格的测试,没有任何问题。缓存的核心思想在于读取缓存后,即时中断连接,返回结果,然后继续执行,更新缓存。可以缓存的接口一般都是与用户无关的接口,比如计算当日热度最高的商品排行等。

需要加速的接口代码,如下示例:

<?php
sleep(2);
echo 'sleep 2 seconds, date is '.date("Y-m-d H:i:s")."\n";

测试接口访问效果,需要等待 2 秒后才能返回结果,如下示例:

$ curl -XGET lua.may:90/test.php
sleep 2 seconds, date is 2017-09-19 10:44:58

Linux 下用户组别权限的理解技术

maybe yes 发表于 2017-09-18 22:02

本篇讲述 Linux 用户组别权限的理解,希望给大家带来帮助。

先看操作历史记录。

Last login: Thu Aug  3 03:31:18 2017 from 202.101.22.42
root@may:~# groups root
root : root
root@may:~# groups sudo
groups: sudo: no such user
root@may:~# groups www-data
www-data : www-data
root@may:~# usermod -G www-data root
You have new mail in /var/mail/root
root@may:~# groups www-data
www-data : www-data
root@may:~# exit
logout
Connection to lmlphp.com closed.



Last login: Thu Aug  3 04:29:46 2017 from 202.101.22.42
root@may:~# groups www-data
www-data : www-data
root@may:~# groups root
root : root www-data
root@may:~# usermod --help
Usage: usermod [options] LOGIN

Options:
  -c, --comment COMMENT         new value of the GECOS field
  -d, --home HOME_DIR           new home directory for the user account
  -e, --expiredate EXPIRE_DATE  set account expiration date to EXPIRE_DATE
  -f, --inactive INACTIVE       set password inactive after expiration
                                to INACTIVE
  -g, --gid GROUP               force use GROUP as new primary group
  -G, --groups GROUPS           new list of supplementary GROUPS
  -a, --append                  append the user to the supplemental GROUPS
                                mentioned by the -G option without removing
                                him/her from other groups
  -h, --help                    display this help message and exit
  -l, --login NEW_LOGIN         new value of the login name
  -L, --lock                    lock the user account
  -m, --move-home               move contents of the home directory to the
                                new location (use only with -d)
  -o, --non-unique              allow using duplicate (non-unique) UID
  -p, --password PASSWORD       use encrypted password for the new password
  -R, --root CHROOT_DIR         directory to chroot into
  -s, --shell SHELL             new login shell for the user account
  -u, --uid UID                 new UID for the user account
  -U, --unlock                  unlock the user account
  -v, --add-subuids FIRST-LAST  add range of subordinate uids
  -V, --del-subuids FIRST-LAST  remvoe range of subordinate uids
  -w, --add-subgids FIRST-LAST  add range of subordinate gids
  -W, --del-subgids FIRST-LAST  remvoe range of subordinate gids
  -Z, --selinux-user SEUSER     new SELinux user mapping for the user account

root@may:~# group
groupadd  groupdel  groupmod  groups
root@may:~# groupdel --help
Usage: groupdel [options] GROUP

Options:
  -h, --help                    display this help message and exit
  -R, --root CHROOT_DIR         directory to chroot into

You have new mail in /var/mail/root
root@may:~# man groupdel
-bash: man: command not found
root@may:~# vim /etc/passwd
You have new mail in /var/mail/root
root@may:~# groups
root www-data
root@may:~# vim /etc/group
root@may:~# usermod -G lin root
root@may:~# groups
root www-data
root@may:~# groups root
root : root lin
root@may:~# groups www-data
www-data : www-data
root@may:~# groups lin
lin : lin sudo
root@may:~# groups
root www-data
root@may:~# groups root
root : root lin
root@may:~# exit
logout
Connection to lmlphp.com closed.



Welcome to Ubuntu 14.04 LTS (GNU/Linux 2.6.32-042stab108.8 x86_64)

 * Documentation:  https://help.ubuntu.com/
You have new mail.
Last login: Thu Aug  3 04:31:07 2017 from 202.101.22.42
root@may:~# groups
root lin
root@may:~# groups root
root : root lin
root@may:~# usermod -G www-data root
root@may:~# groups
root lin
root@may:~# groups root
root : root www-data
root@may:~#

代码构建发布系统核心代码技术

maybe yes 发表于 2017-09-18 21:38

代码构建发布系统,市场上有无数个,一般 python 的居多,因为运维也就会点 python。不论哪种代码发布系统,核心代码都是一样的,就是使用了 Linux 的 rsync 功能。连核心功能都是系统自带的,那就应该是没有核心吧。

如下 rsync 示例:

sprintf(
	'rsync -rltgoDzvO %s %s %s %s'
	, TMP_DIR
	, TARGET_DIR
	, (DELETE_FILES) ? '--delete-after' : ''
	, $exclude
);

由此可见,发布系统并没有核心技术,其核心是系统自带的 rsync 功能,真正的核心也就一行代码,只是外面套了一层又一层的皮而已。比如加上了 web 界面,与各种版本控制功能相互融洽结合。

2024-04-20 17:51:31 1713606691 0.006923