AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-209503

mzhaase's questions

Martin Hope
mzhaase
Asked: 2018-08-17 02:15:57 +0800 CST

SCP 更改文本文件内容

  • 6

我正在尝试从机器 A 复制文件:

apt policy openssh-client
openssh-client:
  Installiert:           1:7.2p2-4ubuntu2.4

到机器 B:

apt-cache policy openssh-client
openssh-client:
    Installiert: 1:5.5p1-6+squeeze5

在 A 上:

scp myfile <server>:/myfile
md5sum myfile
2ba67c5e816350d4d2e2e7fd883037e7
file myfile
myfile: Python script, ASCII text executable

在 B 上:

md5sum myfile
8883620c2a0878da1db273101b55124d
file myfile
myfile: ASCII Java program text

查看文本文件,似乎每一行都比最后一行多一个空格,所以不是:

import argparse, os, sys

from subprocess import check_output

def count_voicemails(dir):
    # find is faster than ls, since it does not check attributes
    command = 'find {}/INBOX -maxdepth 1 | wc -l'
    count   = int(check_output(command.split()))
    return count

它看起来像这样:

import argparse, os, sys

from subprocess import check_output

 def count_voicemails(dir):
       # find is faster than ls, since it does not check attributes
           command = 'find {}/INBOX -maxdepth 1 | wc -l'
               count   = int(check_output(command.split()))
                   return count
ssh
  • 1 个回答
  • 1184 Views
Martin Hope
mzhaase
Asked: 2016-11-16 02:07:27 +0800 CST

将 Windows Server 2008 共享权限迁移到 Synology NAS

  • 0

客户有一台 Synology RS815+,使用 DSM 6.0.2-8451 Update 3。它有一个 btrfs 卷。我们想要迁移现有的 CIFS 共享,包括时间戳和权限。时间戳没问题,但权限不会复制过来。重现步骤:

  1. 域加入 NAS
  2. 创建共享
  3. 授予域用户“自定义”权限,包括“更改权限”权限。
  4. 使用带有“复制 NTFS 权限”选项的 robocopy /COPYALL / TotalCmd / 激活“ACL”的 fastcopy 来复制文件
  5. 未复制权限。
windows-server-2008 access-control-list file-permissions synology
  • 1 个回答
  • 1080 Views
Martin Hope
mzhaase
Asked: 2016-09-24 05:33:02 +0800 CST

清除 IBM IMM 2 中的活动错误事件

  • 3

不久前,服务器崩溃了。问题已修复,但 IMM2 仍然在“活动事件”下显示错误。这意味着系统状态在我们的监控解决方案中始终处于“警告”状态。我们清除了事件日志,但错误事件仍显示在“活动事件”下,尽管事件日志现在为空。IMM2 用户指南没有提到这一点,我们尝试使用该clearlog命令,但这只是清除事件日志的 CLI 方式,并没有清除“活动事件”。

monitoring ibm imm2
  • 1 个回答
  • 3672 Views
Martin Hope
mzhaase
Asked: 2015-12-02 07:45:44 +0800 CST

puppet 无法评估:无法从环境中检索信息

  • 1

puppet 可以在节点上执行,但不能从模块传输文件。

Ubuntu 14.04 服务器 Puppet 3.8.4

已经尝试过:

  • 使文件世界可读
  • 禁用固件
  • 在模块目录中创建facter.d

在主人:

/etc/puppet/puppet.conf

[main]
logdir=/var/log/puppet
vardir=/var/lib/puppet
ssldir=/var/lib/puppet/ssl
rundir=/var/run/puppet
modulepath = /etc/puppet/modules
factpath=$vardir/lib/facter

/etc/puppet/manifests/site.pp

node 'gitlab.domain' {
    include ssh
}

/etc/puppet/modules/ssh/manifests/init.pp

class ssh {
  exec { 'apt-update':
    command => 'apt-get update',
    path    => ['/usr/bin', '/bin', '/sbin'],
    logoutput => on_failure,
  }

  # ensure openssh installed
  package { 'openssh-server':
    ensure  => installed,
    require => Exec['apt-update'],
  }

  # make sure ssh keeps running
  service { 'ssh':
    ensure  => 'running',
    enable  => true,
    require => Package['openssh-server'],
  }


  # copy sshd_config
  file { '/etc/ssh/sshd_config':
    ensure  => 'present',
    notify  => Service['ssh'],
    source  => 'puppet:///modules/ssh/config/sshd_config',
    owner   => 'root',
    group   => 'root',
    mode    => '0600',
    require => Package['openssh-server'],
  }
}

在主人:

ls -la /etc/puppet/modules/ssh/config
-rw-r--r-- 1 puppet root 356 Nov 27 11:43 sshd_config

在节点上:

sudo puppet agent -t -v
[....]
Info: Applying configuration version ...
Notice: /Stage[main]/Ssh/Exec[apt-update]/returns: executed successfully
Error: /Stage[main]/Ssh/File[/etc/ssh/sshd_config]: Could not evaluate: Could not retrieve information from environment production source(s) puppet:///modules/ssh/config/sshd_config 
puppet
  • 1 个回答
  • 8978 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve