V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  ps1aniuge  ›  全部回复第 26 页 / 共 26 页
回复总数  518
1 ... 17  18  19  20  21  22  23  24  25  26  
2018-08-25 17:24:54 +08:00
回复了 cainiuwow 创建的主题 问与答 我是律师,大家有什么想要咨询的法律问题嘛
问题:
家中老宅是公租房,现私人买房后,会丧失老房的公租权么?
如果家中成员全买房了。此公租房,出租人(单位或房地局),是否有权强制收回?
有什么法条,或根据各个地市的要求不同?
不支持正则,99.99%不会出错。不支持正则,我编写脚本简单。你用着也简单。

$某找替参数 = @{
找什么 =
@'
这里可以有,不成对的单引号,双引号,也无需转义。
不用转义,这点比 sed 好很多
请看,下行我放入一个单引号
'
'@
}

& /powershell/ps 找算替简易版.ps1 @某找替参数
区分大小写! 不支持正则!

脚本下载地址:
https://pan.baidu.com/s/1Ha1tX-FJ4U3NxWtaDsYEIw

openwrt 是 mips cpu 吧,不支持 mips cpu,支持 arm cpu。

和 awk sed 比,劣势是不支持正则。优势是简单。合理标准。用中文定义参数名,容易懂。win,linux 通用。
2018-08-23 17:06:38 +08:00
回复了 mt7620 创建的主题 问与答 求助, MSSQL 服务器的硬盘 RAID 选择
RAID0+1 即 raid10。
4 盘的 raid10 允许坏一块盘不丢数据。性能能好过 3 盘位 raid5。
3 盘的 raid5 允许坏一块盘不丢数据。但是有额外的 1 硬盘存备份。

结论:
4 盘 raid10 性能好,3 盘 raid5 加独立备份盘安全好。建议用后者。
2018-08-22 14:21:04 +08:00
回复了 ps1aniuge 创建的主题 PowerShell win 下用的 powershell 脚本,验证文件的数字签名是否被更改
欢迎收藏
2018-08-21 16:14:31 +08:00
回复了 jamiroquai 创建的主题 酷工作 诚心求搞 DNS 的大牛
5 为什么用 win 的 dns ?
答:
5.1 主要因为有 powershell。
我记得 bind 无法用命令添加 a 记录等,并立即生效。这样的话拍马也赶不上 powershell 了!你要搞个程序去修改 dns 区域文件,然后 reload 分区。这样性能很差吧。
powershell 命令管理 dns 是内存操作。主要用到的命令就这四个:
Add-DnsServerResourceRecordA,Add-DnsServerResourceRecordCName,Get-DnsServerResourceRecord,Remove-DnsServerResourceRecord

5.2 win 的 dns 性能无问题:我记得 bind 是多进程的程序,可以用多核跑,无性能制约。而 win2000 中说 win 的 dns 比 bind 效率高。
dns 还都是 10 年前都成熟的东西。退一万步来讲,win 的 dns 玩一千个以下的 ip 解析,不会有性能问题。

5.3 可以用 win 做主 dns 服务器,linux+bind 做缓存。win 放内网,linux 放外网,只从外网 dns 缓存取数据。


------------------------win2012r2 中,用 powershell 管理 dns 服务器的,命令列表--------------------------------
共计 100 条指令,即 100 招,下面演示如何用其中 4 招秒杀 bind 的。

PS C:\Users\admin> get-command * -module DnsServer

CommandType Name ModuleName
----------- ---- ----------
Alias Export-DnsServerTrustAnchor DnsServer
Function Add-DnsServerConditionalForwarderZone DnsServer
Function Add-DnsServerDirectoryPartition DnsServer
Function Add-DnsServerForwarder DnsServer
Function Add-DnsServerPrimaryZone DnsServer
Function Add-DnsServerResourceRecord DnsServer
Function Add-DnsServerResourceRecordA DnsServer
Function Add-DnsServerResourceRecordAAAA DnsServer
Function Add-DnsServerResourceRecordCName DnsServer
Function Add-DnsServerResourceRecordDnsKey DnsServer
Function Add-DnsServerResourceRecordDS DnsServer
Function Add-DnsServerResourceRecordMX DnsServer
Function Add-DnsServerResourceRecordPtr DnsServer
Function Add-DnsServerRootHint DnsServer
Function Add-DnsServerSecondaryZone DnsServer
Function Add-DnsServerSigningKey DnsServer
Function Add-DnsServerStubZone DnsServer
Function Add-DnsServerTrustAnchor DnsServer
Function Add-DnsServerZoneDelegation DnsServer
Function Clear-DnsServerCache DnsServer
Function Clear-DnsServerStatistics DnsServer
Function ConvertTo-DnsServerPrimaryZone DnsServer
Function ConvertTo-DnsServerSecondaryZone DnsServer
Function Disable-DnsServerSigningKeyRollover DnsServer
Function Enable-DnsServerSigningKeyRollover DnsServer
Function Export-DnsServerDnsSecPublicKey DnsServer
Function Export-DnsServerZone DnsServer
Function Get-DnsServer DnsServer
Function Get-DnsServerCache DnsServer
Function Get-DnsServerDiagnostics DnsServer
Function Get-DnsServerDirectoryPartition DnsServer
Function Get-DnsServerDnsSecZoneSetting DnsServer
Function Get-DnsServerDsSetting DnsServer
Function Get-DnsServerEDns DnsServer
Function Get-DnsServerForwarder DnsServer
Function Get-DnsServerGlobalNameZone DnsServer
Function Get-DnsServerGlobalQueryBlockList DnsServer
Function Get-DnsServerRecursion DnsServer
Function Get-DnsServerResourceRecord DnsServer
Function Get-DnsServerRootHint DnsServer
Function Get-DnsServerScavenging DnsServer
Function Get-DnsServerSetting DnsServer
Function Get-DnsServerSigningKey DnsServer
Function Get-DnsServerStatistics DnsServer
Function Get-DnsServerTrustAnchor DnsServer
Function Get-DnsServerTrustPoint DnsServer
Function Get-DnsServerZone DnsServer
Function Get-DnsServerZoneAging DnsServer
Function Get-DnsServerZoneDelegation DnsServer
powershell 传教士 原创文章 2015-11-25 改允许转载,但必须保留名字和出处,否则追究法律责任
Function Import-DnsServerResourceRecordDS DnsServer
Function Import-DnsServerRootHint DnsServer
Function Import-DnsServerTrustAnchor DnsServer
Function Invoke-DnsServerSigningKeyRollover DnsServer
Function Invoke-DnsServerZoneSign DnsServer
Function Invoke-DnsServerZoneUnsign DnsServer
Function Register-DnsServerDirectoryPartition DnsServer
Function Remove-DnsServerDirectoryPartition DnsServer
Function Remove-DnsServerForwarder DnsServer
Function Remove-DnsServerResourceRecord DnsServer
Function Remove-DnsServerRootHint DnsServer
Function Remove-DnsServerSigningKey DnsServer
Function Remove-DnsServerTrustAnchor DnsServer
Function Remove-DnsServerZone DnsServer
Function Remove-DnsServerZoneDelegation DnsServer
Function Reset-DnsServerZoneKeyMasterRole DnsServer
Function Restore-DnsServerPrimaryZone DnsServer
Function Restore-DnsServerSecondaryZone DnsServer
Function Resume-DnsServerZone DnsServer
Function Set-DnsServer DnsServer
Function Set-DnsServerCache DnsServer
Function Set-DnsServerConditionalForwarderZone DnsServer
Function Set-DnsServerDiagnostics DnsServer
Function Set-DnsServerDnsSecZoneSetting DnsServer
Function Set-DnsServerDsSetting DnsServer
Function Set-DnsServerEDns DnsServer
Function Set-DnsServerForwarder DnsServer
Function Set-DnsServerGlobalNameZone DnsServer
Function Set-DnsServerGlobalQueryBlockList DnsServer
Function Set-DnsServerPrimaryZone DnsServer
Function Set-DnsServerRecursion DnsServer
Function Set-DnsServerResourceRecord DnsServer
Function Set-DnsServerResourceRecordAging DnsServer
Function Set-DnsServerRootHint DnsServer
Function Set-DnsServerScavenging DnsServer
Function Set-DnsServerSecondaryZone DnsServer
Function Set-DnsServerSetting DnsServer
Function Set-DnsServerSigningKey DnsServer
Function Set-DnsServerStubZone DnsServer
Function Set-DnsServerZoneAging DnsServer
Function Set-DnsServerZoneDelegation DnsServer
Function Show-DnsServerCache DnsServer
Function Show-DnsServerKeyStorageProvider DnsServer
Function Start-DnsServerScavenging DnsServer
Function Start-DnsServerZoneTransfer DnsServer
Function Step-DnsServerSigningKeyRollover DnsServer
Function Suspend-DnsServerZone DnsServer
Function Sync-DnsServerZone DnsServer
Function Test-DnsServer DnsServer
Function Test-DnsServerDnsSecZoneSetting DnsServer
Function Unregister-DnsServerDirectoryPartition DnsServer
Function Update-DnsServerTrustPoint DnsServer

手册在:
https://technet.microsoft.com/library/jj649850(v=wps.630).aspx
2018-08-21 14:45:58 +08:00
回复了 tmkook 创建的主题 问与答 爱上租因为水阀漏水渗到楼下居然要租客赔偿?
1 租客有义务管理防水,防火等。
2 你必须能证明物业拖了一周,并落实到纸上。最好把这张纸公证了。
否则,你全责。几乎你得全赔。
2018-08-20 16:13:16 +08:00
回复了 z0z 创建的主题 Linux 请问在 windows 下复制 Linux 下符号链接的正确姿势
我记得 powershell 6 最新版,复制时,是默认不展开符号连接的。
2018-08-17 00:19:34 +08:00
回复了 herozzm 创建的主题 问与答 DRBD 做的双机热备,结果其中一台的 raid 坏了
1 别研究谁对谁错了。
2 数据重要,只要数据不丢。别说停产 1 天。停产 2 天也得给!
3 赶紧停机备份。如果有备用的机子,用备用机子顶上。不会 1 天停产。
4 修好了 drbd,再弄回来。回时可能停产少许时间。
这是公司强制卖电脑。强制的合同,你不遵守不就完了么?

离职还要你背着一台几年前的电脑走,你是帮公司处理废旧电脑的吗?

个人建议把电脑交给公司,拿回押金。
并去劳动仲裁,起诉公司,“公司强扣工资,强制把电脑折旧费,让员工出。”
=========================
二手市场上,任何型号笔记本都有,几成新旧都有。你可以自选,还可以加内存,换配件,还有保修。

=====================
公司合理合法的做法是,从你入职日起,至你离职日,公司业务电脑的折旧费,应该算在公司身上。
从你离职第 2 日起,公司让你帮忙消化旧电脑。至少得比二手电脑市场行情便宜 20%吧。否则,让公司自己把旧电脑,卖给 2 手商贩即可。

你可以把我说的这最后一条,跟你经理和 hr 明说。你看他们怎么回答。
大家好,我来参与讨论了。时间倒退到 n 年前。

php vs asp.net ,大家的论调是:
php=慢。但生态圈好,库框架多,用起来简单。
asp.net=快。库,框架少。学用起来复杂。linux 上无法使用

现在呢。
asp.net 解决了跨平台问题。裤框架,就那套标准的。net core。

为啥快的 asp.net 无法打败 php,
却被谷狗咬的要完,的论调都冒出来了呢?
go 的库框架,生态圈,比 php 生态圈好了?比 php 库框架多了?

我真的不懂,谁能帮忙解惑?谈谈。
2018-08-14 22:40:39 +08:00
回复了 codechaser 创建的主题 Python 对 Python 的模块不能进行`.`导入吗?
powershell 就是好。
import matplotlib
matplotlib.animation
反人类。
==================
在 ps 中,第一句没必要。
在 ps 中,第二句也可以省略点前面的部分。
因为 ps 的方法,命令,函数都是不重名的。导入的时候,必须 显式! 允许重名。
当然了,你这么做之后,点前面的内容 就需要了。
==================
这就好像,领导直接含张三。就是叫自己部门张三。
如果有两个张三,就喊 销售部.张三。一个道理。
==================
我说的大家能听懂么? ps 这里就是好。
2018-08-12 20:55:36 +08:00
回复了 tomheng 创建的主题 程序员 word 转 text 的有比较完美的方案吗
安装 word。用 powershell 调用 com 方式另存为 txt,效果最好
2018-08-09 19:47:06 +08:00
回复了 cjw1115 创建的主题 问与答 合租室友这种行为我该怎么处理呀
哈哈哈,女人事真多,一台好戏~~~
2018-08-08 22:44:08 +08:00
回复了 aruisi 创建的主题 Linux iptables 限制 ping 速率无效
对,icmp 没开发限制功能。
2018-08-06 16:37:21 +08:00
回复了 orm 创建的主题 Linux 大家平常使用的是那种 shell?
问:linux 中你用什么 shell ?
答:
我的默认 shell 是 bash。占 5%的使用率。简单敲个命令啥的。95%用 linux 版的 powershell。
写脚本也是在 ps1 中,用不多的 bash 语句。请看下面这个技巧。

问:如何在.ps1 脚本中,嵌入 shell 命令?
答:
永远不要用 bash 和.sh ,里面坑太多。只需要在 linux 版 powershell 的.ps1 脚本中,用 bash 执行字符串即可。
=====================
$bashcmd =
@'
echo '我是 bash 命令'
echo '命令中可以有单引号'
echo "命令中可以有双引号"
echo '如需解析变量,则用这种括号,注意头尾必须换行'
echo '@\"'
echo '$a'
echo '\"@'
'@
/usr/bin/bash -c $bashcmd
#需要转义,有点不好
=====================

@'
echo '我是 bash 命令'
echo '命令中可以有单引号'
echo "命令中可以有双引号"
echo '如需解析变量,则用这种括号,注意头尾必须换行'
echo '@"'
echo '$a'
echo '"@'
'@ | /usr/bin/bash
#不需要转义,推荐
=====================


问:你这是在 shell 外面,在套一层 powershell。或者说用 ps 调用 bash ?
答:
对。


问:bash 有什么坑?说不出来扁你!
答:
2+3 难倒 bash。
多写了一个空格,bash 脚本不工作。
不支持 crlf 回车格式的文本。
grep 不支持指定文本编码。
从字符串内抠内容太麻烦等。


问:去哪学 linux 版的 powershell ?
答:
QQ 群号=183173532
名称=powershell 交流群
可以收取少许费用,群内远程帮你公司代培训员工。

问:bash 在你眼里什么级别?
答:
淘汰级别。简单功能都有,但强的功能强不上去,还比较麻烦,难学。
建议使用 python,powershell

问:python 有什么问题?
答:
python 人又太贵,运维的工资只能招到 py 低手。
powershell 本身是 shell,命令行,管道,环境变量,子 shell,比 py 方便。
powershell 简单易学、功能强。是 linux 运维的屠龙刀。
一个进程不行,就多个进程。多个进程不行就 n 机子分布。
这里面要有一个队列,分发任务或表 id。根据实际情况,一次分发一百,一千,一万。
2018-08-06 14:34:27 +08:00
回复了 lindongwu11 创建的主题 分享创造 在做一个命令行转 GUI 的工具,请大家提点意见
赶脚不错。
1 ... 17  18  19  20  21  22  23  24  25  26  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3312 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 35ms · UTC 14:04 · PVG 22:04 · LAX 07:04 · JFK 10:04
Developed with CodeLauncher
♥ Do have faith in what you're doing.