Showing posts with label Fedora. Show all posts
Showing posts with label Fedora. Show all posts

September 24, 2009

KDE4 Python based plasmoids problem and Solution

Actually I had problem running some cool widgets in kDE4

I'm now running fedora 10

and I was depressed why this message appears
" Could not create a python Script engine ............ "

so I asked "3am Google" and he answered it ;)

in Bug 497275 - Python based plasmoids under KDE4

the solution was easy just install the right package ;)
yum install kdebase-workspace-python-applet

Done and I'm having fun ...

Now I'll search for the solution for the KDE ruby based widgets :))

February 03, 2009

YUM segmentation fault in fedora 10 >>> It's Fix

the Problem

While I was updating my fedora 10. I accidentally restarted my PC.
after restating the PC. I tried to update the packages by package managers it takes too long.
I used the # yum update  command it give me the error message "Segmentation fault" and aborts.

I searched for the solution and found this one.

the reason

this error is a result of a corruption in RPM Database Files located int /var/lib/rpm/
 
how i fixed it

by executing the following commands ( while I'm root )

# rm -f /var/lib/rpm/__db*
# rpm --rebuilddb

It worked for me hope it works for you too ;)

more details about this problem and RPM DB Recovery

RPM DB Recovery in Details (RHEL 3 )

Working With the RPM Database (Fedora)

How to "repair" /var/lib/rpm/Packages

the solution posted here was found in the following link
yum Segmentation fault

December 15, 2008

HowTo DHCP your Linux machine

Dear IsmailiaLUG members,

Secondly this article is about the DHCP server

Sure first you should to have the DHCP server in your Linux box
If you don't have it ,Use yum command to get it from the repository
other wise Download the source code ,extract it and then use ./configure ,make and make install
Or you simply download rpm from http://freshrpms.net/ or http://rpmfind.net/linux/RPM/

First i'l like to give you a background about What is DHCP SERVER
Dynamic Host Configuration Protocol (DHCP)
Automatically assigns IP addresses and other network configuration information subnetmask, broadcast address, GateWay etc to computers on a network
A DHCP client send a broadcast request to the DHCP server requesting an address

DHCP assignment:

1. Lease Request: Client broadcasts request to DHCP server with a source address of 0.0.0.0 and a destination address of 255.255.255.255. The request includes the MAC address which is used to direct the reply.
2. IP lease offer: DHCP server replies with an IP address, subnet mask, network gateway, name of the domain, name servers, duration of the lease and the IP address of the DHCP server.
3. Lease Selection: Client receives offer and broadcasts to al DHCP servers that will accept given offer so that other DHCP server need not make an offer.
4. The DHCP server then sends an ack to the client. The client is configured to use TCP/IP.
5. Lease Renewal: When half of the lease time has expired, the client will issue a new request to the DHCP server.

Note:
You should to be root to configure and run DHCP server
You Should to have this information
Ethernet ID (eth0 ,eth1,eth2,etc)
IP address ( Server Ip address that connected to the LAN )
Ethernet MAC address ( 00:00:00:0D:11:D4 )

You can know this information as following :
You will know all this information by using this command ( ifconfig -a )

The Magical file here named as " dhcpd.conf "
All work will be with this file " dhcpd.conf " ---> /etc/dhcpd.conf
You can before we start working with dhcpd.conf you can check a sample start up script for the DHCP server.
/usr/share/doc/dhcp-4.X/dhcpd.conf.sample
This file have every thing about DHCP configuration
We can do a tip ,
for easy configuration the file we can copy the sample file to /etc/dhcpd.conf
Using the following command
cp -f /usr/share/doc/dhcp-4.X/dhcpd.conf.sample /etc/dhcpd.conf
then open and modify the /etc/dhcpd.conf this will be easiest to configure
To run DHCP server it's so sample but you should to have background about networking specially ip range

lets start explain what inside the /etc/dhcpd.conf file and how to understand the file
The script will be written as follow

The ddns-update-style parameter
ddns-update-style style;
The style parameter must be one of ad-hoc, interim or none.
The ddns-update-style statement is only meaningful in the outer scope it is evaluated once after reading the dhcpd.conf file,
rather than each time a client is assigned an IP address, so there is no way to use different DNS update styles for different clients.


ddns-update-style none;
ddns-updates off;
option T150 code 150 = string;
deny client-updates;
one-lease-per-client false;
allow bootp;


subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.128 192.168.1.254; # Range of IP addresses to be issued to DHCP clients
interface eth1; #Assign the ethernet eth1 to be the ethernet who connected to LAN
option subnet-mask 255.255.255.0; # Default subnet mask to be used by DHCP clients
option broadcast-address 192.168.1.255; # Default broadcast address to be used by DHCP clients

option routers 192.168.1.1; # Default gateway to be used by DHCP clients
option domain-name "your-domain.org"; #Here to assign a domain name if you have
option domain-name-servers 40.175.42.254, 40.175.42.253; # Default DNS to be used by DHCP clients
option netbios-name-servers 192.168.1.100; # Specify a WINS server for MS/Windows clients.
# (Optional. Specify if used on your network)

# DHCP requests are not forwarded. Applies when there is more than one ethernet device and forwarding is configured.
# option ipforwarding off;

default-lease-time 21600; # Amount of time in seconds that a client may keep the IP address
max-lease-time 43200;

option time-offset -18000; # Eastern Standard Time
# option ntp-servers 192.168.1.1; # Default NTP server to be used by DHCP clients
# option netbios-name-servers 192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless you understand Netbios very well
# option netbios-node-type 2;

# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;

# We want the nameserver "ns1" to appear at a fixed address.
# Name server with this specified MAC address will receive this IP.

host ns1 {
next-server ns2.your-domain.com;
hardware ethernet 00:02:c3:d0:e5:83;
fixed-address 40.175.42.254;
}

# Laser printer obtains IP address via DHCP. This assures that the
# printer with this MAC address will get this IP address every time.

host wkstn1 {
hardware ethernet 00:00:00:0D:11:D4;
fixed-address 192.168.1.1;
}
}

---------------
Each bit of information a DHCP server leases to a client is known as an "option."
Some options are considered to be "global," meaning that each DHCP client in the local network will receive that option as part of their lease.
Some options are should to be in the same ip range such as subnet.
subnet 192.168.1.0
For example, the option for the IP address of the default gateway Shold to be as ip range in the local network
option broadcast-address 192.168.1.255;
option routers 192.168.1.1;
as a default gateway must live on the same subnet as the client.
the options are considered to be "global,"
option domain-name-servers 40.175.42.254, 40.175.42.253;
as every computer in the network will share the same domain name and will use the same DNS servers.
option domain-name "your-domain.org";

Some DHCP client software requests a lease time.
the server will assign the lease with the
default-lease-time 21600;
But only up to the
max-lease-time 43200;
Both values are in seconds.

This option allow DHCP server to write all of its logging events to the system log file, or /var/log/messages.
log-facility local7;
local7 refers to a locally defined log file


Now we get to the meat of this file, the "subnet declarations." A DHCP server needs to know which network or subnet IDs your network contains.
Additionally, for each network or subnet, it needs to know which "pool" of addresses it is allowed to lease out to the devices on that segment of the network.
It is helpful to sketch out your network ahead of time, so you know which addresses are available for DHCP clients and which addresses are unavailable because they are already statically assigned.
subnet 192.168.1.0 netmask 255.255.255.0 {
}

But here we have a case if we needn't to write all of that
We here have a minimum script to run your DHCP server as well as you need

ddns-update-style none;
ddns-updates off;
option T150 code 150 = string;
deny client-updates;
one-lease-per-client false;
allow bootp;

lease-file-name "/var/lib/dhcpd/dhcpd.leases";
authoritative;

default-lease-time 86400; # 24 hours
max-lease-time 172800; # 48 hours

host wkstn1 {
hardware ethernet 00:00:00:0D:11:D4;
fixed-address 172.1.1.5;
}
subnet 192.168.1.0 netmask 255.255.255.0 {
interface eth1;
range 192.168.1.128 192.168.1.254;
option routers 192.168.1.100;
option domain-name-servers 192.168.1.2 , 192.168.1.1;
}


Hope i success to share my information as well
Please if you have any note about my article You can welcome asking me
Note: all this configuration is based of Fedora
references
http://www.onlamp.com/pub/a/bsd/2003/05/01/FreeBSD_Basics.html?page=1
http://en.wikipedia.org/wiki/Dhcp
http://www.dhcp.org/
http://www.yolinux.com/TUTORIALS/DHCP-Server.html

Thank you
Sherif Sayed

December 08, 2008

HowTo Gateway your Linux machine

Dear IsmailiaLUG,

How are you ... ?

At this days i configure a server(Ofcours Fedora)
The services it should to run is (Gateway,DHCP,DNS,Samba,HTTP,Database)
And in the time i configure this services i'll write howto RUN this services

All i just finished of this services is the Gateway
So that let's start with Gateway machine
Th
e target of gateway here is to make your LAN client connect to the Internet throw your machine

First you need two physical Ethernet in your machine
One of them will connect to ISP and the other one will connect to LAN

eth0 #Connect to your LAN
eth1 #connect to Your modem (ISP)

Now your machine connected to ISP throw eth1
And you have your LAN clients connected to you throw eth0

All we need now is FORWARD packets from LAN (eth0) to World wild(ISP) and back throw my machine
Th
is mation can done by iptables because as you see we need to FORWARD packets from eth0 eth1 to and back

Basically we need to have two sets of rules
*Allow outgoing packets from the LAN (via eth0)
*Allow established connections to return

Note:
I'll explain here each rule of gateway only i'll ignore any other cases
The command starts with iptables ,Be careful don't copy the rule line number

# Always accept loop back traffic it's safe
1- iptables -t filter -A INPUT -i lo -j ACCEPT

# Allow established connections, and those not coming from the outside
2- iptables -t filter -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
3- iptables -t filter -A INPUT -m state --state NEW -i ! eth1 -j ACCEPT

1- iptables -t filter -A FORWARD -i eth1 -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT


# Allow outgoing connections from the LAN side.
2 -iptables -t filter -A FORWARD -i eth0 -o eth1 -j ACCEPT


# Masquerade.
1 - iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE


And after you enter this rules in iptables run this commend
/etc/init.d/iptables save
Or
iptables-save

Th
en run this commend for enable routing.
echo 1 > /proc/sys/net/ipv4/ip_forward

#This's the explain of the iptables commends

iptables -t filter -A INPUT -i lo -j ACCEPT
Accept all connections (traffic) come from localhost


iptables -t filter -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
Accept all connection that they status is ESTABLISHED or RELATED
ESTABLISHED and RELATED means the connection requested from my machine and the answer of the request is RELATED or ESTABLISHED connection


iptables -t filter -A INPUT -m state --state NEW -i ! eth1 -j ACCEPT
Accept all NEW connection that not come from eth1

iptables -t filter -A FORWARD -i eth1 -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
Accept any ESTABLISHED or RELATED connection that come World wild to eth1 and forward it to eth0

iptables -t filter -A FORWARD -i eth0 -o eth1 -j ACCEPT
Accept any connection come from eth0 forwarded to eth1

iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
MASQUERADE eth1
Source Network Address is eth1
rewrite the Source address in the header of the packet
Forwarding all packets going out from our local network(eth0) to the World Wild (eth1) of the Internet connection.


Note About masquerade :
masquerade target is used only in POSTROUTING chain in nat table
masquerade target as snat target but with a little difference
to use snat you should to have a static ip address
But with masquerade does not require any ip address
masquerade made for working with dynamic ip address

Note:
The all this configured under Fedora distribution

Some references:
http://iptables-tutorial.frozentux.net/iptables-tutorial.html#NATINTRO

http://www.debian.org/doc/manuals/reference/ch-gateway.en.html

http://www.linuxquestions.org/questions/linux-networking-3/gateway-problems-on-fedora-c6-533657/

http://www.debian-administration.org/articles/23
---
Please if you need to ask any thing about gateway you can write me back
Wait for me in DHCP
Thank you
Sherif Sayed

April 12, 2008

Control network speed

we can control the speed of the the enthernet card by using the " ethtool "
which allow us to configure Ethernet card on Fedora :)

common options

-s  ---> allows changing some or all settings of the specified Ethernet device. All following options only apply if -s was specified.

speed 10|100|1000 ---> Set speed in Mb/s. ethtool with single argument will show you the supported device speeds.

duplex half|full --> Set full or half duplex mode.

port tp|aui|bnc|mii ---> Select device port.

autoneg on|off ---> Specify if autonegotiation is enabled.

In the usual case it is, but might cause some problems with some network devices, so you can turn it off.

Example :

# ethtool -s eth0 speed 100 duplex full autoneg off

--
Thanks
Mohamed Nasr

February 23, 2008

yum basics

The main syntax is :
yum [options] [command] [package ...]

To use yum, become root, and then you can use the following commands:

To see a list of available software:
yum list available

To install some software, you type:
yum install packagename

To update some software, you type:
yum update packagename

NOTE :If you leave out "packagename" yum will update all your software.

To see what updates are available, you can do:
yum check-update

To search for a package, you can do:
yum search word

To remove package already installed, you type:
yum remove packagename
or yum erase packagename

To list information about available packages or spsific Package.
yum list packagename
or yum list packagename*
or yum list word*


[OPTIONS]

-h, --help
Help; display a help message and then quit.

-y
Assume yes; assume that the answer to any question which would be asked is yes.
Configuration Option: assume-yes

-q, --quiet
Run without output. Note that you likely also want to use -y.

-v, --verbose
Run with a lot of debugging output.

--
Thanks
Your's Sincerely
Mohamed Nasr

December 29, 2007

VI text editor :) part1

What is vi? Why does anyone use it? More importantly, why should I use it?

vi is default editor under Unix/Linux, and is therefore shipped with all recent version of Unix/Linux.
This means that whenever you run across a machine that is running a Unix of some sort, you will know that you have a powerful editor at your finger tips.

Why else?

vi is a powerful editor. Also, once you know vi, you can edit files really quickly, as it is extremely economical with the keystrokes.

Due to its different modes for inserting and issuing commands, it is much faster than most non-mode based editors.
It is also a very small editor. Also, it can do almost anything, as long as you know how to get it to do what you want

Wow! This sounds great! Is there any reason not to use vi?

Yes. There is a very good reason. It can be somewhat hard to learn, and until you do so.
it will be slow and painful. Once you learn it, it will be faster, but the process of learning it is slow.
I've been asked if vi was an easy editor to learn?

My general response to this question is:
"Yes, some of us think so. But most people think that we are crazy."


The 3 Modes of VI

The first thing most users learn about the VI editor is that it has 3 modes:

command, insert and excute.
1 - Command Mode
allows the entry of commands to manipulate text.( copy , delete ,past , cut ...etc )
These commands are usually one or two characters long, and can be entered with few keystrokes.

2 - Insert Mode
puts anything typed on the keyboard into the current file. (insert text ...etc )

3 - Excute Mode
Commands Used to (save , quite , search , load file ... etc )

================

VI starts out in command mode. There are several commands that put the VI editor into insert mode.

The most commonly used commands to get into insert mode are (a and i). These two commands are described below.

Once you are in insert mode, you get out of it by hitting the escape key.
If your terminal does not have an escape key, ^[ should work (control-[).

You can hit escape two times in a row and VI would definitely be in command mode.
Hitting escape while you are already in command mode doesn't take the editor out of command mode. It may beep to tell you that you are already in that mode.

to use excute mode
- from command mode typethe ":"befor the commands


=======================================================
How to Type Commands in Command Mode ?

The command mode commands are normally in this format:(Optional arguments are given in the brackets)

[count] command [where]

Most commands are one character long, including those which use control characters.
The commands described in this section are those which are used most commonly the VI editor.

The count is entered as a number beginning with any character from 1 to 9. For example, the x command deletes a character under the cursor. If you type 23x while in command mode, it will delete 23 characters.

Some commands use an optional where parameter, where you can specify how many lines or how much of the document the command affects, the where parameter can also be any command that moves the cursor.

December 05, 2007

Configure Your Network

To configure your network you need to be root by using the su command
also you need some information about your network like

your IP, subnet mask , DNS IP , Gateway IP

NOTE : our common networks use its routers as DNS & GateWay in the same time
but some ISP provide it's own DNS.

in this article we will use the fellowing data as example :

IP : 192.168.1.200
SUBMASK : 255.255.255.0
GATEWAY : 192.168.1.1

DNS : 192.168.1.1 <---- your ISP may provide you with other IP


===============================
We will need to edit 2 files :

1. network card configration file : /etc/sysconfig/network-scripts/ifcfg-eth0
2. DNS configration file : /etc/resolv.conf

===============================
Frist : Edit Network configartion file
===============================
using the command :

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

enter the fellowing lines :
IPADDR=192.168.1.200
NETMASK=255.255.255.0
GATEWAY=192.168.1.1

the change the fellowing line to :
BOOTPROTO=none <---- "if not exist create it" so your file maybe like the image


then save & exit
===============================
Second : Edit DNS configration file
===============================
vi /etc/resolv.conf

enter the fellowing line

nameserver 192.168.1.1

NOTE : every line have one DNS IP and you may add mor than one like the fellowing image i add 3 DNS servers



then save & exit.

to changes take effect you must restart your network deamon

/etc/init.d/network restart


Configration is done use your browser& Visit out group & have fun :)

Fedora Overview



If you want information about this system i advice to visit this links it'll answer most of your questions in a Q/A way "simple but efective "

  1. Fedora Overview
  2. Fedora Release Notes
  3. Fedora Frequently Asked Questions
  4. The Unofficial Fedora FAQ <-------- Good One

from
fedora user :)

Share folders to windows users " SAMBA server"

STEP 1: Enable Network Connectivity to the SAMBA Server

Using the Fedora Network Configuration tool you will need to ensure that the ethernet card is enabled and properly functioning. Get quick access to the tool through this command: system-config-network

Once in the Network Configuration tool, you should ensure that your ethernet device is enabled. If it is not, select the eth device and then click on the Edit button. This will allow you to input the vital network adapter settings including: statically set IP address, subnet mask, and gateway. You should also select the top checkbox labeled Activate device when computer starts.




Close and save any changes you've made. The main goal is to ensure you have an ACTIVE and functioning network card on the SAMBA server.

Restart the network services or simply reboot your SAMBA server. Now try a ping to the server from another PC on the same subnet. At a command prompt, for example, type: ping 192.168.1.200

The ping should come back good validating your network connection. If you need more Linux system administration help read my Admin Commands List.


STEP 2: Enable SMB Services

the SMB daemon and other core services are usually NOT started by default. You will need to change this so that your SMB daemon is now started.

Using the GUI from the main menu, go to System Settings, then Server Settings, then choose Services. You can also get to this using the command: system-config-services



While you're looking over this long list of services, please DISABLE things you know for sure you do not need to run on this SAMBA server. For instance apmd, isdn, etc. But also ensure that key services such as SMB are selected and RUNNING. Select SMB and press the Start button. If it is supposedly already running you can press the Restart button to be sure it is indeed running correctly now.

Now press the Save button to make sure the configuration changes have been saved for future restarts.

Sometimes using the GUI just does not properly restart the SMB daemon. In such odd cases, I want to suggest you force a manual restart from the command line with this command:
/etc/rc.d/init.d/smb restart

STEP 3: Create Server Users & Directories

You will need to ensure that people also have a login to the SAMBA server to do their work. Logins should be provided on an as needed basis. Obviously, in most cases the users accessing the SAMBA server will be a subset of the total users on the Windows business network.

Create user logins with the Gnome User Manager tool in Fedora. You can find this from the main menu by choosing System Settings, then Users & Groups. The command for this is:
system-config-users

Notice this is the first step in creating SAMBA users, which comes later.

Add as many users as you need and then move on to the next part, which is creating directories (aka. folders) for use.

This is such an obvious step most people usually forget to think about it before hand. However, it is very helpful to think ahead what directories you will allow access to on the SAMBA Server for business use. In my case the people needing SAMBA server access will be updating webpages. Therefore, I do not need to add any other folders for file sharing or group interaction. Be sure you add any folders in a reasonable and ordered fashion.


STEP 4: Configure the SAMBA Server

It's time to configure your SAMBA server to allow others on the intranet to login and use the server from Windows or Linux PCs.

From the main Fedora menu, choose System Settings, then Server Settings, then Samba. You can also get to this tool by typing the command:
system-config-samba

You are about to make changes to the SAMBA Configuration file called smb.conf. This file is found under /etc/samba.

A. Begin by Making Changes to the Server Settings

Under the Preference menu item choose Server Settings...



Be sure to include the Windows workgroup name. In the example above the workgroup has been changed to net. Your situation may be different. In many cases naming the workgroup simply workgroup is fine, so long as your Windows PCs connect to this same name.

Under this same window, click on the Security tab. It comes by default with the appropriate settings for a basic SAMBA Server. The Authentication mode should be User. You would need to change this only if you plan to allow logins based on the Microsoft ADS.

NOTCE : If you make it Share it allow users view your shared folders without login <---- Insecure :) Press OK to finish making basic changes to the server. B. Select SAMBA Users Under the Preference menu item choose Samba Users In this window you must Add at least one user who will have access to the SAMBA Server. Notice that only user accounts you created in step 3 should be added to this listing.



Press the Add User button, then from the pull down select a user. Fill out the additional information needed for this SAMBA user. Press OK when finished.

C. Adding A Shared Folder

Under the SAMBA Server Configuration window, you must create at least one SAMBA share directory.

Press the Add button and then the Browse button. Now choose a folder you wish to make available to SAMBA users. Be careful, some folders have permissions settings that do not allow sharing. Now be sure to select the Read/Write option to allow people full access. Don't press OK yet!



You should see your shared folder appear under the listing as shown in the example above.

D. Adding Users

In the same window, select the second tab labeled Access. From here choose the first option labeled Only allow access to specific users and select the users you wish to give access to this specific SAMBA shared folder. Press OK when finished.

You can repeat steps C and D for each new shared folder.

Once completed, please choose File from the menu then choose Quit.

STEP 5: Restart the SAMBA Services

Now you need to restart all SAMBA services. You can use the process found in Step 3, except press the Restart button or use the word restart instead of the word start.

STEP 6: Access the SAMBA Server from Windows

You're now ready to fully utilize your new intranet SAMBA Server for work. On any Windows PC you can access the server by simply going to the main Start menu, choosing Run and typing in the hostname of your SAMBA server. For example: \\linuxserver

Please notice that in the Windows environment you use different slashes and you need to ensure this syntax.



If this does not work, perhaps if the server is not yet included in your DNS, try accessing the SAMBA Server through its IP address: \\192.168.1.200

Obviously you need to use an actual hostname or IP address and not my example.

If all works well you should instantly see a SERVER LOGIN window. Now login using a SAMBA created username.




You should then instantly see the shared folder as well as the individual user's personal folder that exist on the SAMBA Server.



Congratulations, you're done.