Downgrade Windows 8 64-bit to Windows 7 32-bit

It happens that I need to downgrade my laptop with windows 8 64-bit and it gives me a headache.

Anyway for those users who wants to downgrade their PC or laptop win 8 64-bit enabled device you may do the following.

1. Backup your Disk, make bootable backup or iso.

2. Prepare your win 7 cd

3. Insert your cd and boot to win 7

4. Do the instruction on this link specially the part of diskpart

What to Do When Windows Cannot Be Installed on the GPT Partition Styled Disk

thanks Kent Chen

5. then continue installing win 7.

Have a great day ^___^

Linux Encryption & Decryption

For us, administrators who work on thousands of data, we are in doubt of how our files are secured properly. Sometimes we think of encrypting the files or backup files that are very sensitive.

In this simple tutorial, you will be able to learn to make the file secured by using encryption and then decrypt the file if needed.

1. Encryption
Let says we want to encrypt the Sample directory with file name Test-only.doc.
A.  First tar the Sample directory
# tar -cvzf Sample.tar.gz Sample/
B.  Then encrypt the file and input your desired password:
# openssl aes-256-ecb -e -a -in Sample.tar.gz -out Sample.tar.gz.enc
enter aes-256-cbc encryption password:
Verifying – enter aes-256-cbc encryption password:
C. The file will be encrypted with extension of .enc
Sample.tar.gz.enc

2. Decryption
A. You may just decrypt it with:
# openssl aes-256-ecb -d -a -in Sample.tar.gz.enc | tar xvzf –
enter aes-256-ecb decryption password:
B. The Sample directory with file Test-only.doc will then be decrypted and will be extracted
# Sample/Test-only.doc

I hope this simple guide helps you! Cheers

SCP – SecureCopy

Simple scp transfer from Server A (Source) to Server B (Destination)

1. Server A

Create a script for scp transfer called scp-filetransfer.sh on /home/admin

#########################################

#!/bin/bash

#Source
DIRA=/home/admin/Documents/
#Destination
DIRB=/home/admin/Backup

/usr/bin/scp -P 22 -r $DIRA root@i p a d d r e s s:/$DIRB

##########################################

2. Server B.

a. If you have firewall script add Server A IP address to ssh to Server B firewall script
Ex.
ServerAIP=”Server A ip address”
PrivatePort=”your private port”
IPaddr=”your public ip address – Sever B”

iptables -A INPUT -p tcp -s $ServerAIP –sport $PrivatePort -d $IPaddr –dport 22 -m state –state NEW,ESTABLISHED -j ACCEPT

b. Allow the directory to be accessible and writable.
cd /home/admin/
Ex.  chmod 750 Backup

3. Add crontab to schedule the transfer
a. crontab -e
b. append to the last line
# BACKUP DAILY 3PM
10 15 * * * /home/admin/scp-filetransfer.sh

Set NIC to use 100 Fullduplex

1. Check the speed used by the NIC

/sbin/ethtool eth1

[root@test]# /sbin/ethtool eth1
Settings for eth1:
Supported ports: [ TP ]
Supported link modes:   10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes:  10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised auto-negotiation: Yes
        Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: g
Current message level: 0x00000001 (1)
Link detected: yes

As you can see Speed is set to 1000Mb/s

2. Now change the speed

Edit /etc/sysconfig/network-scripts/ifcfg-eth1

Add the line on the bottom:
ETHTOOL_OPTS=”speed 100 duplex full autoneg off”

Ex.

# Intel Corporation 82574L Gigabit Network Connection
DEVICE=eth1
BOOTPROTO=static
HWADDR=5C:F3:FC:26:20:2C
ONBOOT=yes
HOTPLUG=no
TYPE=Ethernet
IPADDR=x.x.x.x
NETMASK=x.x.x.x
GATEWAY=x.x.x.x
ETHTOOL_OPTS=”speed 100 duplex full autoneg off”

3. Save the file

4. Restart the network

/sbin/network service restart

5. Once you have change it verify the speed again

[root@test]# /sbin/ethtool eth1
Settings for eth1:
Supported ports: [ TP ]
Supported link modes:   10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes:  Not reported
Advertised auto-negotiation: No
        Speed: 100Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: off
Supports Wake-on: pumbg
Wake-on: g
Current message level: 0x00000001 (1)
Link detected: yes

Speed is now set to 100Mb/s

Updating Intel NIC drivers on linux centos

1. Check first the NIC drivers version. If your drivers is not updated proceed to step 2.

[root@test]# /sbin/lspci | grep Ethernet
0b:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection
15:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection
24:00.0 Ethernet controller: Davicom Semiconductor, Inc. 21x4x DEC-Tulip compatible 10/100 Ethernet (rev 31)

[root@test]# /sbin/ethtool -i eth0
driver: e1000e
version: 1.2.7-k2
firmware-version: 2.0-0
bus-info: 0000:0b:00.0

[root@test]# /sbin/ethtool -i eth1
driver: e1000e
version: 1.2.7-k2
firmware-version: 2.0-0
bus-info: 0000:15:00.0

2. Make sure you have latest kernel

yum update
reboot
yum kernel-devel
yum install kernel-PAE-devel

3. Download latest driver

ex.
wget http://downloadcenter.intel.com/Detail_Desc.aspx?agr=Y&DwnldID=15817&ProdId=3025&lang=eng

4. Untar/unzip archive:

tar zxf e1000e-x.x.x.tar.gz

5. Go to the driver src directory

cd e1000e-x.x.x/src/

6. Compile the driver module:

# make install

The binary will be installed as:

/lib/modules/<KERNEL VERSION>/kernel/drivers/net/e1000e/e1000e.[k]o
ex.
/lib/modules/2.6.18-238.19.1.el5PAE/kernel/drivers/net/e1000e/e1000e.ko

7. Load the module using either the insmod or modprobe command:

a. Removed older e1000e drivers from the kernel, before loading the new module:

rmmod e1000e; modprobe e1000e

b. insmod /lib/modules/<KERNEL VERSION>/kernel/drivers/net/e1000e/e1000e.ko
ex.
/sbin/insmod /lib/modules/2.6.18-238.19.1.el5PAE/kernel/drivers/net/e1000e/e1000e.ko

8. Check the drivers again

# /sbin/ethtool -i eth0/eth1

Heres mine:
[root@test]# /sbin/ethtool -i eth0
driver: e1000e
version: 1.5.1-NAPI
firmware-version: 2.0-0
bus-info: 0000:0b:00.0

[root@test]# /sbin/ethtool -i eth1
driver: e1000e
version: 1.5.1-NAPI
firmware-version: 2.0-0
bus-info: 0000:15:00.0

9. Double check IP on each interface if correct

10. Make a ping test

I hope it helps!

Upgrading OpenSSL

This one works for me on upgrading openssl.

1. Check your openssl version

# openssl version

OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008

2. Download latest version of openssl

http://www.openssl.org/source/

or you may command

wget http://www.openssl.org/source/openssl-1.0.0d.tar.gz

3. Extract openssl-1.0.0d.tar.gz

Go to openssl-1.0.0d directory

# make clean
# ./config shared –prefix=/usr –openssldir=/usr/local/openssl
# make && make test
# make install

4. Done

5. Check the if you you have the latest version

# openssl version

OpenSSL 1.0.0d 8 Feb 2011

Enjoy….. ^__^