• 转:BBR for CentOS 7/debian8 整合分享

    Centos7转自源网站
    http://www.hostloc.com/thread-342505-1-1.html
    Debian8转自源网站
    http://www.awkxy.com/archives/721
     


    Centos7
    先把/etc/sysctl.conf 文件中 关于 net.ipv4.tcp_congestion_control的配置注释掉。(Azure的CentOS 7本来就没有)
    wget http://mirrors.kernel.org/debian/pool/main/l/linux/linux-image-4.13.0-1-amd64_4.13.4-1_amd64.deb
    ar x linux-image-4.13.0-1-amd64_4.13.4-1_amd64.deb
    tar -Jxf data.tar.xz
    install -m644 boot/vmlinuz-4.13.0-1-amd64 /boot/vmlinuz-4.13.0-1-amd64
    cp -Rav lib/modules/4.13.0-1-amd64 /lib/modules
    depmod -a 4.13.0-1-amd64
    dracut -f -v –hostonly -k ‘/lib/modules/4.13.0-1-amd64’ /boot/initramfs-4.13.0-1-amd64.img 4.13.0-1-amd64
    grub2-mkconfig -o /boot/grub2/grub.cfg
    #开启bbr
    echo “net.core.default_qdisc=fq” >> /etc/sysctl.conf
    echo “net.ipv4.tcp_congestion_control=bbr” >> /etc/sysctl.conf
    #调整内核启动顺序
    grub2-set-default “CentOS Linux (4.13.0-1-amd64) 7 (Core)”
    grub2-editenv list
    grub2-mkconfig -o /boot/grub2/grub.cfg
    然后reboot


    ubuntu/debian系统
    下载新内核:
    wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.11.2/linux-image-4.11.2-041102-generic_4.11.2-041102.201705201036_amd64.deb
    安装内核:
    dpkg -i linux-image-4.11.[Tab补全]
    删除其他内核:
    dpkg -l|grep linux-image
    apt-get remove linux-image-4.9.0-040900rc8-generic #删4.11.0以外的旧内核
    apt-get remove linux-image-4.11.0-trunk-amd64 #删4.11.0以外的旧内核
    更新 grub 系统引导文件并重启(Azure虚机执行update-grub报错时看下面)
    update-grub
    reboot
    开启BBR
    echo “net.core.default_qdisc=fq” >> /etc/sysctl.conf
    echo “net.ipv4.tcp_congestion_control=bbr” >> /etc/sysctl.conf
    sysctl -p
    sysctl net.ipv4.tcp_available_congestion_control
    查看下是否有BBR:lsmod | grep bbr


    Azure的Debian8 没有dracut
    apt-get install dracut
    Azure的Debian8 grub安装不全
    sudo apt-get update; sudo apt-get install –reinstall grub
    mkdir /boot/grub
    Linux小技巧
    1,查看发行版
    lsb_release -a
    2,查看内核
    cat /proc/version
    uname -a
    uname -r
    3,查看系统位数
    file /bin/ls
    4,验证BBR
    sysctl net.ipv4.tcp_available_congestion_control
    sysctl net.ipv4.tcp_congestion_control
     

  • 转:Custom linux boot up screen

    Displaying an image during boot instead of the default command line scrolling text

    This is based on the guide here.
    This solution works but there are a few seconds of text shown before the boot image appears.

    Install fbi
    
    sudo apt-get install fbi
    
    Copy the splashscreen image to be used

    Copy your custom splash image into: /etc/ and name it “splash.png”.
    Presumably the resolution to use is 1920x1080px.
    Create A Script

    
    sudo nano
    

    Paste the following into the text editor:

    
    #! /bin/sh
    ### BEGIN INIT INFO
    # Provides:          asplashscreen
    # Required-Start:
    # Required-Stop:
    # Should-Start:
    # Default-Start:     S
    # Default-Stop:
    # Short-Description: Show custom splashscreen
    # Description:       Show custom splashscreen
    ### END INIT INFO
    do_start () {
        /usr/bin/fbi -T 1 -noverbose -a /etc/splash.png
        exit 0
    }
    case "$1" in
      start|"")
        do_start
        ;;
      restart|reload|force-reload)
        echo "Error: argument '$1' not supported" >&2
        exit 3
        ;;
      stop)
        # No-op
        ;;
      status)
        exit 0
        ;;
      *)
        echo "Usage: asplashscreen [start|stop]" >&2
        exit 3
        ;;
    esac
    :
    

    IMPORTANT – If copying and pasting via SSH check it has pasted in correctly (pasting via FiseSSH for us caused the # lines and the esac line to be altered and need modifying back to be correct)
    Exit and save the file as: /etc/init.d/asplashscreen
    (using a name starting with ‘a’ will ensure it runs first)
    Finally make the script executable and install it for init mode:

    
    sudo chmod a+x /etc/init.d/asplashscreen
    sudo insserv /etc/init.d/asplashscreen
    

    Thats it:

    
    sudo reboot
    

     

    Getting Out Of Black Screen

    If you get a black screen at the end of booting (if you’ve not setup auto running the GUI etc) use CTRL + ALT + F2 to get the command prompt