jueves, 14 de agosto de 2014

Installing git on redhat 5.10

You only need 2 commands: Install epel and install git:

# wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
or
# wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

Then just:

#yum install git


i.e.

[root@ip-172-31-30-151 ~]# wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
--2014-08-14 15:45:32--  http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
Resolving download.fedora.redhat.com... failed: Name or service not known.
wget: unable to resolve host address `download.fedora.redhat.com'
[root@ip-172-31-30-151 ~]# rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
Retrieving http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
warning: /var/tmp/rpm-xfer.VE4DbP: Header V3 DSA signature: NOKEY, key ID 217521f6
Preparing...                ########################################### [100%]
   1:epel-release           ########################################### [100%]
[root@ip-172-31-30-151 ~]# yum install git
Loaded plugins: amazon-id, fastestmirror, product-id, rhui-lb, security
Loading mirror speeds from cached hostfile
 * epel: mirror.pnl.gov
 * rhui-REGION-client-config-server-5: rhui2-cds01.us-west-2.aws.ce.redhat.com
 * rhui-REGION-rhel-server: rhui2-cds01.us-west-2.aws.ce.redhat.com
epel                                                                                              | 3.7 kB     00:00  
epel/primary_db                                                                                   | 4.0 MB     00:00  
Excluding Packages from Red Hat Enterprise Linux Server 5 (RPMeng-gazzangs)
Finished
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package git.x86_64 0:1.8.2.1-1.el5 set to be updated
--> Processing Dependency: perl-Git = 1.8.2.1-1.el5 for package: git
--> Processing Dependency: perl(Term::ReadKey) for package: git
--> Processing Dependency: perl(Git) for package: git
--> Processing Dependency: perl(Error) for package: git
--> Running transaction check
---> Package perl-Error.noarch 1:0.17010-1.el5 set to be updated
---> Package perl-Git.x86_64 0:1.8.2.1-1.el5 set to be updated
---> Package perl-TermReadKey.x86_64 0:2.30-4.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=========================================================================================================================
 Package                           Arch                    Version                           Repository             Size
=========================================================================================================================
Installing:
 git                               x86_64                  1.8.2.1-1.el5                     epel                  7.4 M
Installing for dependencies:
 perl-Error                        noarch                  1:0.17010-1.el5                   epel                   26 k
 perl-Git                          x86_64                  1.8.2.1-1.el5                     epel                   49 k
 perl-TermReadKey                  x86_64                  2.30-4.el5                        epel                   32 k

Transaction Summary
=========================================================================================================================
Install       4 Package(s)
Upgrade       0 Package(s)

Total download size: 7.5 M
Is this ok [y/N]: y
Downloading Packages:
(1/4): perl-Error-0.17010-1.el5.noarch.rpm                                                        |  26 kB     00:00  
(2/4): perl-TermReadKey-2.30-4.el5.x86_64.rpm                                                     |  32 kB     00:00  
(3/4): perl-Git-1.8.2.1-1.el5.x86_64.rpm                                                          |  49 kB     00:00  
(4/4): git-1.8.2.1-1.el5.x86_64.rpm                                                               | 7.4 MB     00:01  
-------------------------------------------------------------------------------------------------------------------------
Total                                                                                    4.5 MB/s | 7.5 MB     00:01  
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 217521f6
epel/gpgkey                                                                                       | 1.7 kB     00:00  
Importing GPG key 0x217521F6 "Fedora EPEL <epel@fedoraproject.org>" from /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : perl-TermReadKey                                                                                  1/4
  Installing     : perl-Error                                                                                        2/4
  Installing     : git                                                                                               3/4
  Installing     : perl-Git                                                                                          4/4

Installed:
  git.x86_64 0:1.8.2.1-1.el5                                                                                          

Dependency Installed:
  perl-Error.noarch 1:0.17010-1.el5      perl-Git.x86_64 0:1.8.2.1-1.el5      perl-TermReadKey.x86_64 0:2.30-4.el5  

Complete!
[root@ip-172-31-30-151 ~]# git clone https://user@bitbucket.org/user/hardening.git
Cloning into 'hardening'...
Password for 'https://user@bitbucket.org':
remote: Counting objects: 191, done.
remote: Compressing objects: 100% (173/173), done.
remote: Total 191 (delta 79), reused 0 (delta 0)
Receiving objects: 100% (191/191), 31.29 KiB, done.
Resolving deltas: 100% (79/79), done.
[root@ip-172-31-30-151 ~]# ls
git-2.0.4.tar.xz  hardening
[root@ip-172-31-30-151 ~]#


Enjoy!
.Alex

P.S. Is there a undiscovered flag?

martes, 15 de julio de 2014

Install haveged on Centos 6 / Install EPEL on centos 6

To install haveged on centos you first need EPEL installed:

1. To install EPEL on x64 do:

# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm

For more distros to install EPEL take a look to:
http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/


2.- Install haveged:

# yum install haveged

Enjoy!
P.S. We all need a flag that describes us.

Configure Dynamic IP on Centos 6.5 -Virtual Box-

Step by step


1.- Edit settings:

#vi /etc/sysconfig/network-scripts/ifcfg-eth0

2.- Your setting will be like these: (Don't change the HWADDR)

HWADDR=08:00:27:08:47:E9
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
NM_CONTROLLED=no

2.- Execute: ifconfig eth0
      Make sure that the HWaddr corresponds to the one at ifcfg-eth0. If not, then you want to update the file.

3.- Look at: /etc/udev/rules.d/70-persistant-net.rules that should have also the same HWAddr

4.- Take a look to the Virtual Box Settings ->  Network Mac Address to have the same HWaddr

5.
Make sure that your Networks setting in virtual box for your VM is configured as "Bridged adapter" and "wlan0" as the network adapter name.

6.-
If ifconfig is not giving you a network IP, then try
#dhclient eth0


7.- If you have eth1 then run
#dhclient eth1

4.- Restart network

# service network restart

5.- Review your new IP

# ifconfig -a

6.- ping 8.8.8.8 and you will have response





IMPORTANT: One more tip!!! If you are planning to do ssh make sure openssh-clients is installed

Enjoy!
P.S. What is the most expensive flag?

Installing Centos 6 on Virtual BOX

Step by step:

Go to Centos mirrors:

http://isoredirect.centos.org/centos/6/isos/x86_64/

NOTE: For Centos 7 go to: http://isoredirect.centos.org/centos/6/isos/x86_64/ 

Choose the mirror you want.. and you will see a list of isos and torrents to download:

Then Download the two *-binDVDX.iso files ... or by torrent if you feel more comfortable.



CentOS-6.5-x86_64-bin-DVD2.iso


Now Open Virtual Box.

Create a new vm, the wizzard will let you choose the memory and storage to assign. then finish the wizard

Once the files are downloade goto to the setting s of your VM, and on storage-> Storeage->tree look for the iso of disk1 (by clicking the small disk icon with a arrow to display the option to select from disk the iso).


Then start the VM, the installation process will start, just follow the instructions and enjoy.


P.S. Do you pay attention to the flags?

lunes, 14 de julio de 2014

Installing dkms on CENTOS 6

Has being a while but I am back...

Installing dkms on CENTOS 6.. it is easy ... just find the package you need download and install.


root@ip-172-30-0-42 ec2-user]# wget http://linux.dell.com/dkms/permalink/dkms-2.2.0.3-1.noarch.rpm
--2014-07-14 16:20:50--  http://linux.dell.com/dkms/permalink/dkms-2.2.0.3-1.noarch.rpm
Resolving linux.dell.com... 143.166.224.62
Connecting to linux.dell.com|143.166.224.62|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 108241 (106K) [application/octet-stream]
Saving to: “dkms-2.2.0.3-1.noarch.rpm”

100%[==================================================================>] 108.241      457K/s   in 0,2s  

2014-07-14 16:20:50 (457 KB/s) - “dkms-2.2.0.3-1.noarch.rpm” saved [108241/108241]

[root@ip-172-30-0-42 ec2-user]# rpm -i dkms-2.2.0.3-1.noarch.rpm
[root@ip-172-30-0-42 ec2-user]#

.Enjoy
P.S. There should be a FIFA world cup flag!!!

viernes, 14 de marzo de 2014

Redhat memory stress tool

Hey there again...  If you need to exhaust the linux OS memory to its limits there is an useful tool at: http://dl.fedoraproject.org/pub/epel/6/x86_64/repoview/stress.html



Step 1 Get the tool
Step 2 Build/Install it
Step 3 Execute it

# wget http://dl.fedoraproject.org/pub/epel/6/x86_64/stress-1.0.4-4.el6.x86_64.rpm

# sudo rpm -ivh stress-1.0.4-4.el6.x86_64.rpm
warning: stress-1.0.4-4.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing...                ########################################### [100%]
   1:stress                 ########################################### [100%]#

# stress --cpu 8 --io 4 --vm 2 --vm-bytes 128M --timeout 10s
stress: info: [1523] dispatching hogs: 8 cpu, 4 io, 2 vm, 0 hdd
stress: info: [1523] successful run completed in 10s
#

Enjoy!
P.S. Currently there is a proposal to change New Zealand flag








Ubuntu memory stress tool

Hey there again...  If you need to exhaust the linux OS memory to its limits there is an useful tool at: http://people.seas.harvard.edu/~apw/stress/

You can find the most accurate information there for that tool. I found there places with follow steps and these were not updated, so in a while mine also might be obsolete, anyway here we go:

Step 1 Get the tool
Step 2 Build/Install it
Step 3 Execute it

# wget http://people.seas.harvard.edu/~apw/stress/stress-1.0.4.tar.gz
# tar -xvf stress-1.0.4.tar.gz
# cd stress-1.0.4
# ./configure
# make
# sudo make install


# stress --help

# stress --cpu 8 --io 4 --vm 2 --vm-bytes 128M --timeout 10s
stress: info: [4487] dispatching hogs: 8 cpu, 4 io, 2 vm, 0 hdd
stress: info: [4487] successful run completed in 10s
alex@acer-kozlex:~/tmp$

note: make sure you have gcc installed #yum install gcc

Enjoy!
P.S. Currently there is a proposal to change New Zealand flag