滑铁卢战争是好是坏?(《悲惨世界》第十七章经典段落摘抄)

如果站在更高的层面看待滑铁卢战争,滑铁卢是一场反对君主制的胜利。它是欧洲对抗法国的胜利,是圣彼得堡、柏林、维也纳对抗巴黎的胜利。他是 1889 年 7 月 14 日,攻击了 1815 年的 3 月 20 日。过去一直是君主制度在不停地清理不屈不饶的 “法国自由革命稍乱”,就如同不知疲倦的水手永不停息地清理甲板,而如今波旁王朝以及其他君主制势力联合起来,推翻了这位叱咤风云了二十六年的伟大人物——拿破仑,拿破仑帝国是专制的,但由于现实的状况,现在皇帝将被迫选择让国家自由,帝国的宪法秩序不情愿地接受了滑铁卢的结果。

(此段落翻译自一个版权已过期的 《悲惨世界》 版本,由站主根据自己的理解进行的翻译,如果喜欢这本书,建议阅读李丹和方于翻译的版本)

[工具] Shell 批量实现其他多台电脑可以免密码 SSH 本电脑

介绍

基本信息

作者:朱明宇
名称:批量实现其他多台电脑可以免密码 SSH 本电脑
作用:批量将其他多台电脑的公钥拷贝给本电脑

使用方法

1. 在此脚本的分割线内写入相应的内容
2. 给此脚本添加执行权限
3. 执行此脚本

脚本分割线里的变量

1. nm=192.168.4.0 #网段,网段必须为 C 类网段,请保证格式和前 3 个网络位一定正确
2. sip=51 #起始 ip,起始 IP 地址,IP 地址 的范围是 0-255
3. lip=51 #结束 ip ,结束 IP 地址,IP 地址 的范围是 0-255
4. pd=123456 #其他服务器的 root 远程登录密码
5. lpd=Taren1 #本机的 root 远程登录密码
6. lh=192.168.4.254 #本机 IP 地址

注意

1. 此脚本执行前必须要先保证执行本脚本的用户能无密码 ssh 远程这些远程服务器
2. 必须以 root 用户执行本脚本

脚本

#!/bin/bash

####################### Separator ########################

nm=192.168.4.0 #Network segment. The network segment must be a class C network segment. Please ensure that the format and the first three network bits are correct
sip=51 #Starting IP, starting IP address. The range of IP address is 0-255
lip=51 #End IP, end IP address. The range of IP address is 0-255
pd=123456 #Root remote login password of other servers
lpd=Taren1 #Root remote login password of this machine
lh=192.168.4.254 #Native IP address

####################### Separator ########################

fnm=${nm%.*}

set timeout 3
rpm -q expect

if [ $? -ne 0 ];then
        yum -y install expect &> /dev/null
fi

for i in `seq $sip $lip`
do
        expect << EOF
        spawn ssh root@$fnm.$i
        expect "(yes/no)?"                               {send "yes\r" } 
        expect "password:"                               {send "$pd\r" } 
        expect "#"                                       {send "ssh-keygen\r"}
        expect "(/root/.ssh/id_rsa):"                    {send "\r"}
        expect "(empty for no passphrase):"              {send "\r"}
        expect "passphrase again:"                       {send "\r"}
        expect "#"                                       {send "\r"}
        EOF

expect << EOF
spawn ssh root@$fnm.$i
expect "password:"                               {send "$pd\r" } 
expect "#"                                       {send "ssh-keygen\r"}
expect "(/root/.ssh/id_rsa):"                    {send "\r"}
expect "(empty for no passphrase):"              {send "\r"}
expect "passphrase again:"                       {send "\r"}
expect "#"                                       {send "\r"}
EOF

expect << EOF
spawn ssh root@$fnm.$i
expect "(yes/no)?"                               {send "yes\r" } 
expect "#"                                       {send "ssh-keygen\r"}
expect "(/root/.ssh/id_rsa):"                    {send "\r"}
expect "(empty for no passphrase):"              {send "\r"}
expect "passphrase again:"                       {send "\r"}
expect "#"                                       {send "\r"}
EOF

expect << EOF
spawn ssh root@$fnm.$i
expect "#"                                       {send "ssh-keygen\r"}
expect "(/root/.ssh/id_rsa):"                    {send "\r"}
expect "(empty for no passphrase):"              {send "\r"}
expect "passphrase again:"                       {send "\r"}
expect "#"                                       {send "\r"}
EOF

expect << EOF
spawn ssh root@$fnm.$i
expect "password:"                      { send "$pd\r" } 
expect "#"                              { send "ssh-copy-id -i ~/.ssh/id_rsa.pub root@$lh\r" }
expect "(yes/no)?"                      { send "yes\r" } 
expect "root@$lh's password:"           { send "$lpd\r" }
expect "#"                              { send "exit\r" }
EOF

expect << EOF
spawn ssh root@$fnm.$i
expect "password:"                      { send "$pd\r" } 
expect "#"                              { send "ssh-copy-id -i ~/.ssh/id_rsa.pub root@$lh\r" }
expect "root@$lh's password:"           { send "$lpd\r" }
expect "#"                              { send "exit\r" }
EOF

expect << EOF
spawn ssh root@$fnm.$i
expect "#"                              { send "ssh-copy-id -i ~/.ssh/id_rsa.pub root@$lh\r" }
expect "(yes/no)?"                      { send "yes\r" } 
expect "root@$lh's password:"           { send "$lpd\r" }
expect "#"                              { send "exit\r" }
EOF

expect << EOF
spawn ssh root@$fnm.$i
expect "#"                              { send "ssh-copy-id -i ~/.ssh/id_rsa.pub root@$lh\r" }
expect "root@$lh's password:"           { send "$lpd\r" }
expect "#"                              { send "exit\r" }
EOF

echo "$fnm.$i has been finished"

done

开源简介

开源对于人们而言,意味着免费使用,可随意进行二次开发,但是二次开发的内容、代码也属于开源项目的一部分必须无偿公开,且开源项目里的所有东西都不能当作商品进行买卖。而开源项目本身就像是一个爱好者们的盛会,全世界的所有爱好者和从业者们,利用业余时间或者在工作中为同一个项目添砖加瓦,发展到后来,也有人以公司的形式参与其中或者直接以公司的形式经营开源项目。

兴趣才是最好的老师, 所以在开源的领域总是充满了活力和创造力。从 Linux 和 Windows、Mariadb 和 Oracle 等开源和闭源软件的比较中,我们都能看到开源的力量。Windows 在服务区领域的市场份额不断被 Linux 压缩,Mariadb 的快速提升,阿里巴巴的去 Oracle 运动都在提醒 IT 的从业人员们,最好跟着开源走,不要让自己的职业生涯被某一家公司绑定得太死,可能诺基亚放弃 Meego 只会让自己的财务报表不好看,但是对于相关软件的开发者而言,这就以为着很多努力和光阴都要从头再来……

永恒中心会为访问者带来很多开源软件的信息和使用方法,不管你是相关行业的从业人员,还是相关方面的爱好者,你都可以关注永恒中心。