Cool “OLD” Way to Restart RSyslog – Fedora 11

July 23, 2009 by miltonpaiva

#kill -HUP `cat /var/run/syslogd.pid`

Its the same as

#service rsyslog restart

But in a different way

There are another signals, each one can be represented by a number, here is a small list of signals available:

  • HUP = 1
  • KILL = 9
  • TERM = 15

I realized that it did not change the PID of the process and I got an interesting comment about that saying that rsyslog v5 does not support HUP anymore.

sangoku

Compiling the Linux Kernel – CentOS 5.3

July 21, 2009 by miltonpaiva

Steps:

#yum -y  install kernel-devel kernel-headers

#yum -y groupinstall “Development-Tools”

#cd /usr/src

#wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.30.2.tar.bz2

#tar -jxvf linux-2.6.30.2.tar.bz2

#cd /usr/src/linux-2.6.30.2/

#make menuconfig

#make clean

*#make dep (is no more necessary)

#make bzImage

#make modules

#make modules_install

#make install

*make install will copy the files: System.map, vmlinuz and the initial ram disk initrd-2.6.30.2.img to /boot. It will also add the lines you will need on grub, now just restart your computer and choose the new kernel on the grub screen.

Have Fun !!!

centos

Installing Microsoft Fonts on Fedora 11 x64

July 10, 2009 by miltonpaiva

Follow the steps:

1) Install some dependencies using yum

#yum -y install rpm-build cabextract ttmkfdir xorg-x11-xfs

Paul Frields comment that he made a better spec, available here which does no require the chkfontpath dependence.

2) Installing the last dependence not available by yum

#rpm -ivh http://dl.atrpms.net/all/chkfontpath-1.10.1-2.fc9.i386.rpm

3) Making the msttcorefonts rpm

  • Download the file http://corefonts.sourceforge.net/msttcorefonts-2.0-1.spec to the folder ~/rpmbuild/SPECS/
  • cd ~/rpmbuild/SPECS/
  • rpmbuild -bb msttcorefonts-2.0-1.spec
  • rpm -ivh ~/rpmbuild/SRPMS/msttcorefonts-2.0-1.src.rpm
  • rpm -ivh ~/rpmbuild/RPMS/noarch/msttcorefonts-2.0-1.noarch.rpm

Now just open your openoffice the have fun with the new fonts(TImes new roman, verdana, etc …)

[1] http://corefonts.sourceforge.net/

logo_fedoralogo

Vista SP1 32 bits = Nightmare

June 25, 2009 by miltonpaiva

Last week I got a new hard drive, bigger faster, until this point everything was ok. I backup all of my data on an external drive. Then I decided to install everything (Vista and Fedora) again in my dual boot system.

I installed both operational systems, restored  my backup, installed all the programs I like to use until Vista asked me to install the update “Vista Service Pack 1 – SP1″, bad decision :-( Thinking in security I accepted the update, then I got the first error. Looks not usual, then Vista asked me “try again?”  Then mistakenly I clicked in this button :-( bad for me. After this update my windows stop working and did not allowed me even to start my system.

Then I got the recovery disks that come with my laptop, bad disks these ones. They erased all of my partitions erasing the bugged Windows Vista, but as a bonus erasing my Linux system that until this moment has worked with perfection in my system.

Now time to install everything again and again and disabled the automatic updates from Vista, from now all Vista updates will be verified one by one before I install then again.

vista-logo

Fedora 11 x64 – Flash Plugin for Firefox 3.5

June 17, 2009 by miltonpaiva

Installing flash plugin for firefox in a x64 bits system

1) Go to the adobe website:

http://labs.adobe.com/downloads/flashplayer10.html

2) Download the tar ball  libflashplayer-10.0.22.87.linux-x86_64.so.tar.gz

3) Uncompress the tar ball

$ tar  -zxvf   libflashplayer-10.0.22.87.linux-x86_64.so.tar.gz

4) Copy the file libflashplayer.so in to the folder /usr/lib64/mozilla/plugins/

5) Restart you firefox and enjoy

*If you still have some questions about the flash install on FC11, go to the fedora project website http://fedoraproject.org/wiki/Flash

logo_fedoralogo1

Fedora 11 Guides

June 17, 2009 by miltonpaiva

Two interesting links about post installations of FC11:

http://www.fedoraguide.info/

http://www.my-guides.net/en/content/view/161/26/

logo_fedoralogo

Func Verification Method – Release 1.0

April 24, 2009 by miltonpaiva

Release 1.0 is done

  • Submitted to the mailing list
  • Accept and pushed in to the Func Project

At now, preparing for the tomorrow’s presentation  :-)

Thanks Professor Chris Tyler for the supervision and all the help in the whole process.

In my opinion this project was good and very challenging, but it was not as big as I would like it to be :-( .    I will try to think this was the first step in the open source world and the first steps are always the hardest ones. Its like a baby, that first learn how to crawl and later on how to walk. At this point I am taking my first steps.

Project Page

http://zenit.senecac.on.ca/wiki/index.php/Func/Rpms_Module_-_Function_Verify

func-logo-small1

DHCP Server – Fedora 10

April 20, 2009 by miltonpaiva

Configuration file: /etc/dhcpd.conf

#
# DHCP Server Configuration file.
#   see /usr/share/doc/dhcp*/dhcpd.conf.sample
#   see ‘man 5 dhcpd.conf’
#
#
ddns-update-style interim;
ignore client-updates;

subnet 192.168.100.0 netmask 255.255.255.0 {

# — default gateway
option routers            192.168.100.1;
option subnet-mask        255.255.255.0;

option domain-name        “milton.ca”;
option domain-name-servers    192.168.100.1;

#option ntp-servers        192.168.1.1;

range dynamic-bootp 192.168.100.10 192.168.100.20;
default-lease-time 7200;
max-lease-time 56800;
}

host freebsd2 {
hardware ethernet 08:00:27:9E:66:67;
fixed-address 192.168.100.252;
}

Set up the dhcpd for auto start on boot time

#chkconfig dhcpd on

You could also set up in which interface will dhcp server run in the file:

/etc/sysconfig/dhcpd

Func Verification Method – Release 0.9

April 18, 2009 by miltonpaiva

Release 0.9 is done, now with glob integration !!!!

The new code is available at:

http://func.pastebin.com/f75c77458

—————————-

def verify(self, pattern=”, flatten=True):
“”"
Returns information on the verified package(s).
“”"
import rpm
import yum
from re import split
ts = rpm.TransactionSet()
mi = (ts.dbMatch() if pattern == ” else self.glob(pattern))
results = []
for hdr in mi:
name = hdr['name'] if pattern == ” else split(“\s”,hdr)[0]
if flatten:
yb = yum.YumBase()
pkgs = yb.rpmdb.searchNevra(name)
for pkg in pkgs:
errors = pkg.verify()
for fn in errors.keys():
for prob in errors[fn]:
results.append(‘%s %s %s’ % (name, fn, prob.message))
else:
results.append(“%s-%s-%s.%s” % (name, version, release, arch))
return results

—————————-

Now is possible in my method to verify all the packages on the system or even only one !

func-logo-small1

VPN with OpenSwan on Fedora 10 x64

April 12, 2009 by miltonpaiva

The intention of this document is guide you step by step to install openswan on the Fedora Core 10.

=Hardware=

Toshiba Laptop Core 2 Duo with 4 GB of ddr2 667.

=Operational System=

Fedora Core 10 x64
*Default configurations
*Updated

=Installation Process=

To install Openswan in both computers, follow the steps bellow:

==Packages to Install==
*openswan
*ipsec-tools
*curl

#yum -y install openswan ipsec-tools curl

==Generate the keys==

To generate the keys, type the command:
#ipsec newhostkey –output /etc/ipsec.d/keys.secrets –bits 2048 –hostname play2.milton.ca

Remember to do the same procedure in both computers with the proper information.

After that edit the key file and copy the part with the public key and past in the /etc/ipsec.conf, also go to computer B, take its public key and past it in the configuration file.

”’Both computers must have the same configuration file”’

The configuration file of openswan is:

==/etc/ipsec.conf==

# /etc/ipsec.conf – Openswan IPsec configuration file
#
# Manual:     ipsec.conf.5
#
# Please place your own config files in /etc/ipsec.d/ ending in .conf

version 2.0     # conforms to second version of ipsec.conf specification
# basic configuration
config setup
protostack=netkey
# Debug-logging controls: “none” for none, “all” for lots.
klipsdebug=all
#plutodebug=”control parsing”
plutodebug=all
nat_traversal=no
uniqueids=yes
interfaces=”ipsec0=eth0″ # interface that connects the computers

# VPN connections
conn play2
type=tunnel
# Left security gateway, subnet behind it, next hop toward right.
left=200.199.1.1 # output ip of computer A
leftsubnet=192.168.0.0/24 # subnet computer A
# RSA 2048 bits
leftrsasigkey=0sAQNj2pqKQARhiLkYakKhMJoovBacqR+6xh//2Bw2ZsgbOzl+wE5JOlFfTdD8Q+hWnyuULTl9c8O5fkrBcdDGWggF
leftnexthop=200.199.1.1 # gateway of computer A
leftsourceip=192.168.0.1 # internal ip of computer A
rightnexthop=200.199.1.2 # gateway of computer B
# Right security gateway, subnet behind it, next hop toward left.
right=200.199.1.2 # output ip of computer B
rightsubnet=172.16.1.0/24 # subnet of computer B
rightsourceip=172.16.1.1 # internal ip of computer B
# RSA 2048 bits
rightrsasigkey=0zAQOJBXgYPyV3nJ9vxExcYfQd6PfWsVA6ubzZSUDYKdp/TGyvDRcDD43FwqPcKAD+0SAOc/w8b1QdWPY5gBoS0MdB
# To authorize this connection, but not actually start it, at startup,
# uncomment this.
authby=rsasig
auto=add # former argumet = start

include /etc/ipsec.d/*.conf

=Configuring Additional Steps on the OS=

Create the following shell script in the folder /etc/rc.d/ and named it ”’vpn.sh”’

==/etc/rc.d/vpn.sh==

#!/bin/bash
#Thanks Nestor for the script

echo 1 > /proc/sys/net/ipv4/ip_forward
for f in /proc/sys/net/ipv4/conf/*/accept_redirects; do echo 0 > $f; done
for f in /proc/sys/net/ipv4/conf/*/send_redirects; do echo 0 > $f; done

==Add a line in /etc/rc.d/rc.local==
/etc/rc.d/vpn.sh

*Give the proper permissions in the file: #chmod +x /etc/rc.d/vpn.sh

==Initializing openswan==
#service ipsec start

==Verifying the Status==

#service ipsec status

or

#ipsec verify

==Activate the service on boot time==
#chkconfig –level 3 ipsec on

=Final Steps=

==Conectivity Test==

From computer A, try to ping computer B

If it was successfully you vpn is working fine.

Now Let’s stop the vpn
# service ipsec stop

From computer A, try to ping computer B again.

At this moment you are not supposed to ping computer B.

Then start ipsec and try ping from both computers.

To make sure everything is working properly, reboot the computer and repeat all tests.

The ”’tcpdump tool”’ could capture some traffic, just to make sure the traffic is encrypted.

=Logs=
The Logs for the OpenSwan can be accessed at:
/var/log/secure
and
/var/log/messages

=Final Consideration=

Sometimes the files are not  blog friendly, then I have another version of this tutorial available in a wiki format:

http://zenit.senecac.on.ca/wiki/index.php/Milton-vpn-openswan

logo_fedoralogo1

openswanlogo