Archive for January, 2009

Find amount of physical memory (RAM) under Linux

This article will show you how to find the amount of RAM memory on a Linux machine.  To find this information you will need to login to the Linux command-line shell and and enter the following command at the $ (or #) prompt:
$ cat /proc/meminfo
Sample Output
MemTotal:      1031960 kB
MemFree:        391172 kB
Buffers:         36576 kB
Cached:         238124 kB
SwapCached:          0 [...]

Click here to read the full post

Find the CPU (processor) speed and model under Linux

This article will show you how to find CPU (processor) type, speed, cache size, and much more under Linux. To find this information you will need to login to the Linux command-line shell and and enter the following command at the $ (or #) prompt:
$ cat /proc/cpuinfo
Sample Output
processor : [...]

Click here to read the full post

How to test AJAX websites using Selenium

This article will show you how to test AJAX web applications using Selenium. If you have used Selenium before, you are familiar with the wait_for_page_to_load (waitForPageToLoad) call which waits until a page finishes loading before continuing. If you have tried using this for an AJAX-enabled website, you will notice that your Selenium scripts just whizzes [...]

Click here to read the full post

How to use tar to archive and extract files

This article will explain how to use the tar command in Linux to create, list, and extract files.
1. Creating a .tar file
To tar the contents of a single folder: tar -cvf filename.tar /folder1 To tar the contents of a multiple folders: tar -cvf filename.tar /folder1 /folder2 /folder3 [...]

Click here to read the full post

Find the number of files in a directory (Linux)

This article will show you how to find the number of files (including directories) within the current directory under Linux.
Command
ls -1 | wc -l
Syntax Breakdown
ls is the Linux command to list all files and folders in the current directory
-1 will list each file on a separate line
wc -l will count the number of lines [...]

Click here to read the full post

Shell command to bulk change file extensions in a directory (Linux)

This article will explain how to change the file extension for all files in a directory in Linux using a simple bash shell command.
1. Change from one extension to another
The command below will rename all files with the extension .php4 to .php
for f in *.php4; do mv $f `basename $f .php`.php4; done;
2. Add (append) an [...]

Click here to read the full post

Where to buy quality, cheap inkjet cartridges and toner (SwiftInk)

As we all know, buying ink-jet cartridges at stores like Best Buy cost an arm and a leg. Often times, the price of a set of cartridges exceeds the cost of the printer! You might have searched online for alternative methods of buying replacements, but were overwhelmed buy the dozens and dozens of sites all [...]

Click here to read the full post

Run a script on Linux startup in 2 simple steps

There are several ways to run a script or program at startup on a Linux machine, especially when taking into account the various run levels. This example is a quickstart method on how to run it at run level 3.

Copy your script or file to /etc/init.d
Create a symbolic link from this file to the appropriate [...]

Click here to read the full post

Find PostgreSQL database size using SQL ‘Select’

This article will show you a very simple way to find the size of a PostgreSQL database using a SQL SELECT statement. This will work on PostgreSQL version 8.3.3, but should work on older versions as well.
Query
SELECT pg_database.datname,pg_size_pretty(pg_database_size(pg_database.datname)) AS size FROM pg_database where datname=’database_name’;
Sample Result
datname | size
—————–+——-
database_name | 15 MB
(1 [...]

Click here to read the full post

How to mount an ISO image in Linux

This article will explain how to mount an ISO image quickly and easily on Linux without downloading any additional software. If you are on a Windows operating system, check out the article: How to mount an ISO on Windows XP and Windows Vista

Login as the root user (if you are not root, then switch [...]

Click here to read the full post