Install Python 2.7 and Python 3.5 alongside Python 2.6 on CentOS 6.5 1. Prep # yum groupinstall "Development tools" # yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel 2. Compile as shared library - add /usr/local/lib on /etc/ld.so.conf # vi /etc/ld.so.conf include ld.so.conf.d/*.conf /usr/local/lib # ldconfig 3. Install python on /usr/local # Python 2.7.12: wget http://python.org/ftp/python/2.7.12/Python-2.7.12.tar.xz tar xf Python-2.7.12.tar.xz cd Python-2.7.12 ./configure --prefix=/usr/local --enable-unicode=ucs4 --enable-shared make && make altinstall # Python 3.5.2: wget http://python.org/ftp/python/3.5.2/Python-3.5.2.tar.xz tar xf Python-3.5.2.tar.xz cd Python-3.5.2 ./configure --prefix=/usr/local --enable-shared make && make altinstall 4. Run ldconfig again # ldconfig 5. Install python virtualenv # yum install python-virtualenv 6. Create virtualenv for python2.7 $ mkdir project_home $ cd project_home $ virtualenv -p /usr/local/bin/python2.7 .venv2.7 7. Create virtualenv for python3.5 $ mkdir project_home $ cd project_home $ pyvenv-3.5 .venv3.5 (this seems to work even though I get an error message: Unable to symlink '/usr/local/bin/python3.5' to '/auto/home/delacs/python_projects_on_perf_utils/test_project/.venv3.5/bin/python3.5')
Showing posts with label centos. Show all posts
Showing posts with label centos. Show all posts
11.03.2016
Install Python 2.7 and Python 3.5 alongside Python 2.6 on CentOS 6.5
I got mostly from this post.
5.15.2015
Configure VLAN tagging via CLI
1. Create VLAN interface
# ip link add link eth4 name eth4.2030 type vlan id 2030
2. Assign IP
# ifconfig eth4.2030 11.0.20.1 netmask 255.255.240.0
3. Make sure new interface is enabled
# ifconfig eth4.2030 up
4. Check
# ifconfig eth4.2030
eth4.2030 Link encap:Ethernet HWaddr 90:E2:BA:6D:B5:95
inet addr:11.0.20.1 Bcast:11.0.31.255 Mask:255.255.240.0
inet6 addr: fe80::92e2:baff:fe6d:b595/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1046 (1.0 KiB) TX bytes:468 (468.0 b)
5. Remove VLAN
# ip link delete eth4.2030
4.29.2015
Sync Clock Automatically on CentOS
Got it from here.
1. Install # yum install ntp ntpdate ntp-doc 2. Turn on service # chkconfig ntpd on 3. Sync one time # ntpdate pool.ntp.org 4. Configure ntpd # vi /etc/ntp.conf Add public servers server 0.rhel.pool.ntp.org server 1.rhel.pool.ntp.org server 2.rhel.pool.ntp.org 5. Start the NTP server. The following will continuously adjusts system time from upstream NTP server. No need to run ntpdate: # /etc/init.d/ntpd start
3.10.2015
Install Ruby via RVM on CentOS 6.5
Got install from here.
RVM best practices here.
How to use RVM gemsets here.
How to use Bundler here.
RVM best practices here.
How to use RVM gemsets here.
How to use Bundler here.
1. Install pre-requisites # yum groupinstall -y development 2. Install RVM # curl -L get.rvm.io | bash -s stable 3. Create system environment for RVM # source /etc/profile.d/rvm.sh 4. Install Ruby # rvm reload # rvm install 2.2.1 5. Check version of ruby installed # ruby --version 6. To see all rubies installed # rvm list rubies rvm rubies =* ruby-2.2.1 [ x86_64 ] # => - current # =* - current && default # * - default 7. To set a Ruby version as the default # rvm use 2.2.1 --default Using /usr/local/rvm/gems/ruby-2.2.1 8. Shortcut - create a new gemset along with a fresh .rvmrc in our project directory # cd projects/dev/phoenix # rvm --rvmrc --create use 2.2.1@phoenix ruby-2.2.1 - #gemset created /usr/local/rvm/gems/ruby-2.2.1@phoenix ruby-2.2.1 - #generating phoenix wrappers.......... Using /usr/local/rvm/gems/ruby-2.2.1 with gemset phoenix 9. To ignore rmvrc warnings ... # rvm rvmrc warning ignore all.rvmrcs 10. Now when we cd to our project directory we get a confirmation which ruby-version and gemset we are using... dev]# cd phoenix/ Using: /usr/local/rvm/gems/ruby-2.2.1@phoenix 11. Let's make use of bundler to make it easy to track and install the exact gems and versions for our project # gem install bundler 12. Create a Gemfile # bundle init Writing new Gemfile to /root/projects/dev/phoenix/Gemfile 13. Add gems to Gemfile # vi Gemfile source "https://rubygems.org" # 1. de facto XML/HTML parsing library gem 'nokogiri' 14. Now, let's install all gems we listed in the Gemfile # bundle install To create and use gemsets the longer way: a. Create gemset # rvm gemset create my_proj b. Use the gemset # rvm gemset use my_proj c. Install a gem # gem install package_name d. Wipe all gems installed # rvm gemset empty my_proj e. Delete the gemset # rvm gemset delete my_proj f. Check your current gemset # rvm gemset name
2.19.2015
Open HTTP port 80 on CentOS
Got from here.
1. Look at the current iptables # iptables --line -vnL Chain INPUT (policy ACCEPT 0 packets, 0 bytes) num pkts bytes target prot opt in out source destination 1 0 0 ACCEPT udp -- virbr0 * 0.0.0.0/0 0.0.0.0/0 udp dpt:53 2 0 0 ACCEPT tcp -- virbr0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:53 3 0 0 ACCEPT udp -- virbr0 * 0.0.0.0/0 0.0.0.0/0 udp dpt:67 4 0 0 ACCEPT tcp -- virbr0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:67 5 195K 212M ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED 6 3 252 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0 7 74 5440 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0 8 16 864 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22 9 170K 39M REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited 2. Inject rule, as long as it's before the REJECT line # iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT 3. Save # service iptables save 4. Add httpd_t to the list of permissive domains (So we don't need to turn off selinux) # yum install policycoreutils-python # semanage permissive -a httpd_t
Perl specific installs for Centos 6.6
1. Enable RPMForge Repository # wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm # rpm -Uvh rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm # rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt 2. Install perl installs MANUAL: 1. Dependency of Net::SSH::Perl # wget http://download.opensuse.org/repositories/home:/csbuild:/Perl/CentOS_CentOS-6/x86_64/perl-Math-GMP-2.04-2.5.x86_64.rpm # rpm -Uvh perl-Math-GMP-2.04-2.5.x86_64.rpm 2. Dependency of gnuplot for Chart::Graph::Gnuplot # wget http://www.my-guides.net/en/images/stories/fedora12/msttcore-fonts-2.0-3.noarch.rpm # rpm -Uvh msttcore-fonts-2.0-3.noarch.rpm YUM: # yum install perl-Math-BigInt-GMP # yum install perl-Math-Pari # yum install perl-Archive-Zip # yum install perl-Chart # yum install perl-DBI # yum install perl-DBD-MySQL # yum install perl-Data-Compare # yum install perl-Date-Manip # yum install perl-JSON # yum install perl-Net-Telnet # yum install perl-NetAddr-IP # yum install perl-Statistics-Descriptive # yum install perl-Text-Table # yum install perl-XML-Simple # yum install perl-XML-Writer # yum install gnuplot CPAN: # cpan Data::Diff # cpan HTML::TextToHTML # cpan XML::SemanticDiff # cpan Chart::Graph - this didn't install Force installed: cpan[1]> force install Net::Telnet::Brcd
12.11.2013
Install and Configure MariaDB on CentOS 6
1. Go to repository generator, select the desired repository. In my case, I got this:
Find out the name of service’s script from /etc/init.d/ directory e.g. mysqld or httpd
Add it to chkconfig
# MariaDB 5.5 CentOS repository list - created 2013-12-07 02:35 UTC # http://mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/5.5/centos6-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=12. Create a new repo, and put the generated text above.
$ sudo vi /etc/yum.repos.d/MariaDB.repo3. Install
$ sudo yum install MariaDB-server MariaDB-client MariaDB-devel MariaDB-common4. Start mysql
$ sudo /etc/init.d/mysql start $ sudo /sbin/chkconfig mysql on5. Autostart mysql
Find out the name of service’s script from /etc/init.d/ directory e.g. mysqld or httpd
Add it to chkconfig
$ sudo /sbin/chkconfig --add mysqldMake sure it is in the chkconfig.
$ sudo /sbin/chkconfig --list mysqldSet it to autostart
$ sudo /sbin/chkconfig mysqld on6. Setup mysql Login as root:
[samdc@perfdb4 apps]$ mysql -u rootSet root password:
MariaDB [(none)]> set password for root@localhost=password('mypass');
MariaDB [(none)]> set password for root@'127.0.0.1'=password('mypass');
MariaDB [(none)]> set password for root@'machine.domain.com'=password('mypass');
Delete anonymous:
MariaDB [(none)]> delete from mysql.user where user='';7. Create db and user: Create db:
MariaDB [(none)]> create database mydb;Create user myuser with password mypass:
MariaDB [(none)]> grant all on mydb.* to 'mydb' identified by 'mypass'; MariaDB [(none)]> grant all on mydb.* to 'mydb'@'localhost' identified by 'mypass';8. Show databases
MariaDB [(none)]> show databases;
Subscribe to:
Posts (Atom)