Search

Resume and bio of the author Couple of articles related to my hobby - robotics
My impressions about immigration to Australia. In Russian only. Recipes for everyday problems solving
Linux-related posts Windows-related posts
Software-related posts A lot of info about hardware
Different tools you might find useful Posts about various web technologies
Everything that doesn't fit the rest of the menu RSS feed for this blog

Tag Cloud

Archives

Links

Andrey Mikhalchuk’s Blog

Technoblog about life

Jan 31, 2008 Immigration to Australia

I started republishing posts from my old website about immigration to Australia. First few posts are available here, more are coming later. All posts are in Russian. All posts are not published on the first page.

Jan 28, 2008 Simple free online IP conversion tool

For debugging purposes I frequently need to quickly convert ip addresses from one representation to another. Here is quick and dirty (I’ll cleanup the interface when get some free time) converter that does the job.
If you don’t see the form below because of some reason please proceed to this page.
The following formats are supported:

  • integer
  • unsigned integer
  • dot notation
  • hex number
  • binary number
  • octal number
  • natural netmask

Please specify one of the following

Convert from int:
Convert from dot notation:

function dec2string ($decimal, $base)
{
global $error;
$string = null;
$base = (int)$base;
if ($base < 2 || $base > 36 || $base == 10) {
echo ‘BASE must be in the range 2-9 or 11-36′;
exit;
}
$charset = ’0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ’;
$charset = substr($charset, 0, $base);
if (!ereg(‘(^[0-9]{1,16}$)’, trim($decimal))) {
$error['dec_input'] = ‘Value must be a positive integer’;
return false;
}
do {
$remainder = bcmod($decimal, $base);
$char = substr($charset, $remainder, 1); // get CHAR from array
$string = “$char$string”; // prepend to output
$decimal = bcdiv(bcsub($decimal, $remainder), $base);
} while ($decimal > 0);
return $string;
}

function string2dec ($string, $base)
{
global $error;
$decimal = 0;
$base = (int)$base;
if ($base < 2 || $base > 36 || $base == 10) {
echo ‘BASE must be in the range 2-9 or 11-36′;
exit;
}
$charset = ’0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ’;
$charset = substr($charset, 0, $base);
$string = trim($string);
if (empty($string)) {
$error[] = ‘Input string is empty’;
return false;
}
do {
$char = substr($string, 0, 1); // extract leading character
$string = substr($string, 1); // drop leading character
$pos = strpos($charset, $char); // get offset in $charset
if ($pos === false) {
$error[] = “Illegal character ($char) in INPUT string”;
return false;
}
$decimal = bcadd(bcmul($decimal, $base), $pos);
} while($string <> null);
return $decimal;
}

function pad( $str, $num )
{
return str_repeat( “0″, $num – strlen( $str ) ).$str;
}

// main
if( isset( $_GET["submit"] ) )
{
$ip = 0;
if( isset( $_GET["int"] ) && $_GET["int"] != “” )
{
$ip = $_GET["int"];
}
else if( isset( $_GET["dot"] ) && $_GET["dot"] != “” )
{
$ip = ip2long( $_GET["dot"] );
}
else
{
$ip = 0;
}

$uns_ip = ( $ip > 0 ? $ip : 0xffffffff + $ip + 1 ) + 0;

if( ( $uns_ip & 0×80000000 ) == 0 )
{
$mask = 0xff000000;
}
else if( ( $uns_ip & 0xC0000000 ) == -2147483648 )
{
$mask = 0xffff0000;
}
else if( ( $uns_ip & 0xE0000000 ) == -1073741824 )
{
$mask = 0xffffff00;
}
else
{
$mask = “”;
}
$dot_ip = long2ip( $uns_ip );
$hex_ip = dec2string( $uns_ip, 16 );
$hex_ip = “0x”.pad( $hex_ip, 8 );
$oct_ip = dec2string( $uns_ip, 8 );
$oct_ip = “0″.pad( $oct_ip, 16 );
$bin_ip = dec2string( $uns_ip, 2 );
$bin_ip = pad( $bin_ip, 32 );
?>

Conversion result

Dot notation
Decimal number
Unsigned decimal number
Hexadecimal number
Binary number
Octal number
Natural netmask

Jan 28, 2008 How to improve NFS performance (Linux, OpenSUSE 10.3)

When I used NFS first time 15 years ago on Sun it seemed to me the top of progress. And it really was at that time. So dealing mostly with samba during last few years I forgot how actually NFS works until a few days ago when I issued standard “mount server:/directory /mnt/subdir” and tried to compile a project. The performance was HORRIBLE. So I spent some time investigating how to improve NFS performance and found this solution:

Read More

Jan 26, 2008 Reservation Rewards aka WebLoyalty – Problem Solved

Recently I’ve got $10 charge from company called “Reservation Rewards” …
I’ve seen this company before in one of those “Use your chance to get $20″ with really long explanation that hides the fact you have to subscribe to “Reservation rewards” for $12/month in order to get those $20. But I was very patient first time I saw this ad, I noticed this hidden subscription, noticed checkbox that was prechecked for me and since then carefully hidden subscriptions like this. So here is the story about Reservation Rewards subscription with happy end.

Read More

Jan 26, 2008 Interesting Google Webmaster Tools Misfeature (Re:Sitemap)

I recently uploaded a sitemap for a new website to google and It looks like google webmaster tools do not accept sitemap containing just single url. The error it reports is “Missing XML tag”.

Read More

Jan 26, 2008 How to configure master/slave DNS servers so they do not conflict with Plesk 8.2

When you need to implement a DNS master/slave relationship, you obviously can go ahead and edit named config files, but when you do next change to DNS configuration using Plesk most your changes will be lost. From the other side Plesk doesn’t provide slave server configuration at all! Here is the solution that works for me on Plesk 8.2. Versions 8.3 and above support the master/slave DNS configuration via web interface.

Read More

Jan 26, 2008 How to enforce POP3s by disabling POP3 in courier-imap pop3 server

Sometimes, for security reasons, it is useful to disable pop3 protocol on a server, leaving users with necessity of using secure pop3 protocol (i.e. in outlook they will have to check “Use SSL checkbox”, otherwise mail just won’t work). The civilized method is of course just ask people politely to make changes to their settings, but frequently people just don’t have time to do so. This tiny hack will force them to do so, otherwise their mail just won’t come.

Read More

Jan 26, 2008 How to check if your POP3 server works normally

When your mail is not working it is important to know exactly what part is broken (so you know if you should go blame sysadmin or just check your mail client settings). Let’s simulate basic POP3 client using regular telnet (enter commands without quotes) in order to check if the POP3 is doing fine:

Read More

Jan 25, 2008 “553 sorry, that domain isn’t in my list of allowed rcpthosts; no valid cert for gatewaying” problem solving for Outlook, macmail, Plesk 8.2

“553 sorry, that domain isn’t in my list of allowed rcpthosts; no valid cert for gatewaying”
There could be many things leading to the problem. One of them is client inability to authorize to SMTP server. Here’s a quick explanation of what happens and how the problem could be solved.

Read More

Jan 25, 2008 How to purchase an SSL ceritficate for your website (using Plesk 8.2)

Despite the process of obtaining an SSL certificate for your website is not very difficult it may take you plenty of time, because the price of mistake could be rather high. I’d say you can loose hundreds of dollars if you buy wrong type of certificate or get it from wrong place. Here’s a quick overview of the process that will make your SSL cert shopping experience more enjoyable.

Read More

Site Map (c) Andrey Mikhalchuk, 2005-2008