How Much UPS Do You Need?

On September 24, 2010, in Computing, Hacks, Hardware, by Anthony Lake

For all of you who find yourself wondering, here’s a basic by-the-seat-of-your-pants rule of thumb for picking an uninterruptible power supply.

1. First, figure out the power consumption of your computers. The best way to do this would be to use a watt-meter. In general, a reasonable rule of thumb is to add up the wattage rating of all the computer’s power supplies and divide it in half.

Odds are, if you’re using only a low end video card and only one hard drive, the required power would probably be around 90 watts… or with a high end card or multiple drives, figure 200 or more watts continuous.

2. You will want to purchase a power supply whose RMS rating is equal to or greater than the number you calculated in step one.  On most power supply brands, multiply the VA rating *.6, or just use the watts rating if it’s actually written on the sales material. For instance, the APC1250LCD says “1250 VA” on the box. Multiplying this number by .6 gives us 750, so we can safely keep 750 watts of servers running – using the rule we applied above.

Here’s an example:

I have three servers, each with a 380 watt power supply. That’s a total of 1140 watts. We’re going to divide that number in half, as per rule (1) above, thus, we’ll need a UPS that can deliver 570 watts RMS, plus we’ve got a monitor, a modem, and a switch that I think I’ll throw in the mix… together, they draw about 100 watts total, so, for a nice safe number we’ll need a UPS that can supply 670 Watts continuous. The APC1250LCD mentioned above will do nicely to power these servers at least long enough to get them a graceful shutdown.

Tagged with:
 

Computer Virus or Weapon of Mass Destruction

On September 23, 2010, in Computing, Hacks, by Anthony Lake

Photo courtesy Oliver Rapp of Linux Kernel Panic

For the first time known, a computer virus has crossed a terrifying, exciting, and interesting threshold, in that order. The virus is called Stuxnet and has the ability to sense its surroundings. If Stuxnet finds what it’s looking for,  it can infect the programmable logic units of real world machinery of the type which appears in robots, manufacturing devices, and  nuclear power plants. Stuxnet is completely autonomous and requires no human action to complete its nefarious goal.

Cyber security experts say the super weapon is designed to specifically target a real-world target, but nobody knows what that target is. Most of the infected machines have been found in Iran, though, and many experts are guessing the virus is a “Precision Cyber-Missle” looking for the Bushehr nuclear power plant. Recently, Symantec reported that Stuxnet can apparently sabotage SCADA systems as well.

It’s probable the virus was written by a nation-state; the engineering, computing, and encryption routines required were too expensive and expansive for almost any other entity. Furthermore, nobody actually knows what the virus actually does. So far, it has infected dozens of computers and automated machines all over the middle east and in a few other locales, including the United States, and there it waits. For what, or when, or who Stuxnet waits, we do not know.

What most experts suspect, however, is that there is a near certainty that Stuxnet has already infected its actual target.

Read an absolutely chilling article about Stuxnet here

Most of this stuff came from John Simpson’s excellent resource at http://www.jms1.net/davical/server-setup.shtml. I had to tweak it and it took me a few hours. I think this CentOS Virtualmin spec will save you some time. Use it at your own risk, it works for me!

REMARK: Log in as root

# cd /usr/share

# wget ftp://195.220.108.108/linux/dag/redhat/el5/en/i386/dag/RPMS/perl-Module-Install-0.64-1.el5.rf.noarch.rpm
# wget http://dag.wieers.com/rpm/packages/perl-Test-Base/perl-Test-Base-0.54-1.el5.rf.noarch.rpm
# wget ftp://rpmfind.net/linux/sourceforge/r/rs/rscds/libawl-php-0.36-2.noarch.rpm
# wget http://dag.wieers.com/rpm/packages/perl-YAML-0.66-1.el5.rf.noarch.rpm
# wget ftp://rpmfind.net/linux/sourceforge/r/rs/rscds/davical-0.9.6.3-2.noarch.rpm

# rpm -ivh perl-Module-Install-0.64-1.el5.rf.noarch.rpm
# rpm -ivh perl-Test-Base-0.54-1.el5.rf.noarch.rpm
# rpm -ivh libawl-php-0.36-2.noarch.rpm
# rpm -ivh perl-YAML-0.66-1.el5.rf.noarch.rpm
# rpm -ivh davical-0.9.6.3-2.noarch.rpm

# cd /usr/share/davical/dba

# su postgres -c ./create-database.sh

REMARK: You will see some information scroll up the screen. Look for and preserve the following line:
REMARK: “The password for the ‘admin’ user has been set to ‘yinj4t1S'”

# cd /var/lib/pgsql/data
# cp pg_hba.conf pg_hba.conf.bak
# nano pg_hba.conf

REMARK: scroll down to the line that reads:
REMARK: “# TYPE DATABASE USER CIDR-ADDRESS METHOD “
REMARK: and below that line but above the other lines insert

local davical davical_app trust
local davical davical_dba trust

REMARK: exit nano by typing control-x:
ctrl^X

REMARK: Yes, save the modified buffer by typing “Y”
Y

# /etc/init.d/postgresql restart

# cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.bak

REMARK: Open a VIRTUALMIN window to your server
REMARK:
Navigate to Webmin/Servers/Apache Webserver
REMARK:
Select the “Global Configuration” tab
REMARK:
Click the “Edit Configuration Files” icon
REMARK:
Edit the /etc/httpd/conf/httpd.conf
REMARK:
OR
REMARK:
Simply type “nano /etc/httpd/conf/httpd.conf”

REMARK: Find the section of httpd.conf that looks like this:
REMARK:
# First, we configure the “default” to be a very restrictive set of
REMARK:
# features.
REMARK: #
REMARK:
<Directory />
REMARK:
Options FollowSymLinks
REMARK:
AllowOverride None
REMARK:
</Directory>
REMARK:
Skip a line and type the following:

# Inserted for Calendar Server functionality
<Directory “/usr/share/davical/htdocs”>
Order deny,allow
Allow from all
</Directory>

REMARK: If you are editing with Virtualmin/Webmin Click “Save”
REMARK: If you are editing with Virtualmin/Webmin Click “Apply Changes”
REMARK:
If you are editing with Virtualmin/Webmin Click “Stop Apache”
REMARK:
If you are editing with Virtualmin/Webmin Click “Start Apache”
REMARK:

REMARK:
If you are using nano, save the file, exit nano, and type

# /etc/init.d/httpd restart

REMARK: Using Virtualmin, select a domain which will be allowed access
REMARK:
to the calendar server. Click the “Aliases and Redirects” Icon
REMARK: In the “Document directory aliases” section, add
REMARK:
From: /cal To: /usr/share/davical/htdocs
REMARK:
Click “Save”
REMARK:
Click “Apply Changes”
REMARK:
Click “Stop Apache”
REMARK:
Click “Start Apache”
REMARK:

REMARK:
If you are using nano, save the file, exit nano, and type

# /etc/init.d/httpd restart

# cd /etc/davical
# nano your.domain.com-conf.php
<?php
$c->admin_email = ‘webmaster@domain.com’ ;
$c->system_name = ‘domain.com’ ;
$c->default_locale = ‘en_US.UTF-8’ ;
$c->pg_connect[] = ‘dbname=davical port=5432 user=davical_app’ ;
?>

REMARK: exit nano by typing control-x:
ctrl^X

REMARK: Yes, save the modified buffer by typing “Y”
Y

# cp /etc/php.ini /etc/php.ini.bak
# nano /etc/php.ini
REMARK: add the following line
include_path = “.:/php/includes:/usr/share/davical/inc:/usr/share/davical/htdocs:/usr/share/awl/inc”

REMARK: save the php.ini file and exit nano

# /etc/init.d/httpd restart

REMARK: Change admin pass by logging in with default pass at http://www.domain.com/cal/
REMARK:
create a user
REMARK: Depending on the client, You can now access your user’s calendar via a CalDAV client at:
REMARK:
http://www.domain.com/cal/caldav.php/username/home
REMARK:
OR
REMARK:
http://www.domain.com/cal/caldav.php/username

Tagged with:
 

Switch to our mobile site