Showing posts with label CentOS. Show all posts
Showing posts with label CentOS. Show all posts

Monday, February 15, 2016

How to install Ruby on Rails on CentOS 6

This is a quick tutorial on how to install Ruby on Rails on CentOS 6. Before installing Ruby on Rail just want to briefly explain what Ruby on Rails is. Ruby on Rails is an application stack that provides web developers with a framework to quickly create a web application. All right well enough jabbering lets get on with the installation.

Installing Ruby 2.18 using rvm.
NOTE: by default ruby 1.8.7 is installed on centos 6.

Step 1. Install the required packages
# yum install gcc-c++ patch readline readline-devel zlib zlib-devel 
# yum install libyaml-devel libffi-devel openssl-devel make 
# yum install bzip2 autoconf automake libtool bison iconv-devel sqlite-devel
Step 2. Install the latest version of RVM
# curl -L get.rvm.io | bash -s stable
# cd tar -xzvf /usr/local/rvm/archives/rvm-1.26.11.tgz
# cd /usr/local/rvm/archives/rvm-1.26.11/binscripts
# ./rvm-installer
Step 3.  Setup the RVM Environment 
# source /etc/profile.d/rvm.sh
Step 4. Install ruby 
# rvm install 2.1.8

Step 5.  Configure the Default version of Ruby 
# rvm use 2.1.8 --default

Using /usr/local/rvm/gems/ruby-2.1.8

Step 6.  Check the current version of Ruby 

# ruby --version

ruby 2.1.8p440 (2015-12-16 revision 53160) [x86_64-linux]

Install Rails 
#gem install rails -V
Create a Test Application (Optional) to verify that Rails is working properly
NOTE: After running the rails server --binding= the following error might pop up " There was an error while trying to load the gem 'uglifier'" if you see this error you will need to install nodejs. Run the following commands to install nodejs  

curl -sL https://rpm.nodesource.com/setup | bash -
yum install -y nodejs
npm install -g express-generator
npm -g install npm@latest

cd ~

rails new testapp 
The move into the applications directory 
# cd testapp
Create the sqlite3 database:
rake db:create 
http://server ip address:3000

Saturday, August 3, 2013

Recompiling the linux Kernel in Centos

The Linux Kernel is a very interesting piece of Software. Recompiling a linux Kernel is every Linux Geeks right of passage. This is a tutorial on how to Recompile the Linux Kernel.The reasons to compile kernels are far and few in between. You may want to consider doing this if you have exotic architecture or hardware that the mainline kernel does not support, which is a rarity today. Another reason may be performance benefits. If you have a very old machine, creating a custom kernel with a minimal disk and memory footprint could be your thing. Similarly, if you need a kernel for an odd target device that has constrained resources, like a router or such, the only way to get past the limitations would be by compiling your own kernel, Well enough babbling from me lets begin with the process.

Step 1 Install the kernel-devel kernel-headers packages

    [root@blizzard ~]# yum install kernel-devel kernel-headers ncurses  ncurses-devel


Step 2  Install the Development and Debugging Tools these will be needed in order to recompile the linux kernel.

     [root@blizzard ~]# yum groupinstall "Development-Tools" "Debugging Tools"


Step 3  Grab a copy of the lastest kernel. The latest version of the kernel at the time of this writing is 3.6

     [root@blizzard ~]#  wget  http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.0.87.tar.gz


Step 4 Copy the linux-3.0.87.tar.gz kernel package over to the /usr/src directory.This directory holds the linux kernel sources.

[root@blizzard csh11]# cp linux-3.6.tar.gz /usr/src/

Step 5  Unpack the Linux Kernel Package

[root@blizzard src]# tar -xzvf linux-3.0.87.tar.gz


Step 6  Change into the linux-3.6  Directory

[root@blizzard src]# cd linux-3.0.87 


Step 7 Run the make menuconfig (text menu) or make config to configure the kernel
Note: its always best to run the make menuconfig command its alot easier to select or deselect modules.

[root@blizzard src]#  make config


Step 8 Run the make command

[root@blizzard src]#  make 



Step 9 Install the kernel

[root@blizzard src]#  make modules_install install


Step 10 Verify that the new kernel has been install

[root@blizzard src]#  uname -r 


That's it I hope this article will be useful to anyone trying to learn about recompiling the linux kernel in centos.





Thursday, April 19, 2012

CentOS/RHEL EPEL Repo Install Tutorial

This is quick blurb about CentOS/RHEL EPEL repo, this tutorial walks you through the process of installing the EPEL Repository on versions 4, 5 & 6 of CentOS/RHEL Linux. The EPEL repository gives you access to RPM’s which allows you to install unsupported software.

How to install EPEL on CentOS/RHEL (all version)

CentOS 4 EPEL Install

How to install EPEL on Centos 4 / RHEL 4:

rpm -Uvh http://download.fedoraproject.org/pub/epel/4/i386/epel-release-4-10.noarch.rpm
CentOS 5 EPEL Install

How to install EPEL on Centos 5 / RHEL 5:

rpm -Uvh http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
CentOS 6 EPEL Install

How to install EPEL on Centos 6 / RHEL 6:

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
Once installed just run the following command:

yum install package-name

Friday, July 8, 2011

Updating Python on RHEL

Good Morning its a wonderful Friday im so excited for no reason lol :) well anyways here is a quick tutorial on how to upgrade python without overwriting your existing version of python in RHEL(Red Hat Linux ) this method will also work on centos as well. So enough talking here are the steps that i took in order to get this to work.

Step 1 - > wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/epel-release-1-1.ius.el5.noarch.rpm


Step 2 -> rpm -Uvh epel-release-1-1.ius.el5.noarch.rpm

Step 3 -> yum install python26

Step 4 -> rpm -qil python26 | grep /usr/bin

That's all so now when you want to use python 2.6 just point to the /usr/bin/python26 directory instead of the original /usr/bin/python. This is a safer method b/c python is so closely tied with yum that it can cause alot of issues :0. well enjoy your new version of python and happy scripting :)

Wednesday, April 27, 2011

Network Card Bonding in Red Hat Enterprise 6

Good Morning all most of you guys are probably asleep which is cool. Im currently on a mission right now to obtain my RHCSA Certification by the end of my so this is one of may posts that i will be posting as i go through each module. First post of this mission i will be doing Network Card Bonding in RedHat Linux 6 these are the following steps that i took to get this to work.

Step 1. change into the /etc/sysconfig/network-scripts directory and create the following file: ifcfg-bond0

Step 2. open the ifcfg-bond0 with you favorite edit (mine being vi) and add the following content:

DEVICE=bond0
IPADDR=192.168.6.70
NETMASK=255.255.255.0
GATEWAY=192.168.6.3
ONBOOT=yes
BOOTPROTO=none
USERCTL=no

Step 3. open the ifcfg-eth(N) note:N -> the interface number example eth0 eth1 etc etc... ifcfg-eth0 and ifcfg-eth1 and add the following content

####################
#eth0 file content #
####################

ifcfg-eth0:

DEVICE=eth0
USERCTL=no
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
ONBOOT=yes

#####################
#eth1 file content #
#####################

ifcfg-eth1

DEVICE=eth1
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none


Step 4. change into the /etc/modprobe.d/ directory and create the bonding.conf file

Step 5. open the bonding.conf and add the following content

alias bond0 bonding

Step 6. run the following command: service network restart

Step 7. Enjoy your bonded network interfaces :)

well im off to bed have to be at work in a few hours night night all :)

Wednesday, March 16, 2011

Compiling Openldap on Centos

Good morning , I took on the project of setting up openldap to talk to freeradius however there is one thing standing in the way. compiling openldap on the centos platform. which proved to be a very challenging process. Well here are the following steps that i took in order to get openldap to compile on centos NOTE:"This method is the method that worked for me so use this method at your own risk :)"

Step1. Make sure you download a copy of Berkeley DB version 4.8. The current version of Berkley DB that comes with centos is not compatable when trying to compile openldap.

Step2. After downloading and unpackging the DB version 4.8 run the following commands

cd build_unix

../dist/configure


Step3. Run make && make install


Step 4. Download and unpack a recent copy of openldap which is at the time of this writing is openldap-2.4.23

Step 5. change over to the openldap directory and run the following commands

LDFLAGS=-L/path/to/BerkeleyDB.4.8/lib CPPFLAGS=-I/path/to/BerkeleyDB.4.8/include ./configure

example: LDFLAGS=-L/usr/local/BerkeleyDB.4.8/lib CPPFLAGS=-I/usr/local/BerkeleyDB.4.8/include ./configure

Step6. Once the configure has completed run the folllowing command

make depend && make && make install


The compiled version of openldap should be installed in the /usr/local/etc/openldap directory


Step 7. enjoy your new version of openldap :)

Wednesday, November 24, 2010

Red Hat Exam Changes

Earlier this month Red Hat released RHEL6. This release has a significant number of changes, updates, and fixes. The scalability for RHEL6, particularly in the data center, has been improved as well. One thing however that many people were not aware was coming is a complete change to the Red Hat certifications.

First up the RHCT has been immediately retired :(. It has been replaced with a new certification called the Red Hat Certified System Administrator (RHCSA). For those that already hold an RHCT certification will receive this new one in its place. Red Hat claims that being certified with a title of "System Admin" vs "Technician" makes a large difference when searching for a job (as well as peoples egos). While this may be true, the new exam also includes a completely revamped set of requirements. Also as a complete surprise the RHCSA is now a pre-req to anyone going for the more advanced RHCE exam (you can take the RHCE without an RHCSA, but you won't receive the actual certificate until you have your RHCSA). The cost for this new exam is $400. You can find the new exam objectives here:

https://www.redhat.com/certification/rhcsa/objectives/

Second, the RHCE exam has changed as well. While a great deal of material stayed the same (I'd say about 60%) for the RHCE, the services that you are required to know also became more detailed in the amount of topics you need to know. Due to this exam now having a pre-req the cost for the RHCE has dropped to $400 (down from $800), making it easier to obtain each exam for the price of $800. The downfall here is that you are required to know more for each exam. You can find the new exam objectives here:

https://www.redhat.com/certification/rhce/objectives/

For anyone that already has version 5 of either Red Hat exam already schedule I would recommend checking with your testing provider as there are conflicting reports of which version of the exam you will actually be allowed to sit for. According to Red Hat's website about 90% of testing centers will no longer allow you to book the old exam. While I welcome a revamp to the Red Hat certification program I think there could have been a warning to those in the process of studying. You can't change an entire program over night and expect that everyone will be alright with it, not to mention that the new exams are harder and cover more material. I think that the biggest downfall here is that there is currently no books or study material on the market for these new exams and while Red Hat has also re-done all of their training courses they are each about $3000 (there are three training courses covering all the material from RCHSA to RHCE for a total of about $6000). It is still too early to tell what kind of impact these exam changes will have, but I can tell that changing the exams and certification process without warning has left a bad taste in many peoples mouth.

Friday, November 12, 2010

New Pricing for RedHat 6

Well i know it has been a while since ive last been on here and posted anything. just been working on real life right now. :) how every ive stumbled across the new pricing for red hat 6 which i think is still in its beta stages right now im not sure. but however the pricing for red hat 6 will be as follows:

* Number of pairs of sockets
* Support level - Standard or Premium
* Number of virtual guests - 1, 4 or unlimited

Two procs premium subscription with unlimited guests costs you $3.249. Four socket premium/unlimited guests costs you $6498. I didn't found a price for a one-socket system, so it looks like you have to purchase support in chunks of two. BTW: As expected and announced by RHEL there is no Itanium support.

Just for the protocol: 2 sockets premium Solaris support on third party hardware costs you $2000, 4 sockets premium Solaris will cut $4000 from your budget. For Oracle hardware it's even cheaper, as you have the 8% net system price rule. And those both kinds of licenses are always "unlimited guests" and the ones on Sun ... errr, sorry ...Oracle Hardware even includes Oracle Linux and Oracle VM.

All pricing information get be found at the following url https://www.redhat.com/apps/store/server/

Saturday, July 10, 2010

Configuring raid from the command line in Centos

Well just coming back from a wonderful vacation and now im back in thinking mode. I'm a junkie when it comes to the command line in unix/linux so today im going to configure software raid on centos using the mdadm command. Now this is just a short tutorial on how to do that if you need any more information just do a man mdadm :). Here are the following steps that i took to setup software raid in centos linux:

Step 1. Check for all the hd drives on your box, using the following command dmesg | grep -i ^scsi (In this case its scsi since i love scsi)


dmesg | grep -i ^scsi
SCSI subsystem initialized
scsi0 : ioc0: LSI53C1030 B0, FwRev=01032920h, Ports=1, MaxQ=128, IRQ=67
SCSI device sda: 167772160 512-byte hdwr sectors (85899 MB)
SCSI device sda: 167772160 512-byte hdwr sectors (85899 MB)
SCSI device sdb: 167772160 512-byte hdwr sectors (85899 MB)
SCSI device sdb: 167772160 512-byte hdwr sectors (85899 MB)
SCSI device sdc: 167772160 512-byte hdwr sectors (85899 MB)
SCSI device sdc: 167772160 512-byte hdwr sectors (85899 MB)
SCSI device sdd: 167772160 512-byte hdwr sectors (85899 MB)
SCSI device sdd: 167772160 512-byte hdwr sectors (85899 MB)


Step 2. Setup the raid using the following command: mdadm --create /dev/md0 --level 1 --raid-devices 2 /dev/sdb /dev/sdc

Step 3. Check the status of the raid sync with cat /proc/mdstat and you should see the following output: cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sdc[1] sdb[0]
83886016 blocks [2/2] [UU]
[===============>.....] resync = 75.4% (63301376/83886016) finish=1.7min speed=200001K/sec

keep checking this file until resync is at 100%.


Well This is all for now like i said earlier if you need more information do a man mdadm and you will find out all you need to know.

Cracking Kerberos Service Tickets (TGS) Using Kerberoasting

As of late I've been spending a lot of time researching and learning different techniques when it comes to attacking Active Directory En...