Linux Blog

Why The Antivirus?

Filed under: General Linux — TheLinuxBlog.com at 12:39 am on Friday, January 23, 2009

Why The Antivirus

Although viri on Linux are not very common, it is not unusual to find anti virus utilities available. You may ask what the point is if your operating system is not as vulnerable to these types of threats but perhaps you are looking at it the wrong way. What better platform is there to act as an anti-virus scanner then one that isn’t as likely to get owned?

Take this example: a Linux file server Vs. a Windows 2003 file server. Just by plugging the Windows server in it may be at risk, in an hostile environment (eg Internet), while the Linux server may not have as much risk (at least from a Virus attack)

We all know the benefits of running Linux file servers such as cost, stability and coolness so we won’t touch on those but there are downsides to running a Linux file server. One of the major downsides is that Linux servers have a perception of being hard to manage. While they can be significantly different from managing a Windows server this myth is often on the top of the list for decision makers.

Often system administrators (myself included in this one) get lazy in their samba configurations. This is a potential problem because a sneaky virus could attempt to write its self to any writable volume, which could cause a lot of grief for the poor Windows machines. Or perhaps in tandem with the writable volume an exploit for a piece of out dated software allowing the writable file to be executed.
A friend of mine first introduced me to the concept of anti-virus scanners on a machine he had created specifically for the purpose of housing his virus collection. He had made a script that extracted information about the virus and cataloged it for easy reading and searching. All he had to do to add a virus to his collection was copy it to a folder. With this method he was able to quickly search and find any virus he had on file for specific traits or purposes for analysis. While some may call this overkill for him it was a hobby. Would you keep your entire virus collection on a Windows machine?

As with any operating system, it is only as secure as you make it, therefore running an anti virus on your Linux machine may not be as stupid as it first sounds. Especially if they interact with the dirty Windows boxes on a regular basis. Then again, if you’re purely a Linux shop, enjoy the cleanliness while it lasts.

Facts About Selenium

Filed under: General Linux,Linux Software — TheLinuxBlog.com at 9:22 pm on Friday, March 28, 2008

Selenium is a chemical element. What you may not know is that Selenium is also a powerful testing tool for web applications. Selenium runs its tests directly in a browser, just like real users do. It is cross platform and the developers plan to have it for the iPhone but thats another story. Selenium can run in one of two modes Core and Remote Control (RC). The RC method has a way of using distributed computing much like the way Samba allows cross compiling over multiple cpu’s. There is an IDE for Selenium that can be used to easily learn Selenium.

Enough Facts About Selenium already!

What exactly can you do with Selenium?

Well, the answer is simple. Pretty much anything that you can do with a browser Selenium can do. Its primary purpose is for developers to use as a quality assurance tool. For QA purposes you can create a test cases, run them and verify that the end result is what you expected. You can create test cases in Java, Ruby, Python, Perl, PHP or .NET.

I had a little trouble getting the Selenium driver for PHP installed so here is the how to:

sudo su
pear channel-update pear.php.net
pear install Testing_Selenium-beta
pear install PHPUnit
exit

The above allowed me to communicate with the Selenium Remote Control that I downloaded with PHP. Here is an example from their website that I have modified so that it works:

<?php

set_include_path(get_include_path() . PATH_SEPARATOR . ‘./PEAR/’);
require_once ‘Testing/Selenium.php’;
require_once ‘PHPUnit/TestCase.php’;

class GoogleTest
{
private $selenium;

public function setUp()
{
$this->selenium = new Testing_Selenium(“*firefox”, “http://www.google.com”);
$this->selenium->start();
}

public function tearDown()
{
$this->selenium->stop();
}

public function testGoogle()
{
$this->selenium->open(“/”);
$this->selenium->type(“q”, “hello world”);
$this->selenium->click(“btnG”);
$this->selenium->waitForPageToLoad(10000);
$this->testCase(“/Google Search/”, $this->selenium->getTitle());
echo “<hr>”;
$this->testCase(“/Yeahh Search/”, $this->selenium->getTitle());

}

public function testCase($regEx, $string) {

preg_match($regEx, $string, $matches);

print_r($matches);

}

}

$google = new GoogleTest();

$google->setUp();
$google->testGoogle();
$google->tearDown();
?>

Before attempting to run this you must make sure that you downloaded Selenium RC and that it is running. Selenium runs on Java so make sure that Java is installed download selenium from here, unzip and run the following in the directory that it is extracted to:

cd selenium-remote-control-1.0-beta-1
cd selenium-server-1.0-beta-1
java -jar selenium-server.jar -interactive

Once this is running you can start scripting with PHP to get Selenium to do anything that you want. Once you are done make sure that you exit the Selenium server by running the “exit” at the prompt.

I’m sorry about the format of this post, its been a while since I have used Selenium and I’m quite excited about it. If you have any questions about Selenium post them here and I will try to answer them for you.

Slackware MPlayer Setup

Filed under: General Linux,Linux Software,The Linux Blog News — TheLinuxBlog.com at 12:03 am on Tuesday, December 4, 2007

I’ve updated the MPlayer Installer and uploaded it.

Instructions:

1. Download The MPlayer Installer that I made (Right click Save Link As).

2. Change to root user and run the MPlayer Installer OR run the MPlayer Installer with sudo as followed:

bash-3.1$ su root

Password:

bash-3.1# sh mplayer_setup.sh

OR

sudo sh mplayer_setup.sh

Changes to this version:
mplayer-1.0rc1try3-i486-2kjz.tgz is now being used as mplayer-1.0rc1-i486-1goa.tgz is no longer available.
Instead of using the essential codecs pack I am now using the all-20071007.tar.bz2 package. This includes so many more codecs. Even apple.com trailers work for me now.
A bunch of dependencies / libraries are now being downloaded and installed here is the list:

a52dec-0.7.4-i486-1kjz.tgz
libmpcdec-1.2.6-i486-1gds.tgz
libmpeg3-1.7-i486-1gds.tgz
avifile-20071003-i486-1gds.tgz
mpeg2dec-0.4.1-i486-1gds.tgz
faac-1.25-i486-1gds.tgz
faad2-2.6.1-i486-1wim.tgz
speex-1.2beta2-i486-1kjz.tgz
ffmpeg-20070622-i486-1kjz.tgz
twolame-0.3.10-i486-1kjz.tgz
jack-0.103.0-i486-1kjz.tgz
x264-20070722-i686-1mfb.tgz
lame-3.97-i486-1kjz.tgz
xmms-1.2.11-i486-1McD.tgz
libdv-1.0.0-i486-1gds.tgz
xvidcore-1.1.3-i486-1kjz.tgz
mplayerplug-in-3.45-i486-1kjz.tgz
libdc1394-1.2.2-i486-1gds.tgz

Notes:
The following error is caused because samba is not installed:

mplayer: error while loading shared libraries: libsmbclient.so.0: cannot open shared object file: No such file or directory

If you run into any other problems, as always you can e-mail me (owen @ thelinuxblog.com) for help.
Because of all the changes the line by line breakdown of the installer from: Slackware 12 – MPlayer Setup in 3 Easy Steps post is no longer accurate.