feichashao.com

  • 游记
  • SSH配置免密码登录

    步骤

    1. Client端生成密钥:ssh-keygen -t rsa
    2. 在Client端传送公钥到Server: ssh-copy-id -i user@remote_ip
    (更多…)

    2014-12-11
  • Stockbroker Grapevine – GCC – O(n3)解法

    原题

    Description

    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.

    Input

    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.
    (更多…)

    2014-12-10
  • RHEL6: NIS的简单配置

    参考文档

    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家目录;


    配置NIS Server

    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
    

    (更多…)

    2014-12-09
  • RHEL6: NFS Server 安装与简单配置

    参考文档

    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
    (更多…)

    2014-12-09
  • RHEL7: 救援模式修改root密码

    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
    

    (更多…)

    2014-12-08
  • RHEL6: Postfix的安装与简单配置

    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.

    (更多…)

    2014-12-07
  • RHEL6: FTP Server – VSFTPD

    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
    

    (更多…)

    2014-12-05
  • RHEL6: BIND DNS Server

    参考文档

    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/中。
    (更多…)

    2014-12-05
  • RHEL6:软RAID+iSCSI+Multipath+LVM+SWAP综合实验

    存储涉及好多好多东西,这里把软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/

    (更多…)

    2014-12-01
  • 12 – 读取传感器:编码器

    对于四轮车,只要电机的输出保持恒定,速度基本是恒定的。
    但平衡直立车要控制直立,就算是原地不动,电机的输出每时每刻都在发生变化。
    所以,要进行速度控制,获得当前小车的实际速度相当重要。


    编码器有好多种,主要区别是单向双向,200线500线等不同精度,AB相输出,AZ相输出等区别。
    其实对于平衡直立车,左右轮各一个200线的单向编码器就足够了。(大概100元一个)

    200线的单向编码器,有一个A相输出,简单地说,就是轮子转一圈,就输出200个脉冲,也就是每转1/200圈,编码器就输出一个脉冲。
    通过统计单位时间的脉冲,即可得到小车当前的行走速度。

    K60有两个脉冲计数模块,够用。
    XS128只有一个脉冲计数模块,需要在电路上另加一个加计数器(74LS系列即可)进行计数。

    (更多…)

    2014-11-30
←上一页
1 … 19 20 21 22 23 … 33
下一页→

feichashao.com

feichashao's blog

  • 博客
  • 关于
  • 常见问题
  • 作者
  • 事件
  • 商店
  • 样板
  • 主题

二〇二五

以 WordPress 设计