ps -eaf
..
Run Code Online (Sandbox Code Playgroud)kude 22593 12078 0 09:06 ? 00:00:02 smbd -D hasi 22929 12078 0 09:12 ? 00:00:00 someprog.pl root 22950 43 0 Sep08 ? 00:00:19 [nfsiod] root 24558 43 0 Sep09 ? 00:00:28 [pdflush] root 25320 1 0 00:00 ? 00:00:01 /usr/bin/atop -a -w /var/log/atop/atop_20110916 600 1466 25757 12078 0 10:12 ? 00:00:00 smbd -D root 26752 12078 0 10:32 ? 00:00:01 smbd -D
..
id username2
uid = 1466(username2)gid = 513(DomainUsers)groups = 513(DomainUsers)
LDAP中的所有用户(/etc/nsswitch.conf都是正确的,一切都正确 - 但只有这个用户不显示)
为什么显示uid号码(1466)而不是用户名?
我有标准的syslog_rules.xml(OSSEC 2.6.0).这是/var/log/messages
文件中坏词的标准规则:
<var name="BAD_WORDS">core_dumped|failure|error|attack|bad |illegal |denied|refused|unauthorized|fatal|failed|Segmentation Fault|Corrupted</var>
.....
<rule id="1002" level="2">
<match>$BAD_WORDS</match>
<options>alert_by_email</options>
<description>Unknown problem somewhere in the system.</description>
</rule>
.....
Run Code Online (Sandbox Code Playgroud)
如何添加或修改使用$BAD_WORDS
但不包括该auxpropfunc error
短语的规则?就是这样的:
<match>$BAD_WORDS</match>
<match>!auxpropfunc error</match>
<options>alert_by_email</options>
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
任何人都帮我在Perl中创建一个虚拟文件系统.非常简单,2深度级别,如
/subdir
subdir-l2
file2.txt
/file1.txt
Run Code Online (Sandbox Code Playgroud)
我尝试使用Fuse.pm,但不了解如何创建subdir级别.我创建%files hash,如果转到subdir,则使用新记录重新创建它.它仅供测试.
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Fuse;
use POSIX qw(ENOENT EISDIR EINVAL);
my (%files) = (
'.' => {
type => 0040,
mode => 0755,
ctime => 1490603721
},
subdir => {
type => 0040,
mode => 0755,
ctime => 1490603721
},
"file1.txt" => {
type => 0100,
mode => 0755,
ctime => 1490603721
}
);
sub filename_fixup {
my ($file) = shift;
$file =~ s,^/,,;
$file = '.' unless …
Run Code Online (Sandbox Code Playgroud) 我有黑白图像(见下文).如何计算白色和黑色像素(例如30%黑色和70%白色,或123456黑色像素和39393白色像素)?
ps我在linux上工作,我必须使用什么?ImageMagick的?我更喜欢命令行界面程序.
我有几个EMF(增强的Windows图元文件)文件.如何在Linux(CentOS 5.x)上将它们转换为ps/pdf/tiff?命令行界面是首选.
什么是XMPP/Jabber的基于Web的客户端.我需要在浏览器中运行IM客户端(Windows/Linux FF2-8,Opera 10 +,IE 6(?) - 8).
我发现只有一个SparkWeb - http://www.igniterealtime.org/projects/sparkweb/index.jsp
这是唯一的吗?
一开始,我使用python 2天,有更多的问题。以下来自他们。
我有一个列表(3297 项),我想从 end where value != 'nan' 找到第一项的索引
示例:(索引,值)
[0] 378.966
[1] 378.967
[2] 378.966
[3] 378.967
....
....
[3295] 777.436
[3296] nan
[3297] nan
Run Code Online (Sandbox Code Playgroud)
如果想要找到带有索引的项目 - 3295
我的代码(从头到尾,一步一步)
i = len(lasarr); #3297
while (i >= 0):
if not math.isnan(lasarr[i]):
method_end=i # i found !
break # than exit from loop
i=i-1 # next iteration
Run Code Online (Sandbox Code Playgroud)
运行并得到错误
Run Code Online (Sandbox Code Playgroud)Traceback (most recent call last): File "./demo.py", line 37, in <module> if not math.isnan(lasarr[i]): IndexError: index out of bounds
我做错了什么?
我想得到1个像素(x=3, y=3)
和(来自R改变其RGB值100
到101
,G从99
到100
,B从193
至194
).
use strict;
use Image::Magick;
my $p = new Image::Magick;
$p->Read( 'myfile.jpg' );
my $pix = $p->GetPixel(
width => 1,
height => 1,
x => 3,
y => 3,
map => 'RGB',
normalize => 0
);
# in $pix RGB value now?
Run Code Online (Sandbox Code Playgroud)
如何1
为所有RGB组件添加?
我可以将十进制RGB分成3个值(r,g,b)并单独递增,然后将三个R,G,B值合并为一个RGB吗?:) 我怎么做?
$pix = .... something code here...
# make changes
$p->SetPixel(
x => 3,
y => 3,
channel => …
Run Code Online (Sandbox Code Playgroud) 我试图制作一个模拟nc(netcat)工具.打开文件并将其发送到TCP套接字.
客户(发件人)方
procedure TForm1.SpeedButton3Click(Sender: TObject);
var Client:TTCPBlockSocket;
FS: TFileStream;
begin
Client:=TTCPBlockSocket.Create;
Client.RaiseExcept:=True;
Client.Connect('192.168.1.95','9999');
FS:=TFileStream.Create('/tmp/test_print.pdf',fmOpenRead);
FS.Position:=0;
Client.SendStream(FS);
FS.Free;
Client.CloseSocket;
Client.Free;
end;
Run Code Online (Sandbox Code Playgroud)
服务器(接收方)方面
nc -l 192.168.1.95 9999> test.pdf
运行后我得到test.pdf但md5sum无效
fe2e5d86acd267ca39a9c15c456e1be0 /tmp/test_print.pdf
34d755aa81d72f525a5e691e98bed283 test.pdf
Run Code Online (Sandbox Code Playgroud)
尺寸也不同
-rw-rw---- 1 user1 DomainUsers 46444 ??? 8 17:11 /tmp/test_print.pdf
-rw-r--r-- 1 user1 DomainUsers 46448 ??? 11 15:40 test.pdf
Run Code Online (Sandbox Code Playgroud)
我做错了什么?我的错误在哪里?
ps test.pdf开头超出4个字节(6c,b5,00,00)
Run Code Online (Sandbox Code Playgroud)[user1@pandora6 /tmp]$ hexdump -C test.pdf | head -5 00000000 6c b5 00 00 25 50 44 46 2d 31 2e 34 0a 25 c7 …
我正在尝试adduser
从perl 启动命令.
use strict;
use warnings;
my @test=('/usr/sbin/useradd',
"-c 'Fred'",
'-d /vol2/home/DMZ/f.kals',
'-g 3335','-u 11002',
"-k '/dev/null'",
'-m',
'-p "$1$kKNKMa8O$g03oj6YeeZbO2i3NMSoyT1"',
'fred');
system (@test);
Run Code Online (Sandbox Code Playgroud)
当我执行上面的操作时,我得到以下输出:
[ay@pandora /vol2]$ sudo ./test.pl
useradd: invalid home directory ' /vol2/home/DMZ/fred'
Run Code Online (Sandbox Code Playgroud)
为什么?
如果我不使用数组
my $command="/foor/bar/useradd -m -g 1234 -u 6789 -param2 -param3 username"
system ($command);
Run Code Online (Sandbox Code Playgroud)
那工作正常..为什么不是阵列?
linux ×6
perl ×3
imagemagick ×2
algorithm ×1
client-side ×1
delphi ×1
freepascal ×1
fuse ×1
graphic ×1
graphics ×1
image ×1
lazarus ×1
netcat ×1
perl-module ×1
python ×1
security ×1
uid ×1
web ×1
while-loop ×1
xmpp ×1