Excellent Software to Listen to Online Radio Stations

August 3rd, 2008

Online radios are now as usual as FM radio stations. There are some details that make online radios more useful than the usual ones. The first is the diversity - online radios have greater variety of songs and genres, than usual radios. It is easier to switch between them, there are no annoying advertising messages and so on.

The best thing I found from online radios is that the variety of songs I can listen to is quite infinite and I am unable to keep such a number on my PC, even if I had several thousands of gigabytes of storage.

The program I found is named Screamer Radio and is absolutely free for use. It allows not only to listen tracks online, you can also record anything that is broadcasted into most popular formats. I remember the times I tried to record tracks from FM radio, when we didn’t know what are CD and mp3 discs :). Then the quality was very low but I was happy to have any kind of music. Now it’s much easier to find the radio you like.

Main interface of the program is screenshotted below:

Software comes with a great number of presets, so you don’t need to search for the radios - everything is organized very well, and you’re welcome to add your own channels. The list of genres has lots of presets. Here it is:

I really love this software that discovered online radios for me.

Wordpress: Where to Add Ping Services

August 1st, 2008

If you’re running a Wordpress blog, I think you would like to spread the word about it in the fastest way possible. You know - there are some ping services, that receive your blog updates and list them/ How to integrate them into Wordpress?

We need to be logged in as admin to go to the settings panel.

Then we need to go to Writing Section:

Scroll down to find the list of update services. Add your ping services and have fun!

DirectAdmin Message System Stopped Working - How to Fix

July 30th, 2008

I’ve noticed a strange thing at one of my DirectAdmin servers. I usually perform my backups once a week. After I start the backup process, I got a message that I will be notified when my backups are ready. One of my servers stopped to send me these notifications and I had to find out why .

First of all I checked my mail server. Everything was OK, messages were sent and received as usual. I took a look at the Directadmin itself - there usually were messages in the top right corner - none were there. Hmm…

I decided to take a look t DirectAdmin system logs, as the problem seemed to be with its own messaging system.  The answer was found in DirectAdmin Task Queue Log - /var/log/directadmin/errortaskq.log . Here is how it looks:

The only thing I had to do was to edit the file /usr/local/directadmin/data/admin/next_ticket.number . I’ve added a number to this file as it was empty and no ticket numbers could be assigned. Why did this number disappear - I really have no Idea.

Human Readable Date Format List for PHP date Function

July 28th, 2008

PHP offers a large variety of arguments that can be passed to the date() function. You are able to almost everything you want having just the current time stamp. I’ve selected the most useful readable formats - I think you might need it for any purpose. I used it to randomize a site’s content to vary posting dates. So, here is the list:

F j, Y
F j, y
F d, Y
F d, y
d-M-Y
d-M-y
j-M-y
j-M-Y
d/n/y
d/m/y
d/n/Y
d/m/Y
j/m/y
j/m/Y
j/n/y
j/n/Y
Y-m-j
Y-n-j
Y-m-d
Y-n-d
n/d/y
m/d/y
n/d/Y
m/d/Y
m/j/y
n/j/y
m/j/Y
n/j/Y
d.m.Y
d.m.y
d.n.Y
d.n.y
j.m.Y
j.n.Y
j.m.y
j.m.y
m-j-Y
n-j-Y
m-d-Y
n-d-Y

Most of these date formats look well and I hope you find it useful

How to fix “Mailbox in Use” Error in DirectAdmin

July 25th, 2008

Today I went back from my short trip to the country. First of all I decided to check my mail, and when I did it, I got the following error in my E-mail client: !25.07.2008, 19:20:39: FETCH -ERR [IN-USE] Mailbox in use. That’s not the first time when such an error happens and I already know the solution - I think it’ll be useful for all server administrators (By the way, It’s Sysadmin’s day today).

When you get the message that mailbox is used, you must have some lock files, that prevent using locked mailboxes. It is not so easy to find out the reason why these files appear (If you know, just write about it in comments). The solution is obvious - to find and destroy these files.

Mailbox lock files are usually located at /var/spool/virtual/. You fill find domain name folders there and your e-mail account lock files should be right there. Just check them. I usually use locate to find these files - their number shouldn’t be big.

After you delete these files, your mailboxes will start working as usual.

Free Software to Create Web Page Screenshots

July 22nd, 2008

Do you know Snap.com? If you don’t I’d encourage you to visit it as their tools make web much better. Even if I don’t like Ajax and Javascript tools, that often overload sites, I consider having site screenshots is a very good idea. But… where to take these shots and how to do them? If you try to do this manually, you’ll have to press print screen, then to run paint, then save the image, then rename it… Hard work, isn’t it?

If you want this for one site and want to see what’s shown to user in different browsers, then browsershots.org will be great for you. This service allows to take screenshots with different browser - this is the most comprehensive tool related to page screens I’ve seen on the Web.

There is also a Windows software that allows to do this. It’s Thumbnail Grabber. Thumbnail Grabber is a free utility for creating thumbnail screenshots of web pages in JPEG format. You can choose web page size (width and height) and thumbnail image size (in percent of the web page size). The program can batch process URLs and domains from a text file that makes it extremely useful for sites that have reviews or galleries, etc.

Now the process of Image creation is very simple. All you have to do is to have a list of web pages to crawl and Thumbnail Grabber will do everything for you. Nice that it doesn’t capture any browser elements, so your screenshots are clear and look great

Awstats and Directadmin - Now Supported Officially

July 22nd, 2008

Today I have updated my Directadmin installation and found that version 1.322 has appeared a few days ago. One of most intersting features I found was awstats support. I’ve been using awstats plugin for a while and now it is integrated in DirectAdmin.

In order to add awstats support to your Directadmin installation you have to perform some simple steps:

cd /usr/local/directadmin/scripts
./awstats.sh

This will do several things.
- download and install the awstats setup.
- add awstats=1 to your directadmin.conf
- add webalizer=0 in your directadmin.conf (webalizer will be shut off, you can override it if you want both)

Webalizer stats are quite simple and not so informative as awstats data is. You will have some log changes, but this should not affect your server performance. You can read more about this at DirectAdmin official site.

How to Create a db4 Database from a Text File or Array

July 21st, 2008

When you need to deal with big amounts of data, MySQL is not a good solution. db4 is much faster and easier - you don’t need any SQL queries to extract the necessary values and use them. The process of db4 file creation is quite easy; you need to have your PHP compiled with dba support. If you don’t know how to do it, you can find it on my blog: dba support for PHP

If you have a text file, you need to have your values arranged. The best way to do this is to start each key-value pair with a new line. This way you will easily explode your strings into little arrays and then add them to your db4 database. The code is here:

<?
// Let’s create our db4 file - you should have all the necessary permissions to do it.
$id=dba_open(’./baza.db’, ‘c’, ‘cdb’);
dba_close($id);
// Opening for writing
$id=dba_open(’./baza.db’, ‘w’, ‘db4′);
// Here is an array with keys and values (you may get it from your text file or using any other

// convenient way for you
$positions=array(”some key”=>”some value”);
// We’re inserting these values into our db4 database.
foreach ($positions as $key=>$value)
{
dba_insert($key, $value, $id);
}
// Optimizing our database file
dba_optimize($id);
// That’s all. We can close it
dba_close($id);

?>

We have created a db4 file that should have bigger size than the initial txt file. Next tim I will show you how to access your db4 file and how to extract values from it.

How to Validate a Google Sitemap

July 20th, 2008

I hope you know what is Google sitemap and what it is used for. If not, you might want to read about it at Google site. There are a plenty of services and scripts that allow to create a sitemap for your site and it is not so hard to create your own script for this (maybe I will show you the code some later). When it is created, you are welcome so submit it to your Google Webmasters section. But it is important to check it against errors before submitting and it is a good practice to have it valid.

You may need to study sitemap protocol specifications. Some characters should be escaped before putting them in an xml file. But how to check whether your sitemap is valid or not?

I am using an online service that allows to check the sitemap without uploading it - all you need is just to have it on your server.  Let’s go to the page of Free Google SiteMap XML Validator and check our sitemaps. If something is wrong, you will receive a message where even number of error string will be shown.  I greatly recommend you to study that web site - t has lots of useful information on sitemaps, more than I can write here.

Now you can be sure your sitemaps are valid. Smart IT Consulting also allows you to submit your sitemaps, so I consider it’s a great resource.

How to Block Outgoing Connections using iptables

July 19th, 2008

Sometimes you should prevent outgoing connections from your server. The best way to do it is to use Linux system options, especially ipchains and iptables. I will show you how to do it using iptables, as this is the shortest way I know.

In order to block outgoing connections from your server to one IP issue the following command using command line:

iptables -A OUTPUT -d <IP Here> -j DROP

You can add whole subnets using this command. For example, if you need to block a subnet, the command will look like:

iptables -A OUTPUT -d 192.168.0.0/16 -j DROP

This will block all IPs from 192.168.x.x.

You might want to use the same method with incoming connec6tions. All you need to know is the IP range you need to block. You should just change OUTPUT to INPUT in the command above.