步骤
1. Client端生成密钥:ssh-keygen -t rsa
2. 在Client端传送公钥到Server: ssh-copy-id -i
(更多…)
1. Client端生成密钥:ssh-keygen -t rsa
2. 在Client端传送公钥到Server: ssh-copy-id -i
(更多…)
Stockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformation amongst the stockbrokers to give your employer the tactical edge in the stock market. For maximum effect, you have to spread the rumours in the fastest possible way.
Unfortunately for you, stockbrokers only trust information coming from their “Trusted sources” This means you have to take into account the structure of their contacts when starting a rumour. It takes a certain amount of time for a specific stockbroker to pass the rumour on to each of his colleagues. Your task will be to write a program that tells you which stockbroker to choose as your starting point for the rumour, as well as the time it will take for the rumour to spread throughout the stockbroker community. This duration is measured as the time needed for the last person to receive the information.
Your program will input data for different sets of stockbrokers. Each set starts with a line with the number of stockbrokers. Following this is a line for each stockbroker which contains the number of people who they have contact with, who these people are, and the time taken for them to pass the message to each person. The format of each stockbroker line is as follows: The line starts with the number of contacts (n), followed by n pairs of integers, one pair for each contact. Each pair lists first a number referring to the contact (e.g. a ‘1’ means person number one in the set), followed by the time in minutes taken to pass a message to that person. There are no special punctuation symbols or spacing rules.
Each person is numbered 1 through to the number of stockbrokers. The time taken to pass the message on will be between 1 and 10 minutes (inclusive), and the number of contacts will range between 0 and one less than the number of stockbrokers. The number of stockbrokers will range from 1 to 100. The input is terminated by a set of stockbrokers containing 0 (zero) people.
(更多…)
1. 鸟哥Linux私房菜-NIS http://linux.vbird.org/linux_server/0430nis.php
2. The Linux NIS(YP)/NYS/NIS+ HOWTO http://www.tldp.org/HOWTO/NIS-HOWTO/ypserv.html
1. Server1, Server2 系统都是RHEL6.5;
2. Server1 IP为 192.168.122.108;
3. Server2 IP为 192.168.122.50;
1. 以Server1 作为 NIS Server, Server2 作为Client.
2. 在Server2上尝试用NIS Server提供的用户信息登录;
3. 配置NFS家目录;
1. 安装所需软件包
[root@server1 ~]# yum install yp-tools ypbind ypserv rpcbind
2. 配置Server所属的域和主机名,Server 和 Client要在同一个域里呀。
修改/etc/sysconfig/network
HOSTNAME=server1.nis.example.com NISDOMAIN=nis.example.com YPSERV_ARGS="-p 1011"
修改/etc/hosts
192.168.122.108 server1.nis.example.com
1. 鸟哥的Linux私房菜-NFS http://linux.vbird.org/linux_server/0330nfs.php
2. Linux NFS-HOWTO http://www.tldp.org/HOWTO/NFS-HOWTO/index.html
3. RFC 1094 https://tools.ietf.org/html/rfc1094
4. Redhat NFS https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/ch-nfs.html
1. Server1, Server2 系统均为RHEL6.5;
2. Server1 IP 192.168.122.108;
3. Server2 IP 192.168.122.50;
1. 以Server1 作为NFS Server,共享/nfs_pub;用户的udi和gid都使用555.
2. Server2 设置成 NFS Client, 用autofs挂载192.168.122.108:/nfs_pub 到 /nfs/nfs_pub
(更多…)
RHEL7的救援模式,相当于RHEL6的单用户模式。
要在不知道root密码的前提下修改root密码,进入救援模式最靠谱。
How To Reset Your Forgotten Root Password On CentOS 7 Servers
1. 进入Grub后修改启动选项。(按e可以编辑)
2. 在linux那一栏,加上
init=/sysroot/bin/sh
3. 删除
rhgb quiet
Postfix 可用作Mail Server, 它配置起来要比Sendmail简单得多。
1. 鸟哥Mail server http://linux.vbird.org/linux_server/0380mail.php
2. Postfix官方文档 http://www.postfix.org/documentation.html
3. 鸟哥DNS server http://linux.vbird.org/linux_server/0350dns.php
3台虚拟机,操作系统为CentOS 6.5;
Host1的IP是192.168.56.101, Host2的IP是192.168.56.102,Host2的IP是192.168.56.103;
1. Host1与Host2互相收发邮件;
2. 用Telnet发邮件;
3. 邮件Relay;
4. Virtual Alias Domain;
5. Virtual Mailbox Domain;
6. SASL认证;
7. Dovecot.
FTP是最经典的网络服务(之一),就是用来传文件啦。
暑假的时候一同学在Win7上折腾了半天FTP没搞成(估计是防火墙?),而在Linux上整个FTP Server是件很轻松的事情。
推荐使用vsftpd作为FTP server,因为它Very Secure,关键是简单易用。
1. 鸟哥Linux私房菜-FTP http://linux.vbird.org/linux_server/0410vsftpd.php
2. vsftpd文档 https://security.appspot.com/vsftpd/vsftpd_conf.html
3. Redhat Document FTP and SELinux https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Managing_Confined_Services/chap-Managing_Confined_Services-File_Transfer_Protocol.html
1. Server和Client操作系统均为RHEL6.5;
2. Server机的IP地址是192.168.122.30;
3. Client机的IP地址是192.168.122.92;
在Server端,安装vsftpd.
[root@localhost ~]# yum install vsftpd
在Client端,安装ftp.(还有很多ftp client可以选择~)
[root@main ~]# yum install ftp
1.鸟哥的Linux私房菜-DNS Server: http://linux.vbird.org/linux_server/0350dns.php
2.BIND-Documentation: https://kb.isc.org/article/AA-01031
3.RFC 1035 http://tools.ietf.org/html/rfc1035
4.RFC 1034 http://tools.ietf.org/html/rfc1034
[root@server1 ~]# yum install bind bind-chroot bind-utils
Bind的配置文件在/etc/named.conf和/var/named/中。
(更多…)
存储涉及好多好多东西,这里把软RAID,iSCSI,Multipath,LVM,SWAP都堆在一起,做个简单的综合实验。
参考文档已经说明的东西,这里就不重复讲述了。
1. 鸟哥的Linxu私房菜-LVM,Storage http://linux.vbird.org/linux_basic/0420quota.php
2. 鸟哥的Linxu私房菜-iSCSI http://linux.vbird.org/linux_server/0460iscsi.php
3. Redhat iSCSI文档 https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/ch-iscsi.html
4. Redhat Multipath文档 https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html-single/DM_Multipath/
5. Redhat LVM文档 https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Logical_Volume_Manager_Administration/
对于四轮车,只要电机的输出保持恒定,速度基本是恒定的。
但平衡直立车要控制直立,就算是原地不动,电机的输出每时每刻都在发生变化。
所以,要进行速度控制,获得当前小车的实际速度相当重要。
编码器有好多种,主要区别是单向双向,200线500线等不同精度,AB相输出,AZ相输出等区别。
其实对于平衡直立车,左右轮各一个200线的单向编码器就足够了。(大概100元一个)
200线的单向编码器,有一个A相输出,简单地说,就是轮子转一圈,就输出200个脉冲,也就是每转1/200圈,编码器就输出一个脉冲。
通过统计单位时间的脉冲,即可得到小车当前的行走速度。
K60有两个脉冲计数模块,够用。
XS128只有一个脉冲计数模块,需要在电路上另加一个加计数器(74LS系列即可)进行计数。