一半君的总结纸

听话只听一半君

手贱破笔记本重装系统CentOS 6.5 + 高逼格Maya 2015神秘文件安装法 + Deadline 5.2 / pidgin-lwqq / sublime / tmux / tigervnc 安装法

虽然7马上就要出了… 但还是强迫症的想再回到6.5(之前是Fedora 20,机器太破用了lxde还是略卡 …再之前是CentOS6.4,因为PyQt用不了换的Fedora,结果因为太新用不了中古显卡的ATI Catalyst驱动…此破机器是Sony Vaio FW27)

  1. 做usb安装盘,这时代没人用光盘的,官方说明在这,众多做法中挑了个脑残法(使用Win32 Disk Imager)(之前试了unetbootin-windows-608启动不能) 把iso用ultraiso转了img(不知为何转出来两个.dvd .000,我把.000改成了.img)
    centos_install_1_img
  2. 这是lz的破显卡,貌似6.5依然太”新”了,不折腾驱动了…
    [root@localhost fucker]# lspci -nn | grep VGA
    01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] RV635/M86 [Mobility Radeon HD 3650] [1002:9591]
    

    下面安装epel源

    yum install http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
    

    然后装ntfs支持

    yum install ntfs-3g
    
  3. 装pidgin-lwqq
    # 装 cmake 3.0
    wget http://www.cmake.org/files/v3.0/cmake-3.0.0.tar.gz
    tar xvf cmake-3.0.0.tar.gz
    cd cmake-3.0.0
    ./configure
    gmake
    sudo make install
    
    # 装lwqq wiki里让装的
    sudo yum install gcc gcc-c++ make cmake pkgconfig libcurl-devel sqlite-devel zlib-devel js-devel
    
    # 装pidgin-lwqq wiki里让装的
    sudo yum install gcc gcc-c++ make cmake pkgconfig glib-devel libpurple-devel
    
    # 装libev
    yum install libev libev-devel
    
    # 装mozjs185
    wget http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz
    tar -xvf js185-1.0.0.tar.gz
    cd js185-1.0.0/js/src
    ./configure
    make
    sudo make install
    
    # 装lwqq
    git clone https://github.com/xiehuc/lwqq.git
    cd lwqq
    mkdir build;cd build
    cmake ..
    make && make install
    
    # 但是装了还是找不到mozjs185 所以
    export PKG_CONFIG_PATH=/home/fucker/Downloads/js-1.8.5/js/src/
    # 这次终于可以了
    
    cmake ..
    make
    sudo make install
    
    # 装pidgin-lwqq
    git clone https://github.com/xiehuc/pidgin-lwqq.git
    cd pidgin-lwqq
    git checkout -b dev origin/dev
    mkdir build && cd build
    export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
    cmake ..
    make
    sudo make install
    
    # 遇到装了pidgin打开后还是看不到webqq的问题,在.bash_profile里加入如下环境变量,logout,再login
    export LD_LIBRARY_PATH=/usr/local/lib
    export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
    
    # 装 pidgin-gnome-keyring
    sudo yum install gnome-keyring-devel
    wget https://pidgin-gnome-keyring.googlecode.com/files/pidgin-gnome-keyring-1.20_src.tar.gz
    tar xvf pidgin-gnome-keyring-1.20_src.tar.gz
    cd pidgin-gnome-keyring-1.20
    make
    make install
    
    # 装 pidgin-sendscreenshot
    git clone https://github.com/clickbeetle/pidgin-sendscreenshot.git
    cd pidgin-sendscreenshot
    sudo yum install pidgin-devel
    # 不知道为什么随便设了个安装路径他就安到/usr/lib64/pidgin去了,不然的话他安到/usr/local/lib/pidgin
    ./configure --prefix=/
    make
    sudo make install
    
    
  4. 装Deadline 5.2.49424
    # 先装mono,由于官方给了个预先编译好的2.10.9(如果你申请了试用,有那个box.com的网盘共享下载地址的话,如果没有可以自行编译)
    cd mono-2.10.9-repo
    cp -r x86_64 /tmp
    sudo cp thinkbox.repo /etc/yum.repos.d/
    yum install mono-complete --disablerepo=* --enablerepo=thinkbox
    
    # 然后装repo和client
    tar xvf Deadline_Linux_Installers_x86_64_5_2_49424.tar
    cd Deadline_Linux_Installers_x86_64_5_2_49424
    sudo ./DeadlineRepository_x86_64
    sudo ./DeadlineClient_x86_64
    
    # 好像还需要这个
    yum install libgdiplus
    
  5. 装sublime text 3 build 3059
    curl http://c758482.r82.cf2.rackcdn.com/sublime_text_3_build_3059_x64.tar.bz2 | tar xj
    sudo mkdir -p /opt/sublime_text
    sudo cp -r sublime_text_3/* /opt/sublime_text/
    sudo mv /opt/sublime_text/sublime_text.desktop ~/Desktop
    
  6. 装PyQt4 但是这样装出来的repo上的版本是4.6.2和任何一个版本的Maya内置的都不一样,这大概没法在Maya里用吧
    sudo yum install PyQt4 PyQt4-devel PyQt4-webkit qt-demos
    
  7. 试装Maya 2015
    各个版本的Maya安装时需要的product key 官网有,在这里

    sudo yum install libXp-devel libXpm redhat-lsb
    # 除了./setup以外,还需要装adlm server,因为./setup没帮你装这个
    sudo yum install adlmflexnetserver-9.0.23-0.x86_64.rpm
    
    # 照说明使用神秘文件,放到/opt/flexnetserver/adskflex和/usr/autodesk/maya2015-x64/lib/libadlmint.so.9.0.23
    
    # 改lic.dat 里的 HOSTNAME 和 MAC 下面这两条命令可以查他们分别是什么
    /opt/flexnetserver/lmutil lmhostid hostname
    /opt/flexnetserver/lmutil lmhostid ether
    
    # 手动开 daemon 试下
    /opt/flexnetserver/lmgrd -z -c lic.dat
    
    # 当然你可以放启动里 或者 自己拼个wrapper script来开maya,不过为了高逼格,可以把他装成"service",因为centos 6.5里还没有systemd,用的还是老旧的init scirpt 可以参考/usr/share/doc/initscripts-*/sysvinitfiles里的说明
    

    如果你每次手动开这个进程,或者放启动里,那岂不是逼格甚低,所以有了下面这个高逼格init script(其实就类似于在windows里加一个自己的系统”服务”…)

    #!/bin/bash
    #i
    # mayalic lmgrd for maya licensing
    #
    # chkconfig: 345 70 30
    # description: maya license
    # processname: lmgrd
    
    # Source function library.
    . /etc/init.d/functions
    
    RETVAL=0
    prog="mayalic"
    LOCKFILE=/var/lock/subsys/$prog
    
    # Declare variables
    FLEXLM_DIR=/opt/flexnetserver
    
    start() {
            echo -n "Starting $prog: "
            #
    	#ps cax | grep lmgrd  > /dev/null
    	pgrep lmgrd > /dev/null
    	if [ $? -eq 0 ]; then
    	  # echo "Process is running."
              $FLEXLM_DIR/lmutil lmreread -c $FLEXLM_DIR/lic.dat  > /dev/null 2>&1 &
    	else
    	  # echo "Process is not running."
    	  $FLEXLM_DIR/lmgrd -z -c $FLEXLM_DIR/lic.dat  > /dev/null 2>&1 &
    	fi
    	echo "daemon started"
    
    	RETVAL=$?
            [ $RETVAL -eq 0 ] && touch $LOCKFILE
            return $RETVAL
    }
    
    stop() {
            echo -n "Shutting down $prog: "
            $FLEXLM_DIR/lmutil lmdown -vendor adskflex -q >/dev/null 2>&1 &
            RETVAL=$?
            [ $RETVAL -eq 0 ] && rm -f $LOCKFILE
    	echo "daemon stopped"
            return $RETVAL
    }
    
    status() {
            echo -n "Checking $prog status: "
            # $ASADMIN list-domains | grep $DOMAIN
            # $FLEXLM_DIR/lmutil lmpath -status
    	pgrep adskflex > /dev/null
    	if [ $? -eq 0 ]; then
    	  echo -e "\033[1;32m[running]\033[0m"
    	else
    	  echo -e "\033[1;31m[not running]\033[0m"
    	fi
            RETVAL=$?
            return $RETVAL
    }
    
    case "$1" in
        start)
            start
            ;;
        stop)
            stop
            ;;
        status)
            status
            ;;
        restart)
            stop
            start
            ;;
        *)
            echo "Usage: $prog {start|stop|status|restart}"
            exit 1
            ;;
    esac
    exit $RETVAL
    

    你只要把上面的script存到/etc/init.d/里,然后

    [root@localhost]# chkconfig --add mayalic
    [root@localhost]# chkconfig --list  mayalic
    mayalic         0:off   1:off   2:off   3:on    4:on    5:on    6:off
    

    然后理论上每次重启他都会自己开,而且你可以这样手动开关

    [root@localhost]# service mayalic
    Usage: mayalic {start|stop|status|restart}
    [root@localhost]# service mayalic status
    Checking mayalic status: [running]
    
    # 关掉可以用 service mayalic stop, 开可以用service mayalic start
    

    效果图mayalic

    ps: 安装的时候选network license, server填127.0.0.1, lic.dat里填localhost.localdomain 后面跟MAC ( 原有的 HOSTNAME MAC 删掉)

  8. 装最新版 tmux 1.9a, repo里只有1.6
    # 准备
    sudo yum install libevent libevent-devel
    sudo yum install ncurses ncurses-devel
    
    # 但是repo里的libevent1.4好像太老了,下面configure的时候会出错,所以自己去装了新的
    curl -L https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz | tar xz
    cd libevent-2.0.21-stable
    ./configure
    make
    make install
    
    # 回到tmux安装 ...
    wget http://downloads.sourceforge.net/project/tmux/tmux/tmux-1.9/tmux-1.9a.tar.gz
    tar -xvf tmux-1.9a.tar.gz
    cd tmux-1.9a
    ./configure
    make
    sudo make install
    
  9. 为了用powerline,要python2.7,抄袭这个Installing Python 2.7.6 on CentOS 6.5 只不过换成了2.7.8,记住要make altinstall
  10. 装tigervnc,抄袭自 HowTos VNC-Server
    sudo yum install tigervnc tigervnc-server
    
    # 加帐号
    useradd fuckervnc
    passwd fuckervnc
    
    # 改文件 /etc/sysconfig/vncservers
    VNCSERVERS="1:fuckervnc1 2:fuckervnc2"
    VNCSERVERARGS[1]="-geometry 1600x900"
    VNCSERVERARGS[2]="-geometry 640x480"
    
    # 设vnc密码
    su - fuckervnc
    vncpasswd
    
    # 确保他自动启动
    /sbin/service   vncserver start
    /sbin/chkconfig vncserver on
    
    # xstartup文件改成用kde的
    vim ~/.vnc/xstartup
    
    # 开server
    /sbin/service vncserver start
    

    把xstartup改成用kde的

    # 其实我不知道这几行什么意思... 原版的很长
    unset SESSION_MANAGER
    unset DBUS_SESSION_BUS_ADDRESS
    exec /usr/bin/startkde &
    
    #!/bin/sh
    
    [ -r /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n
    export LANG
    export SYSFONT
    vncconfig -iconic &
    unset SESSION_MANAGER
    unset DBUS_SESSION_BUS_ADDRESS
    OS=`uname -s`
    if [ $OS = 'Linux' ]; then
      case "$WINDOWMANAGER" in
        *gnome*)
          if [ -e /etc/SuSE-release ]; then
            PATH=$PATH:/opt/gnome/bin
            export PATH
          fi
          ;;
      esac
    fi
    if [ -x /etc/X11/xinit/xinitrc ]; then
      exec /etc/X11/xinit/xinitrc
    fi
    if [ -f /etc/X11/xinit/xinitrc ]; then
      exec sh /etc/X11/xinit/xinitrc
    fi
    [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
    xsetroot -solid grey
    xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
    twm &
    

    这里有个大坑就是重启后在登录界面时连不上(非得有个用户真的登录进去了之后,vnc才能连上),经查看似乎是网卡没有启动,整蛊了半天后才找到简单解决方法,就是要勾选上Connect Automatically 和 Available to all users,如图所示,之前还按照Why does my Ethernet not work unless I log in and explicitly enable it?乱搞了一通无解…
    vnc2

    vnc1

参考:
Create init script in CentOS 6
Shell Colors: colorizing shell scripts

Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: