存档在 ‘【技术】’ 分类

怎样为WordPress更新设置权限

2018年5月8日

首先,创建upgrade目录:

cd /usr/local/apache2/htdocs/wordpress/wp-content
mkdir upgrade
chmod -R 777 upgrade

然后设置权限:

chown -R apache.apache /usr/local/apache2/htdocs/wordpress/wp-content/plugins

参考:http://zctou.com/?p=1387

怎样让进程在后台运行

2018年4月21日

参考:https://www.ibm.com/developerworks/cn/linux/l-cn-nohup/

需求:用 telnet/ssh 登录了远程的 Linux 服务器,如何让命令提交后不受本地关闭终端窗口/网络断开连接的干扰。

hangup 名称的来由:在 Unix 的早期版本中,每个终端都会通过 modem 和系统通讯。当用户 logout 时,modem 就会挂断(hang up)电话。 同理,当 modem 断开连接时,就会给终端发送 hangup 信号来通知其关闭所有子进程。

场景:如果只是临时有一个命令需要长时间运行,什么方法能最简便的保证它在后台稳定运行呢?

方法:当用户注销(logout)或者网络断开时,终端会收到 HUP(hangup)信号从而关闭其所有子进程。因此,我们的解决办法就有两种途径:要么让进程忽略 HUP 信号,要么让进程运行在新的会话里从而成为不属于此终端的子进程。

1. nohup

顾名思义,nohup 的用途就是让提交的命令忽略 hangup 信号。

“nohup – run a command immune to hangups, with output to a non-tty”

只需在要处理的命令前加上 nohup 即可,标准输出和标准错误缺省会被重定向到 nohup.out 文件中。可在结尾加上”&”来将命令同时放入后台运行,也可用”>filename 2>&1″来更改缺省的重定向文件名。

nohup ping www.ibm.com &

2. setsid

nohup 能通过忽略 HUP 信号来使进程避免中途被中断,如果进程不属于接受 HUP 信号的终端的子进程,那么也就不会受到 HUP 信号的影响。setsid 就能帮助做到这一点。

“setsid – run a program in a new session”

只需在要处理的命令前加上 setsid 即可。

setsid ping www.ibm.com

值得注意的是,上例中我们的进程 ID(PID)为31094,而它的父 ID(PPID)为1(即为 init 进程 ID),并不是当前终端的进程 ID。请将此例与nohup 例中的父 ID 做比较。

网站: Zotero

2018年4月19日

首页:https://www.zotero.org/

参考:http://dietsolutionforyou.org/zotero-or-citeulike-or-connotea-or-2collab-or-mekentosj-papers-or-endnote-alternative-or-refworks-alternative-or-refman-alternative-or-orbiomedexperts-com-or-academia-edu-or-epernicus-or-labmeeting-or/
参考:https://www.linux.com/news/zotero-seriously-useful-research-tool
参考:https://scholarlykitchen.sspnet.org/2013/01/24/mendeley-connotea-and-the-perils-of-free-services/

文档:http://webs.wofford.edu/whisnantdm/Training/Citations/Zotero.pdf

Slogan: Zotero – Your personal research assistant

Zotero is a free, easy-to-use tool to help you collect, organize, cite, and share research.

Available for Mac, Windows, and Linux

Collect with a click.

Zotero is the only software that automatically senses research on the web. Need an article from JSTOR or a preprint from arXiv.org? A news story from the New York Times or a book from a library? Zotero has you covered, everywhere.

Organize your way.

Zotero helps you organize your research any way you want. You can sort items into collections and tag them with keywords. Or create saved searches that automatically fill with relevant materials as you work.

Cite in style.

Zotero instantly creates references and bibliographies for any text editor, and directly inside Word and LibreOffice. With support for over 8,000 citation styles, you can format your work to match any style guide or publication.

Stay in sync.

Zotero can optionally synchronize your data across devices, keeping your notes, files, and bibliographic records seamlessly up to date. If you decide to sync, you can also always access your research from any web browser.

Collaborate freely.

Zotero lets you freely collaborate with fellow researchers and distribute class materials to your students. With no restrictions on membership, you can share your Zotero library in public or in private.

Ready to try Zotero?

Zotero is a project of the Corporation for Digital Scholarship and the Roy Rosenzweig Center for History and New Media. It was initially funded by the Andrew W. Mellon Foundation, the Institute of Museum and Library Services, and the Alfred P. Sloan Foundation.

怎样注册.BB域名

2018年4月12日

【介绍】

.BB是巴巴多斯地区的国别域名。

【注册】

¥650/年
https://www.quyu.net

$120
http://whois.telecoms.gov.bb/request/reservation.php

$156
https://www.espace2001.com

【删除】

【应用】

whois.bb 不错

几个JavaScript代码

2018年4月11日

【使用JavaScript代码修改网页标题】

http://www.cnblogs.com/imhurley/archive/2012/03/14/2395720.html
http://www.jb51.net/article/129504.htm
http://moon-soft.com/program/WEB/javascript/article/other/166.htm
http://xmllong.blog.163.com/blog/static/2963566920091051239563/
http://www.cnblogs.com/zjfree/archive/2011/10/20/2219123.html

http://www.cnblogs.com/amylis_chen/archive/2010/07/08/1773335.html

获取当前文件全路径:

<script language="javascript">
alert(window.location.href);
alert(window.location);
alert(location.href);
alert(parent.location.href);
alert(top.location.href);
alert(document.location.href);
alert(document.URL);
</script>

获取当前目录方法:

<script type="text/javascript">
//方法一
var str = location.href;
var arr = str.split("/");
delete arr[arr.length-1];
var dir = arr.join("/");
alert(dir);
//方法二
alert(location.href.substring(0,location.href.lastIndexOf('/')));
</script>

获取当前文件名:

<script type="text/javascript">
var filename=location.href;
filename=filename.substr(filename.lastIndexOf('/')+1);  
alert(filename);  
</script>

【怎样混淆JavaScript代码】

参考:https://www.zhihu.com/question/47047191

参考:https://github.com/caiguanhao/js-obfuscator
参考:https://github.com/FF-Mercurial/ug

参考:https://www.danstools.com/javascript-obfuscate/
参考:http://www.cnblogs.com/ChandlerVer5/p/Javascript_compressor.html
参考:https://blog.csdn.net/nh18304030935hn/article/details/54571682

参考:https://www.css-js.com/tools/compressor.html?tab=babel
参考:https://tool.lu/js/
参考:http://tool.oschina.net/jscompress