iframe自适应高度

框架html代码:

<iframe id="report_iframe" frameborder="0" name="report_iframe" src="<{$adminpage}>?m=index" width="100%" onload="iFrameHeight()"></iframe>

js代码:

function iFrameHeight() {
    var ifm= document.getElementById("report_iframe");
    var subWeb = document.frames ? document.frames["report_iframe"].document : ifm.contentDocument;
    if(ifm != null && subWeb != null) {
        ifm.height = subWeb.body.scrollHeight;
        ifm.width = subWeb.body.scrollWidth;
    }
}

phpstorm 2016.3 激活码 注册码

copy以下代码复制到Activation code选项下面,点击ok,注册成功。

BIG3CLIK6F-eyJsaWNlbnNlSWQiOiJCSUczQ0xJSzZGIiwibGljZW5zZWVOYW1lIjoibGFuIHl1IiwiYXNzaWduZWVOYW1lIjoiIiwiYXNzaWduZWVFbWFpbCI6IiIsImxpY2Vuc2VSZXN0cmljdGlvbiI6IkZvciBlZHVjYXRpb25hbCB1c2Ugb25seSIsImNoZWNrQ29uY3VycmVudFVzZSI6ZmFsc2UsInByb2R1Y3RzIjpbeyJjb2RlIjoiQUMiLCJwYWlkVXBUbyI6IjIwMTctMTEtMjMifSx7ImNvZGUiOiJETSIsInBhaWRVcFRvIjoiMjAxNy0xMS0yMyJ9LHsiY29kZSI6IklJIiwicGFpZFVwVG8iOiIyMDE3LTExLTIzIn0seyJjb2RlIjoiUlMwIiwicGFpZFVwVG8iOiIyMDE3LTExLTIzIn0seyJjb2RlIjoiV1MiLCJwYWlkVXBUbyI6IjIwMTctMTEtMjMifSx7ImNvZGUiOiJEUE4iLCJwYWlkVXBUbyI6IjIwMTctMTEtMjMifSx7ImNvZGUiOiJSQyIsInBhaWRVcFRvIjoiMjAxNy0xMS0yMyJ9LHsiY29kZSI6IlBTIiwicGFpZFVwVG8iOiIyMDE3LTExLTIzIn0seyJjb2RlIjoiREMiLCJwYWlkVXBUbyI6IjIwMTctMTEtMjMifSx7ImNvZGUiOiJEQiIsInBhaWRVcFRvIjoiMjAxNy0xMS0yMyJ9LHsiY29kZSI6IlJNIiwicGFpZFVwVG8iOiIyMD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/xVy/VoklPCK2h0f0GJxFjnye8NT1PAywoyl7RmiAVRE/EKwIDAQABo4GZMIGWMAkGA1UdEwQCMAAwHQYDVR0OBBYEFGEpG9oZGcfLMGNBkY7SgHiMGgTcMEgGA1UdIwRBMD+AFKOetkhnQhI2Qb1t4Lm0oFKLl/GzoRykGjAYMRYwFAYDVQQDDA1KZXRQcm9maWxlIENBggkA0myxg7KDeeEwEwYDVR0lBAwwCgYIKwYBBQUHAwEwCwYDVR0PBAQDAgWgMA0GCSqGSIb3DQEBCwUAA4ICAQC9WZuYgQedSuOc5TOUSrRigMw4/+wuC5EtZBfvdl4HT/8vzMW/oUlIP4YCvA0XKyBaCJ2iX+ZCDKoPfiYXiaSiH+HxAPV6J79vvouxKrWg2XV6ShFtPLP+0gPdGq3x9R3+kJbmAm8w+FOdlWqAfJrLvpzMGNeDU14YGXiZ9bVzmIQbwrBA+c/F4tlK/DV07dsNExihqFoibnqDiVNTGombaU2dDup2gwKdL81ua8EIcGNExHe82kjF4zwfadHk3bQVvbfdAwxcDy4xBjs3L4raPLU3yenSzr/OEur1+jfOxnQSmEcMXKXgrAQ9U55gwjcOFKrgOxEdek/Sk1VfOjvS+nuM4eyEruFMfaZHzoQiuw4IqgGc45ohFH0UUyjYcuFxxDSU9lMCv8qdHKm+wnPRb0l9l5vXsCBDuhAGYD6ss+Ga+aDY6f/qXZuUCEUOH3QUNbbCUlviSz6+GiRnt1kA9N2Qachl+2yBfaqUqr8h7Z2gsx5LcIf5kYNsqJ0GavXTVyWh7PYiKX4bs354ZQLUwwa/cG++2+wNWP+HtBhVxMRNTdVhSm38AknZlD+PTAsWGu9GyLmhti2EnVwGybSD2Dxmhxk3IPCkhKAK+pl0eWYGZWG3tJ9mZ7SowcXLWDFAk0lRJnKGFMTggrWjV8GYpw5bq23VmIqqDLgkNzuoog==

wordpress中显示多少人浏览了文章

可以使用WP-PostViews插件

使用方法如下:

  1. Open wp-content/plugins Folder
  2. Put: Folder: wp-postviews
  3. Activate WP-PostViews Plugin
  4. Go to WP-Admin -> Settings -> PostViews to configure the plugin.

Usage

  1. Open wp-content/themes/<YOUR THEME NAME>/index.php
  2. You may place it in archive.php, single.php, post.php or page.php also.
  3. Find: <?php while (have_posts()) : the_post(); ?>
  4. Add Anywhere Below It (The Place You Want The Views To Show): <?php if(function_exists('the_views')) { the_views(); } ?>
  5. Or you can use the shortcode 243 views or 712 views (where 1 is the post ID) in a post

查看linux服务器是否安装ftp

用rpm命令来查看是否安装了FTP服务。

rpm -qa | grep ftp

rpm命令参数:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
rpm -q samba
#查询程序是否安装
rpm -ivh  /media/cdrom/RedHat/RPMS/samba-3.0.10-1.4E.i386.rpm 
#按路径安装并显示进度
rpm -ivh --relocate /=/opt/gaim gaim-1.3.0-1.fc4.i386.rpm    
#指定安装目录
rpm -ivh --test gaim-1.3.0-1.fc4.i386.rpm 
#用来检查依赖关系;并不是真正的安装;
rpm -Uvh --oldpackage gaim-1.3.0-1.fc4.i386.rpm 
#新版本降级为旧版本
rpm -qa | grep httpd      
#[搜索指定rpm包是否安装]--all搜索*httpd*
rpm -ql httpd         
#[搜索rpm包]--list所有文件安装目录
rpm -qpi Linux-1.4-6.i368.rpm 
#[查看rpm包]--query--package--install package信息
rpm -qpf Linux-1.4-6.i368.rpm 
#[查看rpm包]--file
rpm -qpR file.rpm       
#[查看包]依赖关系
rpm -ivh file.rpm  
#[安装新的rpm]--install--verbose--hash
rpm -Uvh file.rpm    
#[升级一个rpm]--upgrade
rpm -e file.rpm      
#[删除一个rpm包]--erase

linux后台运行和关闭、查看后台任务

fg、bg、jobs、&、nohup、ctrl+z、ctrl+c 命令

一、&

加在一个命令的最后,可以把这个命令放到后台执行,如

watch  -n 10 sh  test visit our website.sh  &  #每10s在后台执行一次test.sh脚本

二、ctrl + z

可以将一个正在前台执行的命令放到后台,并且处于暂停状态。

三、jobs

查看当前有多少在后台运行的命令

jobs -l选项可显示所有任务的PID,jobs的状态可以是running, stopped, Terminated。但是如果任务被终止了(kill),shell 从当前的shell环境已知的列表中删除任务的进程标识。

四、fg

将后台中的命令调至前台继续运行。如果后台中有多个命令,可以用fg %jobnumber(是命令编号,不是进程号)将选中的命令调出。

五、bg

将一个在后台暂停的命令,变成在后台继续执行。如果后台中有多个命令,可以用bg %jobnumber将选中的命令调出。

六、kill

  • 法子1:通过jobs命令查看job号(假设为num),然后执行kill %num
  • 法子2:通过ps命令查看job的进程号(PID,假设为pid),然后执行kill pid

前台进程的终止:Ctrl+c

七、nohup

如果让程序始终在后台执行,即使关闭当前的终端也执行(之前的&做不到),这时候需要nohup。该命令可以在你退出帐户/关闭终端之后继续运行相应的进程。关闭中断后,在另一个终端jobs已经无法看到后台跑得程序了,此时利用ps(进程查看命令)

ps -aux | grep "test.sh"  #a:显示所有程序 u:以用户为主的格式来显示 x:显示所有程序,不以终端机来区分