Thursday, August 30, 2007

Unnecessary Services FedoraCore7 Home Desktop

I recently installed Fedora Core 7 on 1 of my virtual machine host at home but I noticed that there are many unnecessary services running, eating lot of RAM so I disabled those.
[root@localhost stuff]# service auditd stop
service avahi-daemon stop
service bluetooth stop
service haldaemon stop
service hidd stop
service ip6tables stop
service iptables stop
service mcstrans stop
service mdmonitor stop
service ntpd stop
service pcscd stop
service setroubleshoot stop
service restorecond stop
service firstboot stop
chkconfig --level 0123456 auditd off
chkconfig --level 0123456 avahi-daemon off
chkconfig --level 0123456 bluetooth off
chkconfig --level 0123456 haldaemon off
chkconfig --level 0123456 hidd off
chkconfig --level 0123456 ip6tables off
chkconfig --level 0123456 iptables off
chkconfig --level 0123456 mcstrans off
chkconfig --level 0123456 mdmonitor off
chkconfig --level 0123456 ntpd off
chkconfig --level 0123456 pcscd off
chkconfig --level 0123456 setroubleshoot off
chkconfig --level 0123456 restorecond off
chkconfig --level 0123456 firstboot off
So I got pretty good results while running X,fluxbox and firefox
[root@localhost stuff]# free -m
total used free shared buffers cached
Mem: 193 186 7 0 31 75
-/+ buffers/cache: 79 113
Swap: 511 0 511

Sunday, March 25, 2007

Java Programming in Linux (CentOS) gcj - Part 2

So we have java compiler and java runtime already installed. Let us create a simple program to test these tools. Create file HelloWorldgcj.java
[root@localhost programming]# vi HelloWorldgcj.java

And put the following code in it.
public class HelloWorldgcj {
public static void main (String args[]) {
System.out.println("Hello World! from gcj");
}
}
Compile it as usual by issuing.
[root@localhost programming]# javac HelloWorldgcj.java
Now run your java programme as.
[root@localhost programming]# java HelloWorldgcj
Hello World! from gcj

Java Programming in Linux (CentOS) gcj - Part 1

If you installed CentOS in custom by selecting "everything" or "full" then you got java in development tools. But this java is not the same as SUN Java (j2sdk/jdk/jre). But an open source java runtime and an open source java compiler.
[root@localhost programming]# rpm -qa | grep java
gcc-java-3.4.5-2
gcc4-java-4.0.2-14.EL4
java-1.4.2-gcj-compat-1.4.2.0-27jpp
db4-java-4.2.52-7.1
java-1.4.2-gcj-compat-devel-1.4.2.0-27jpp


Ok so it is gcj so what the heck is gcj?
[root@localhost programming]# java -version
java version "1.4.2"
gcj (GCC) 3.4.5 20051201 (Red Hat 3.4.5-2)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


If you have programmed in java on windows and new to linux you can understand something after reading the above lines. So what about the java compiler?
[root@localhost programming]# javac -version
Eclipse Java Compiler 0.319_R21x, Copyright IBM Corp 2000-2003. All rights reserved.

We got java runtime and java compiler installed for us.

Installing ClamAV (Clam Antivirus) in linux (CentOS) - Part 3

To scan linux filesystem or all the mounted filesystems for viruses/worms(if any) on daily basis. Create a directory to hold the scanning script and quarantine folder
[root@localhost ~]# mkdir -pv /clam/quarantine
mkdir: created directory `/clam'
mkdir: created directory `/clam/quarantine'


Create a bash script to ease the daily virus scanning process.<
[root@localhost ~]# cd /clam
[root@localhost clam]# vi clamscan_report.sh
Put the following content in the script
#!/bin/bash
clamscan --move=/clam/quarantine/ -ril /clam/clamscan_report.txt /
Give it executible permission so that cron is able to execute it.
[root@localhost clam]# chmod u+x clamscan_report.sh
Now open up the crontab file and put this entry
55 7 * * * root /clam/clamscan_report.sh
at the below of the crontab file. Do not forget to keep running your system at 07:55 (7:55 AM) so cron will run the virus scan.

Installing Yahoo Messenger on linux (CentOS)

Go to http://messenger.yahoo.com/unix.php and then download the RH 9 version of yahoo
[root@localhost softwares]# wget http://us.dl1.yimg.com/download.yahoo.com/dl/unix/rh9.ymessenger-1.0.4-1.i386.rpm
After the download is finished install it as usual
[root@localhost softwares]# rpm -ivh rh9.ymessenger-1.0.4-1.i386.rpm
Now go to your

Applications > Internet > Yahoo Messenger


this will do the some pre-configuration steps and your yahoo messenger is ready to be used on Linux.

Installing ClamAV (Clam Antivirus) in linux (CentOS) - Part 2

If you get the virus database older than 7 days warning. Update the database using.
[root@localhost ~]# freshclam
ERROR: Please edit the example config file /etc/freshclam.conf.
WARNING: You must specify at least one database mirror.


In order to make freshclam work we have to edit the freshclam.conf. Uncomment everything in the freshclam.conf file except

"UpdateLogFile /var/log/clamav/freshclam.log"

Also Add this before MaxAttempts 5 line in

/etc/freshclam.conf
DatabaseMirror database.clamav.net


Now freshclam should work if this is 1st time you ran freshclam it will take a while to finish
[root@localhost ~]# freshclam
To ensure that the virus database is current and updated. You can put the freshclam in cron if you like but i like to update it manually so i do not add it in the crontab.

Installing ClamAV (Clam Antivirus) in linux (CentOS) - Part 1

Open the terminal and issue.
[root@localhost works]# yum install clamd*
This will download and install clamav(clamav engine), clamav-db(clamav virus database) and clamd (clamav daemon). If you are on slow network it is a 9.5MB package and will take a while to come down. Now you can scan any file or folder for viruses and worms. To scan a folder "Personal_Stuff" recursively type the following command on the linux terminal.
[root@localhost ~]# clamscan -vr Personal_Stuff/

Playing MP3 audio files in linux (CentOS)

By default MP3 audio files playback is not supported in linux (Centos) due to licensing issues etc and you will a get a message similar to this "MPEG Layer 1/2/3/ Not Supported." when you play them using XMMS. Just issue the following command on the linux terminal.
[root@localhost works]# yum install xmms-mp3
Now you have the mp3 support in XMMS.

Adding a dag repository in CentOS

Create a file "dag.repo" in the CentOS repository folder.
[root@localhost ~]# vi /etc/yum.repos.d/dag.repo
The dag.repo should contain the following content.
[dag]
name=Dag-RHEL-Yum
baseurl=http://dag.linux.iastate.edu/dag/redhat/el$releasever/en/$basearch/dag
http://www.mirrorservice.org/sites/apt.sw.be/redhat/el$releasever/en/$basearch/dag
http://mirrors.ircam.fr/pub/dag/redhat/el$releasever/en/$basearch/dag
http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
enabled=1
gpgcheck=1
Installing a RPM-GPG-KEY for dag files. 1st Download the dag RPM-GPG-KEY.
[root@localhost works]# wget http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt
Now import the RPM-GPG-KEY as
[root@localhost works]# rpm --import RPM-GPG-KEY.dag.txt
Thats it you successfully added the dag repository.

3ddesktop in Linux(Centos) - 3ddesk Part - 2

So it seems to be comfortable with 3ddesk. You can get the manual of 3ddesk with no surprise.
[root@localhost ~]# man 3ddesk
This manual is very well written, informative and productive. You can get the manual of 3ddeskd (the 3ddesk daemon) by issuing
[root@localhost ~]# man 3ddeskd
On CentOS 4.3 (the os that i am using) you can get the 3ddesk configuration file at the following location.
[root@localhost ~]# vi /etc/3ddesktop.conf
Again i found the file highly documented. In this file you can create your own custom views. I highly recommend to read the above 2 manuals and configuration file.

Friday, March 23, 2007

3ddesktop in Linux(Centos) - 3ddesk Part - 1

Yesterday i was looking for the softwares that will make my linux desktop rich and fancy like the M$ Vista/Longhorn. I knew that this thing is not new to linux and linux is full of these softwares a long long time before M$. So i started searching on google, I stopped at 3ddesktop. I am using CentOS release 4.3 (Final) 2.6.9-34.ELsmp at home. The whole package installation was not more than one command. I issued
[root@localhost ~]# yum install 3ddesktop*
By the way the packages came from dag that I added in my yum repositories. Afterwards I issued.
[root@localhost ~]# 3ddesk --acquire
Finally to see the 3ddesktop in action i typed
[root@localhost ~]# 3ddesk --view=flip
There are very nice details about how to use 3ddesk at linuxreviews. I am still exploring 3ddesk these days along with other softwares so stay tuned.

Wednesday, March 21, 2007

Hello World!
To all of the webloggers (bloggers).
Yes! this is going to be my 1st post on my very 1st blog.
Topics will be related to Linux, PHP, Java and Open Source.