2016年4月7日 星期四

Linux CentOS 6.7 and 7 C++ Java Netbeans Python RobotFramework SQLite

Linux CentOS 7 C++ Java Netbeans Eclipse CDT Python RobotFramework
Basic

Download CentOS 7 Everything
Install minimal, 512MB RAM minimal for CentOS 6.9

Add sudoer
adduser ricky
passwd ricky
usermod -aG wheel ricky
echo 'ricky ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers (CentOS 6, maybe 7 also ok)
su - ricky
sudo ls -lart /root

NIC onboot
sudo ifup eth0
vi /etc/sysconfig/network-scritps/ifcfg-eth0
onboot=yes

Install ifconfig, netstats, traceroute
sudo yum -y install net-tools


Set Host Name (CentOS 7 only, optional for X11)
sudo hostnamectl set-hostname centos72

Set Host Name (CentOS 6 only, optional for X11)
sudo vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=centos6

Change SSHD config
sudo vi /etc/ssh/sshd_config
  • X11Forwarding yes
  • X11UseLocalhost no
Install xauth and xclock
sudo yum -y install xauth xclock openssh-clients

Common

Change Time Zone to HKT
sudo ln -sf /usr/share/zoneinfo/Asia/Hong_Kong /etc/localtime
date

Enable line number in VI
sudo yum install -y vim
printf "set number" > ~/.vimrc

Install wget

sudo yum install -y wget

NTP Service (CentOS 7)
sudo yum -y install ntp
sudo service ntpd start
ntpq -p

NTP Restart (CentOS 7)
sudo vi /etc/ntp.conf
server 192.168.0.1 iburst
sudo service ntpd restart
ntpq -p

NTP (CentOS 6)
sudo yum -y install ntp ntpdate ntp-doc
sudo chkconfig ntpd on
sudo ntpdate pool.ntp.org
sudo /etc/init.d/ntpd start

ACPI Shutdown
sudo yum -y install acpid
sudo chkconfig acpid on (CentOS 6)
sudo service acpid start (CentOS 6)
systemctl enable acpid.service
systemctl start acpid.service

Check $DISPLAY

Check Host File for $DISPLAY
sudo vi /etc/hosts
192.168.0.101 centos7

Check $DISPLAY after reboot
For CentOS 6,
sudo service sshd restart
exit
For CentOS 7,
reboot
ssh client again
echo $DISPLAY
centos72:10.0

Install Xming
Install Xming X11 display server (https://sourceforge.net/projects/xming/) on your desktop PC and launch it

Enable X11 forward for PuTTY
Connection > SSH > X11 > Enable X11 forwarding

Proxy

Add DNS Server
vi /etc/resolv.conf
nameserver 8.8.8.8
nameserver 4.4.4.4

Add Proxy Server
vi ~/.bash_profile
http_proxy=http://192.168.0.1:8080
export http_proxy
https_proxy=http://192.168.0.1:8080
export https_proxy

Setup Yum Proxy
vi /etc/yum.conf
proxy=http://192.168.0.1:8080

Install EPEL repository and xclip (for copying ssh keys using command only)
sudo yum -y install epel-release
sudo yum -y install xclip


Generate public key to remote machine
ssh-keygen -t rsa -C "admin@example.com"
cat ~/.ssh/id_rsa.pub
xclip -sel clip < ~/.ssh/id_rsa.pub
ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.0.2

GUI

Install Desktop (Optional)

sudo yum -y groups install "GNOME Desktop"

Install XRDP
sudo yum install xrdp tigervnc-server
sudo chcon -t bin_t /usr/sbin/xrdp
sudo chcon -t bin_t /usr/sbin/xrdp-sesman
sudo systemctl enable xrdp.service

sudo systemctl start xrdp
sudo systemctl status xrdp
netstat -antup | grep xrdp
sudo vi /etc/xrdp/xrdp.ini
max_bpp=24

C++

glibc
sudo yum -y install glibc* cmake

C++ Development (for CentOS 7)
sudo yum -y group install "Development Tools"
whereis gcc
gcc --version

C++ Development (for CentOS 6)
echo Mandatory Packages:
sudo yum -y install autoconf automake binutils bison flex gcc gcc-c++ gettext libtool make patch pkgconfig redhat-rpm-config rpm-build rpm-sign
echo Default Packages:
sudo yum -y install byacc cscope ctags diffstat doxygen elfutils gcc-gfortran git indent intltool patchutils rcs subversion swig systemtap
echo Optional Packages:

sudo yum -y install cmake git libstdc++-docs
whereis gcc
gcc --version

GCC with Boost on CentOS (Optional)
http://joelinoff.com/blog/?p=1604#more-1604

Compile a Helloworld
rm -f foo.c && printf '#include<stdio.h>\n void main(void){ printf("Hello");}' >> foo.c && gcc foo.c -o foo && ./foo

JAVA

JVM

Installing Java 8 by RPM
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-x64.rpm
sudo rpm -ivh jdk-8u111-linux-x64.rpm

wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.rpm

NETBEANS

Installing NetBeans JDK by SH
sudo yum -y install libXtst
wget http://download.netbeans.org/netbeans/8.1/final/bundles/netbeans-8.1-cpp-linux-x64.sh
chmod a+x netbeans-8.1-cpp-linux-x64.sh
./netbeans-8.1-cpp-linux-x64.sh


SO File Path (Required if want permanent environment variables)
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/NetBeansProjects/your/lib
export LD_LIBRARY_PATH

Uninstall Netbeans
/home/ricky/netbeans-8.1/uninstall.sh (no need sudo)

Eclipse
http://www.eclipse.org/downloads/eclipse-packages/?osType=linux&release=undefined

to be continued

SQLite

SQLite Development with C++
sudo yum install -y sqlite-devel


Python and RobotFramework

Python
sudo yum -y install python-devel python-setuptools

PIP
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py

RobotFramework
sudo pip --proxy http://10.23.31.130:8080 install paramiko robotframework robotframework-ride robotframework-sshlibrary 

wxPython
yum install wxPython python-paramiko sshpass



GCC Version
On CentOS 7.2
[ricky@pc009 ~]$ cat /etc/*release

CentOS Linux release 7.2.1511 (Core)
$ gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
On CentOS 7.3
[ricky@centos73 ~]$ cat /etc/*release
CentOS Linux release 7.3.1611 (Core)
[ricky@centos73 ~]$ gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

MiniConda



wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh

沒有留言:

張貼留言

2023 Promox on Morefine N6000 16GB 512GB

2023 Promox on Morefine N6000 16GB 512GB Software Etcher 100MB (not but can be rufus-4.3.exe 1.4MB) Proxmox VE 7.4 ISO Installer (1st ISO re...