Custom Search

Saturday, October 25, 2008

Limiting the number of user processes in Fedora/Linux

Limiting user processes is is very important for running a stable system.
To limit user process just add user name or group name or all users to /etc/security/limits.conf file and impose process limitations.

For example:
# To impose a process limit of 500, on "cse" group, add the following line to the file.
@cse hard nproc 500

# To impose a process limit of 100, on user "galvin", add the following line to the file.
galvin hard nproc 100

For more information see the man page, command is "man limits.conf"


Tuesday, August 5, 2008

Reverse command of cat is tac, head is tail, cut is paste...

cat filename shows the content of the file.
But "tac"? What it does?
It displayes the file in reverse order.
So funny!! Why they had implemented so??

Try "head & tail" command and "cut & paste" command.
For details see man pages!!

Accessing a file whose first character of the filename is "-"

A file with name "-file.txt" can not be accessed by the commands like "cat -file.txt" or "vi -file.txt".

But can be accessed using "cat ./-file.txt" or "vi ./-file.txt"
So if anynoe does not know the meaning of "./" will not be able to access the file!!
Its really funny!!!

Adding an admin account in Linux/Fedora

Multiple "Admin" account is possible in Linux.

First create an account & set the password.
Commnad: useradd -g users admin1 [Create a user with name admin1 in users group].

Now edit the corresponding line in /etc/passwd file.
Put zero in third field(user id) and zero in forth field(group id).
Save the file

Now log on to the system with this new account.
You will get "#" prompt!!

Limit number of telnet connection from a client

You can specify how many telnet connections are allowed to a telnet server from a host.
This can be done using the Firewall tool "iptables" and its module "connlimit".

The configuration for doing this is:

iptables -A INPUT -p tcp --syn --dport 23 -m connlimit --connlimit-above 3 -j REJECT

The above command will allow only 3 concurrent telnet connection from a host.

Friday, August 1, 2008

Increase or decrease number of telnet session on Linux/Fedora

Edit the file /etc/xinetd.conf.
Change the parameter "instances" to a suitable value you need.
Save the file.
Restart xinetd service. [Command: service xinetd restart]

Monday, July 28, 2008

Optimizing MySQL Performance With MySQLTuner

MySQLTuner is a high-performance perl tuning script that will provide you with a report of a MySQL server’s health. Based on the statistics gathered, MySQLTuner will provide specific recommendations that will increase a MySQL server’s efficiency and performance. The script gives you automated MySQL tuning that is expected on the level of what you would receive from a MySQL DBA.

Installation:
Download perl script --->> wget http://mysqltuner.com/mysqltuner.pl
Change file permission --->> chmod +x mysqltuner.pl
Run --->> ./mysqltuner.pl

Install the Flash Plugin with Firefox on IBM XSeries X86_64

Follow the instruction from http://www.linuxheadquarters.com/howto/64-bit/flash64.shtml to download, install & enable flash plugin.

Thursday, July 24, 2008

Intel® PRO/100 Network Adapter -- Device eth0 does not seem to be present, delaying initialization

Device eth0 does not seem to be present, delaying initialization ---

Some Intel Pro 100/1000 Network Adapter for PCI/PCIX slots comes without any EEPROM!!
This can be tested easily using dmesg command.
I faced such problem with a 100mpbs Intel® PRO/100 Network Adapter (PCI) with Fedora 6 (x86_64).

The command is dmesg | grep "e100" [for 100mbps cards]
The command is dmesg | grep "e1000" [for 1000mbps cards]

Result of the command in my case was:
e100: 0000:00:0d.0: e100_eeprom_load: EEPROM corrupted
e100: probe of 0000:00:0d.0 failed with error -11

The easiest way to overlook this failure is add some options to /etc/modprobe.conf file

alias eth0 e100
options e100 eeprom_bad_csum_allow=1

I added the green line above in the file /etc/modprobe.conf. Then simply restarted the system.
Yes now the problem is solved & the Network Adapter is now usable.

Thursday, July 17, 2008

Prevent ping/icmp attack using kernel parameter

Prevent ping/icmp attacks using kernel parameter

Write the following line in the file "/etc/sysctl.conf"
net.ipv4.icmp_echo_ignore_all = 1
Save the file & restart network service [command: service network restart]
OR
Save the file & run "sysctl -p"

We can also change the value of this runtime kernel parameter to 0 (zero) using the command:
echo "0" > /proc/sys/net/ipv4/icmp_echo_ignore_all

If the value is "1" -->> The system will ignore all icmp/ping requests.
If the value is "0" -->> The system will accept all icmp/ping requests.

Ext4 FS and File System Encryption in Fedora 9

New Ext4 File System support in Fedora 9

New features in Ext4 File System:

>> Delayed Allocation
>> Uninitialized groups
>> Online Defragmentation

More details at: http://fedoraproject.org/wiki/Features/Ext4

Encrypted File Systems

Now users don't have to bother to use a third party software to encrypt their files. This new feature will take care of data security.
Its a good and importance news for laptop users.

More details at: http://fedoraproject.org/wiki/Releases/FeatureEncryptedFilesystems



Tuesday, July 15, 2008

Installing Skype on Fedora 7

Installing Skype on Fedora 7
Instating Skype on Fedora is easy. The dependencies are only qt-4.4To install Skype using yum,

I have created a file called “skype.repo” in “/etc/yum.repos.d/” directory with the following content.

[skype] name=Skype Repository baseurl=http://download.skype.com/linux/repos/fedora/updates/i586/ gpgkey=http://www.skype.com/products/skype/linux/rpm-public-key.asc

Then, I have used the command “yum install skype” to download & install Skype and its dependencies (qt4 & qt4-x11).

Note: It may fail to install Skype with the error “GPG key parsing failed: No key found in given key data”.
If it is so, download the Skype rpm file from http://www.skype.com/download/skype/linux/choose/
Then install using “rpm –i skype-2.2.0xxxxxxxx.rpm”

Thursday, July 10, 2008

Fedora hangs to start X on IBM xSeries

Fedora hangs to start X on IBM xSeries

I have found some problem with Fedora & IBM xSeries 225, 226.
After Fedora installation (I have tried Fedora 6, 7, 9) when the server starts in GUI mode (runlavel 5), the machine hangs forever.


I have tried several tips & tricks. But failed. One day I found Fedora supports color Depth 15.
So I applied that.
And I got the success.
I have followed the following to do that.

I had to start the server in runlevel one (1). [Note: you can start in runlevel 3 also]
Then, change the line following line in /etc/inittab file
id:5:initdefault:
as
id:3:initdefault:
so that, the server can start in CUI mode every time it boots.

Then I changed the display configuration file "/etc/X11/xorg.conf ".
Then, changed the color Depth to 15 in each "Display" SubSection.

Then I had used "reboot". Now I am ready in runlavel 3.
Then, after login, I used "startx" to enable GUI mode.


Create a Local yum repository

Create a Local yum repository
Current Fedora distributions are installed with default yum configuration. Default yum configuration will search for packages from fedora or fedora mirror sites. So it will be slow.
But I can customize yum configuration to search from Local repository.
To do that, I have followed the steps from: http://tqmcube.com/repo.php
You can try this page also: http://dotancohen.com/howto/yum_repo.html

Playing mp3 and wma on Fedora

Playing mp3 and wma on Fedora
The default distribution of Fedora can’t supply the required library & player to play mp3 & wma files due their copyright & licensing issues.
But I can play it easily by installing three packages.
I have used the command “yum install xmms xmms-mp3 xmms-wma” to install the player and library.
Now I can play those files.
Run “xmms” from any terminal & open the file to be played.
I have created a link to xmms on my Desktop.
Note: If you fail to install it using “yum”, you can download the latest packages from http://freshrpms.net/packages/ , and then you can install them manually.

Monday, July 7, 2008

USB device identification using Linux/Fedora

USB device identification using Linux/Fedora.
A device has a Vendor ID (VID) & a Product ID (PID).

To check,

use the command "tail -f /var/log/messages"

This will show the last 10 lines of this file.

Now plug the USB device to any usb port.

Wait & see the changes on the conmmand screen.

Now press Ctrl+C

Then,use the command "lsusb" to get the BUS ID & Device ID (VID & PID)
.

My Pen Drive has the following info,
# lsusb
Bus 005 Device 008: ID 0457:0151 Silicon Integrated Systems Corp. Super Flash 1GB Flash Drive
Bus 005 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000

Which tells VID =0457 & PID = 0151
Visit http://www.linux-usb.org/usb.ids to get updated list of supported USB devices with IDs.

Find out a package which a file belongs to

Find out a package which a file belongs to
If some files are deleted or corrupted from Linux system, such as /bin/bash, /bin/mount then how can I find these file belongs to what RPM?Just use the command "rpm -qf /bin/bash" , this will report the name of the package (bash-3.2-9.fc7 in my system) which contaions the file.
 
Watch the latest videos on YouTube.com