Thursday, July 31, 2008

How To Kill Application Process ID (PID) The Faster Way

At times, we need to kill an application immediately for some reasons. Sending a termination signal to a process rehups and kills a process ID (PID). This can easily be done in several ways.

Here are many alternatives way on killing PIDs.

Kill A Process ID

Traditionally, with X installed, one can install a taskbar shortcut named force quit and use that shortcut to a kill an existing application directly by simply left-clicking on the application's window area. Force quit then kills the corresponding application's PID easily.

Next, is by using the linux command kill from terminal. Linux command kill requires an explicitly defined  process ID as a parameter to kill the specific process ID.

Now, here's a faster way to kill a process ID by simply defining the binary name of the program and using pkill from terminal.

PKill Usage

# pkill program-name

For example, launch kopete binary. To kill kopete PID, simply

# pkill kopete

Another example, launch ksnaphot. To kill ksnapshot using pkill

# pkill ksnapshot

Pkill simply looks up the currently specified process name and immediately terminates it.

All is done.

How To Install Fedora 9 From The Internet

Fedora 9 Linux OS can be installed from many variety of ways. There are a lot of Fedora ISOs you can download depending on your system architecture and resources. One of which is that Fedora 9 can be installed via the internet.

Here's how to install Fedora 9 from the internet.

Fedora 9 Installation via Internet

Step One

If you have  x386 users, download Fedora 9 net iso from here. But if you have x86_64, download F9 net ISO from here.

The F9 net ISO is around 115MB in size.

Step Two

Burn the ISO to CD. Insert your CD to your CD drive and reboot from it.

Step Three

Anaconda installer would finally ask you where to get F9 rpm packages and where are they available from.

For x386 users, simply enter

http://download.fedora.redhat.com/pub/fedora/linux/releases/9/Fedora/i386/os/

For x86_x64

http://download.fedora.redhat.com/pub/fedora/linux/releases/9/Fedora/x86_64/os/

Follow the Anaconda wizard type of installation and select all your required software packages. Worry not for dependencies as it would be carefully taken care of.

Relax and get a tea, all will be set in a few moments depending on your internet speed.

All is done.

This post was entirely based from Fedora Forum post. To get F9 CD ISOs, get it here.

How To Install PHP5 and Apache HTTP Server

Apache HTTP server is responsible for most web servers around the world. It empowers most longest running web servers around the WWW. While PHP5 is web development tool you could use to run along with Apache web servers.

Here's a quick and easy way to install Apache and PHP5 on your Fedora boxes.

To install Apache and PHP5, simply launch yum to fetch all necessary rpm dependencies.

Apache Installation

# yum -y install httpd

PHP5 Installation

# yum -y php.i386

Start Apache Service

# service httpd start

Check Apache Service

Fireup your browser and browse your current IP address or your localhost

http://localhost

These files are located under /var/www/ by default installation and setup.

All is done.

How To Display The Number of Processors in Linux

On Linux, /proc/cpuinfo file contains all of the processor information from your system. This includes the processor speed, vendor id, cpu family, model, model name, CPU MHz, cache size and many more.

To mainly determine how many processors your system has, simply parse /proc/cpuinfo details from command line terminal as shown

# cat /proc/cpuinfo | grep processor | wc -l

The above command shows the total number of processors a system currently have.

This command is helpful specially on remote linux servers wherein you don't have physical access and you have nobody to tell you how many processors does that remote server have.

Remember that dual core CPU are reported as a separate processor unit.

How To Prevent Alt+F1 and Alt+F2 TTY Console Login Attempts

Linux multiple consoles are easily accessible from keyboard combinations by simply by hitting Alt+F1 for first TTY console, Alt+F2 for second TTY console up to sixth (Alt+F6) TTY consoles. This console easily brings you linux tty login consoles.

If for some reasons you wish to restrict and prevent any TTY console login attempts with your linux boxes, you can prevent this by closing selective linux TTY consoles.

Disabling Selective Linux TTY Login Consoles

Step One

For example, to close Alt+F1 and Alt+F2 (TTY1 and TTY2) login screen consoles, backup and modify /etc/securetty file and remove the console number tty1 and tty2, as shown below.

tty3
tty4
tty5
tty6

Save and exit.

Step Two

Hit Alt+F1 and Alt+F2 to check if these tty login consoles have been successfully deactivated. No need for restarts.

All is done.

How To Install Text-based File Manager

A decade ago, file operations on operating systems has been really quite eeery and so technical. File deletion, management and operation under MS-DOS and IBM-DOS with black text background tends to scare newbies on doing simple file tasks. Until file manager application has been introduced. One of them was Midnight commander.

If you wish not to use X and still do file management and operations with friendly interface from linux command line, read on.

Midnight Commander is a visual shell much like a text-based file manager, only with many more features. Midnight commander not only works in text mode application but also supports mouse movements and commands. Midnight Commander's best features are its ability to FTP, view tar and zip files, and to poke into RPMs for specific files. Another power feature is the ability to switch back and forth between two disk direction locations panned from left and right pane keeping separate operation tagging at the same time.

Midnight Commander (MC) is a fashioned to be very powerful but user-friendly file manager and visual shell designed both for linux novice and guru alike. MC provides a powerful linux operation, yet maintaining its application's function effectively and productively. Midnight Commander supports both local and remote operation under linux CLI or under X Window system which makes it a powerful and flexible tool on linux plafform.

Midnight commander had definitely helped a lot of us crawling over file management and operations under DOS or linux terminal mode.

Midnight Commander Fedora Installation
Fedora makes application installation quite simple by having a centralized and resynced Fedora repo. MC rpm binary is included and can be installed using yum like so

# yum -y install mc

Midnight Commander Binary Launch

# mc

Webshot:


That is all, enjoy.

Related Readings:
File Management and Operation with Thunar
Linux File Rename

How To Delete Linux Files Older Than 360 days

Searching files recursively for deletion can be real exchausting specially if the target files are queried by their file age. Recursive searching in all linux distribution can be done by using linux find command as find linux command makes recursive searches real easy.

Find command is so powerful that it can actually boosts file management operations specially on recursive file operations.

Here's how to delete files that are older than 365 days from your linux file system.

Find all MP3 files from /home/user folder and delete them if they are more than 360 days old

# find /home/user  -name '*.mp3' -mtime +360 -exec rm {} \;


The above command specifies

/home/user   as the target folder location

*.mp3  as the exact target files to delete, remember linux is case-sensitive

-mtime as find parameter to check for file age

360 as the file age triggerpoint to delete any found file

-exec as a linux command concatenation to execute the next command while doing the first linux command

rm as the linux file delete command

{} \; as the loopback parameter to repeat the search and file deletion back again

To avoid any interaction when deleting files, simply change

rm {}

to

rm -rf {}

Be careful of using this find and delete command, as it does file deletion recursively. This command can be used to clean up old files from FTP and Samba file servers using linux job scheduling.

All is done.

Related Post:

HowTo: Delete All Thumbs.db Recursively

HowTo: Find And Count JPG Files Recursively

Delete Zero-sized Filename Recursively

Find Hidden Linux File Recursively

Move Linux Files Recursively

Rename Linux File Recursively

Delete Files and Folders Recursively

How To Install VirtualBox on Fedora 9

VirtualBox has been recently bought by Sun Inc, the maker of Sun's Java. VirtualBox had proven to do their job when it comes to operating system virtualization. Virtualization using Virtualbox had come to a long way, which enabled every virtual users and system admins to further evaluate different virtual machines to perform its task without even buying any additional hardware.

What is VirtualBox?

VirtualBox is a powerful PC virtualization solution allowing you to run a wide range of PC operating systems on your Linux system. This includes Windows, Linux, FreeBSD, DOS, OpenBSD and others. VirtualBox comes with a broad feature set and excellent performance, making it the premier virtualization software solution on the market.

VirtualBox Installation

Here's how to install VirtualBox to Fedora 9.

Step One

Download VirtualBox binary from Sun site. Choose your proper operating system. To install it into Fedora, Download it here. The download package is about 21MB in size.

Alternatively, you can use yum to install Virtualbox as shown below

# yum -y install VirtualBox

After doing installation via yum, proceed to step three.

Step Two

Install Virtualbox rpm package using rpm package manager

# rpm -ivh VirtualBox-1.6.2_31466_fedora9-1.i586.rpm

Step Three

Execute VirtualBox binary and respond the next installation procedures as shown below

# VirtualBox

Accept VirtualBox license and you are good to go.

All is done.

More VirtualBox info can be found here.

Wednesday, July 30, 2008

HowTo: Delete All Thumbs.db Recursively

An offline messages just arrive from a fedora newbie trying to polish more of his FTP administration skills.

After quite some time of establishing his fully functional FTP server via VSFTP, he then realized that most of their staff with windows-based desktops usually Selects ALL files, Copy and Paste to FTP site, the normal non-techie way. Unaware that selecting all files from currently working windows folder also selects the Thumbs.db file to be uploaded to that same FTP server.

This Thumbs.db file is by the way created by windows OS for the purpose of thumbnailing cached image files, which has a filesize of 23040. If you've 1,000 of that, you just lost 23MB of disk space.

Now, the answer to his question of deleting Thumbs.db file recursively following the same concept with recent postings. This can be simply done using find.


# find ~ftpusername -name "Thumbs.db" -exec rm -rf {} ;


Adding to cron job on every morning or on daily basis would be


01 07 * * * find ~ftpusername -name "Thumbs.db" -exec rm -rf {} ; > /dev/null 2>&1


Goodluck, hope this helps.

Related External Articles:
What Happens After rm -rf / ?

HowTo: Delete All Thumbs.db Recursively

An offline messages just arrive from a fedora newbie trying to polish more of his FTP administration skills.

After quite some time of establishing his fully functional FTP server via VSFTP, he then realized that most of their staff with windows-based desktops usually Selects ALL files, Copy and Paste to FTP site, the normal non-techie way. Unaware that selecting all files from currently working windows folder also selects the Thumbs.db file to be uploaded to that same FTP server.

This Thumbs.db file is by the way created by windows OS for the purpose of thumbnailing cached image files, which has a filesize of 23040. If you've 1,000 of that, you just lost 23MB of disk space.

Now, the answer to his question of deleting Thumbs.db file recursively following the same concept with recent postings. This can be simply done using find.


# find ~ftpusername -name "Thumbs.db" -exec rm -rf {} ;


Adding to cron job on every morning or on daily basis would be


01 07 * * * find ~ftpusername -name "Thumbs.db" -exec rm -rf {} ; > /dev/null 2>&1


Goodluck, hope this helps.

Related External Articles:
What Happens After rm -rf / ?

10 Cool Open Source Easter Eggs

It’s easy to forget with all the source compiling, the conspiracy theories, and the OS flaming going on in every corner of the Internet, that there is a fun side of our beloved OS and Open Source applications. I have compiled a list of 10 easter eggs found in Open Source project..


Complete Story

KDE 4.1 rocks the desktop

KDE 4.1 was finally released to the public today. After all the controversy since the release of KDE 4.0, I'm happy to announce that KDE 4.1 simply rocks...


Complete Story

10 Cool Open Source Easter Eggs

It’s easy to forget with all the source compiling, the conspiracy theories, and the OS flaming going on in every corner of the Internet, that there is a fun side of our beloved OS and Open Source applications. I have compiled a list of 10 easter eggs found in Open Source project..


Complete Story

KDE 4.1 rocks the desktop

KDE 4.1 was finally released to the public today. After all the controversy since the release of KDE 4.0, I'm happy to announce that KDE 4.1 simply rocks...


Complete Story

Roku's Netflix Player: a hands-on review

It's small and silent, sports an array of ports on the back but only one tiny white LED on the front, and it can help you spend hours of time in front of your TV -- and it runs Linux. It's the Netflix Player from embedded device specialist Roku, and we got our hands on it for a review of the service and the hardware.

..


Complete Story

PostPath cracked Exchange protocols for Postfix-based mail server

PostPath is a drop-in Microsoft Exchange alternative based on the open source Postfix MTA. PostPath director of product management Sina Miri calls PostPath the "only" drop-in Exchange replacement, and he says that ability is the reason why his company makes PostPath available only with a proprietary license, despite its open source roots.

..


Complete Story

Yahoo, HP, Intel Give Ivory Towers a Stairway to the Cloud


Yahoo, HP and Intel are collaborating on an ambitious research endeavor called "Cloud Computing Test Bed" -- designed to support cloud computing research and education at universities. Users will be able to develop and test software, data center management, and hardware associated with cloud computing on this large-scale grid. The three companies are partnering with the Infocomm Development Authority of Singapore, the University of Illinois at Urbana-Champaign and the Karlsruhe Institute of Technology in Germany on the project...


Complete Story

Portugal Rings Up Big Order for Intel's Classmate PCs


Intel's low-cost laptop initiative is set to get a boost Wednesday from Portugal's government, which is pledging to provide elementary school students with 500,000 computers based on the chipmaker's Classmate PC design. The announcement brings Intel's rivalry with the One Laptop Per Child organization into the spotlight once again. In May, the nonprofit OLPC group said its green-and-white XO laptop computers would work with Microsoft's Windows in addition to a homegrown Linux-based operating system...


Complete Story

SSD vs. SATA RAID: A Performance Benchmark

Linux.com: "To see just how much an SSD might improve performance, I used Bonnie++ to benchmark a contemporary SSD as it might be used in a laptop computer."

Roku's Netflix Player: a hands-on review

It's small and silent, sports an array of ports on the back but only one tiny white LED on the front, and it can help you spend hours of time in front of your TV -- and it runs Linux. It's the Netflix Player from embedded device specialist Roku, and we got our hands on it for a review of the service and the hardware.

..


Complete Story

PostPath cracked Exchange protocols for Postfix-based mail server

PostPath is a drop-in Microsoft Exchange alternative based on the open source Postfix MTA. PostPath director of product management Sina Miri calls PostPath the "only" drop-in Exchange replacement, and he says that ability is the reason why his company makes PostPath available only with a proprietary license, despite its open source roots.

..


Complete Story

Yahoo, HP, Intel Give Ivory Towers a Stairway to the Cloud


Yahoo, HP and Intel are collaborating on an ambitious research endeavor called "Cloud Computing Test Bed" -- designed to support cloud computing research and education at universities. Users will be able to develop and test software, data center management, and hardware associated with cloud computing on this large-scale grid. The three companies are partnering with the Infocomm Development Authority of Singapore, the University of Illinois at Urbana-Champaign and the Karlsruhe Institute of Technology in Germany on the project...


Complete Story

Portugal Rings Up Big Order for Intel's Classmate PCs


Intel's low-cost laptop initiative is set to get a boost Wednesday from Portugal's government, which is pledging to provide elementary school students with 500,000 computers based on the chipmaker's Classmate PC design. The announcement brings Intel's rivalry with the One Laptop Per Child organization into the spotlight once again. In May, the nonprofit OLPC group said its green-and-white XO laptop computers would work with Microsoft's Windows in addition to a homegrown Linux-based operating system...


Complete Story