海运的博客

PHP imap访问多收件箱

发布时间:May 20, 2014 // 分类:PHP // No Comments

列出所有目录:

$host = '{imap.mail.yahoo.com:993/ssl}';
$user = 'user@yahoo.com';
$pass = 'password';
$inbox = imap_open($host, $user, $pass);
$mailboxes = imap_list($inbox, $host, '*');
$mailboxes = str_replace($host, '', $mailboxes);
print_r($mailboxes);

结果:

Array
(
    [0] => Bulk Mail
    [1] => Draft
    [2] => Inbox
    [3] => Sent
    [4] => Trash
)

重新打开指定的目录:

imap_reopen($inbox, $host.'Bulk Mail');
$emails = imap_search($inbox,'ALL');
print_r($emails);

火狐插件状态栏显示

发布时间:May 19, 2014 // 分类:Firefox // No Comments

<toolbarpalette id="BrowserToolbarPalette">
    <toolbarbutton id="jscrptCommand-toggle-button"/>
</toolbarpalette>

<toolbarbutton id="jscrptCommand-toggle-button"
    tooltiptext="Toggle Javascript Command"
    oncommand="executejs.EJS_openCommandWin();" class="toolbarbutton-1" >
    <label value="J C"/>
</toolbarbutton>

Salt分组操作

发布时间:May 18, 2014 // 分类:Puppet // No Comments

执行命令时直接分组:

#匹配slave id前缀为vps的所有slave
salt -C 'vps*' test.ping

配置文件分组:

nodegroups:
  vps: 'vps*'

执行:

salt -N vps test.ping

更多匹配操作:
http://docs.saltstack.com/en/latest/topics/targeting/compound.html

Bind View转发到PDNS

发布时间:May 17, 2014 // 分类:DNS // No Comments

options {
    listen-on port 53 { any; };
    directory       "/var/named";
};

logging {
    channel default_debug {
        file "data/named.run";
        print-time        yes;
        severity dynamic;
    };
    channel query_log {
        file "data/query.log" versions 3 size 20m;
        severity  info;
        print-time        yes;
        print-category  yes;
    };
    category queries {
        query_log;
    };
};

acl clients{
    192.168.1.0/24; 
};

view localhost {
    match-clients    { localhost; };
    allow-query      { localhost; };
    allow-query-cache { localhost; };
    recursion yes;  

};

view clients {
    match-clients    { clients; };
    allow-query      { clients; };
    allow-query-cache { clients; };

    zone "." {
        type forward;
        forwarders { 127.0.0.1 port 54;};
        forward only;
    };
};

view  external
{
    match-clients   { any; };
    allow-query     { any; };
    allow-query-cache { any; };
    recursion no; 
    allow-transfer  { none; }; 

    zone "." {
        type master;
        file "root.zone";
    };
};

Windows CMD宽带连接

发布时间:May 17, 2014 // 分类:Windows // No Comments

拨号:

rasdial 宽带连接 user password

断开:

rasdial 宽带连接 /DISCONNECT
分类
最新文章
最近回复
  • jiangker: good, very helpful to me
  • fengfeng: N1 armbian 能有编译下内核吗。。我要开启can 不懂怎么操作
  • 1: 方法一ngtcp2要改下:./configure PKG_CONFIG_PATH=/usr/l...
  • 海运: 关闭服务器
  • 海风: override.battery.charge.low以及override.battery.r...
  • koldjf: 不能过滤
  • 杰迪武士: 此文甚好甚强巨,依照此文在树莓派2 + Rasbian上部署成功 感谢博主美文共赏
  • 海运: ups不知有没选项可设置此参数,不过你可以在另外一台电脑上安装nut客户端自动关机。
  • kgami: 想请教一下,设置了的电脑自动关机之后,几秒后UPS怎么也跟着关机了,导致另外一台电脑没关机就断...
  • 海运: 写的很详细了啊,/etc/nut/hosts.conf用以nut-cgi连接nut服务器参数,...