小编Tom*_*ala的帖子

jQuery更改字体系列和字体大小

我试图通过从列表中选择字体来更改出现在textarea和容器中的文本的字体系列和字体大小,字体大小应该是固定的.我也在尝试在拾取字体时更改背景颜色.

那是我的代码:

    <script type="text/javascript">     
    function changeFont(_name) {
        document.body.style.fontFamily = _name;
        document.textarea = _name;
    } 
    </script>

</head>
<body style="font-family">   
    <form id="myform">
        <input type="text" /> 
        <button>erase</button> 
        <select id="fs" onchange="changeFont(this.value);">
            <option value="arial">Arial</option>
            <option value="verdana">Verdana</option>
            <option value="impact">Impact</option>
            <option value="'ms comic sans'">MS Comic Sans</option>
        </select>
        <div align="left">
            <textarea style="resize: none;" id="mytextarea" 
                 cols="25" rows="3" readonly="readonly" wrap="on">
                Textarea
            </textarea>
            <div id='container'>
                <div id='float'>
                    <p>This is a container</p>
                </div>
    </form>
</body>
Run Code Online (Sandbox Code Playgroud)

当我在浏览器中尝试它时,字体系列不会在文本区域中更改.它只会在容器中发生变化.我现在也知道如何在选择字体系列时为容器和textarea设置新的字体大小和背景.

我将不胜感激任何帮助!

jquery fonts

28
推荐指数
2
解决办法
12万
查看次数

检查参数是文件还是目录

我试图检查参数是目录还是文件.我想在每个可执行文件之后放一个/后面的每个目录名和一个*.我知道我使用-F来获取这些信息,但我无法在我的脚本中弄清楚这一点.

这是我的代码:

    echo -n "Please enter Directory name you wish to search: "
read dir

for filename in "/home/me/Desktop/$dir"/*

do

    if (-F $filename)
    then 
    echo $filename

    fi
done
Run Code Online (Sandbox Code Playgroud)

unix linux bash shell ubuntu-12.04

7
推荐指数
1
解决办法
2万
查看次数

Snort日志文件输出格式

我一直在使用Snort作为我的学校项目.

我的问题是日志文件是二进制格式,我无法使用它们读取它们less/cat/vi.我该怎么做呢?

在此输入图像描述

我已经用我的snort.conf文件unified2格式指定了.这是我的snort.conf档案

--------------------------------------------------
#   VRT Rule Packages Snort.conf
#
#   For more information visit us at:
#     http://www.snort.org                   Snort Website
#     http://vrt-blog.snort.org/    Sourcefire VRT Blog
#
#     Mailing list Contact:      snort-sigs@lists.sourceforge.net
#     False Positive reports:    fp@sourcefire.com
#     Snort bugs:                bugs@snort.org
#
#     Compatible with Snort Versions:
#     VERSIONS : 2.9.6.2
#
#     Snort build options:
#     OPTIONS : --enable-gre --enable-mpls --enable-targetbased --enable-ppm --enable-perfprofiling --enable-zlib --enable-active-response --enable-normalizer --enable-reload --enable-react --enable-flexresp3
#
# …
Run Code Online (Sandbox Code Playgroud)

linux logging centos snort intrusion-detection

2
推荐指数
1
解决办法
4193
查看次数