OOP Programming – Best book ever for free..

Not much to say about this one.

Phenomenal teacher – writer Bruce Eckel has wrote one of the best Java books i have encountered. Intuitive and skilled he covers almost everything, without hindering even a newcomer to OOP languages, in the great series of Thinking in Java.

Quoting the MAN himself : “When I think of a chapter in the book, I think in terms of what makes a good lesson during a seminar. My goal is to get bite-sized pieces that can be taught in a reasonable amount of time, followed by exercises that are feasible to accomplish in a classroom situation.

In my opinion his approach is one of the best.Go ahead and see for your selves. 😀

Read on here http://www.mindview.net/Books/TIJ/

Free image hosting

I was on the usual administrative spree that gets to every “sane” IT fella every once in a while..

In the process i was checking the analytics and traffic for one of the projects i undertook ,for the sake of learning some more advanced concepts of php and file handling in an unsafe e.g Internet, environment.

I was very pleased to see lots of people using ,in a great range of websites from blogs and forums to myspace and facebook, an quite old project i made back in 2003, namely http://imagehost4free.telmako.com

Getting recommended as an image hosting service, from one the most notorious writers in http://e-pcmag.gr/forum/6036 (one of the best Greek personal computer related forums), is just to great an honour.

It seems that free image hosting is never getting old and what’s better than a hassle free, simple upload your photo and get ready html – BB code to use in facebook, myspace, forums?

To be  honest i had almost forgot about that project but its getting a refurbish quite soon with some nice upgrades to size limitations etc..

Thanks for the vote peeps.

See you soon.

Mysql Backup – The simple script

There is only ONE  “Golden Rule of IT” : BACK IT UP OR LOOSE IT..

1)There is no such thing as security, be it firewalls, hard drives that spin in the speed of light and have 324 years guarantee or even a pact with western digital’s CEO…When it comes to crucial data stored in databases the only thing you can rely on is a : BACKUP.

2)Testing that the precious backup, you are hiding away in the swiss vault somewhere, is ACTUALLY working will prove beneficial in the long run.

And thats it.

Here is a really simple script that works in virtually every linux distro have come across and produces nice gziped backups of MySql databases.

Enjoy!

################################################################
#!/bin/bash
#18/12/2003
#Simple script to backup a specific database
#Backup script by datetime
#USE AT YOUR OWN RISK
### MySQL Server Login Info ###

DB=”Important_DB_Name_Here”

MUSER=”root”
MPASS=’mypasswd’
MHOST=”localhost”
MYSQL=”$(which mysql)”
MYSQLDUMP=”$(which mysqldump)”
BAK=”/mysqlbackups”
GZIP=”$(which gzip)”
NOW=$(date +”%d-%m-%Y”)

[ ! -d $BAK ] && mkdir -p $BAK

##ACTUAL WORK TAKES PLACE HERE##
FILE=$BAK/Desired_static_namepart-$NOW.gz
$MYSQLDUMP -u $MUSER -h $MHOST –password=$MPASS $DB1 | $GZIP -9 > $FILE

#########################################################################
# Uncomment the following line to delete files older than 10 days in the backup directory
#find  /mysqlbackups/* -mtime +10 -exec rm -f {} \;

#########################################################################

301 Redirect – Moving To A Better Place…

Moving to a new domain and don’t want lose your hard earned traffic and search engine rankings?

Keep reading…

What will follow is a nice way to push http clients (browsers and spiders alike) over to a different domain,

and make the spiders drop the old records that they have in their index and replace them with the new ones that you will “serve” them.

Be warned though that it takes time for them to rebuild their index. The best option is to have the old domain up and running for at least 6 months after you do the transfer.

  • What Is A 301 Status Code?

What we need is our server to present to everyone an http header with a 301 status code, which means that whatever they were looking for has permanently moved to a new location and we provide the location at the same time.

  • What Is An .htaccess File?

When a visitor or a spider requests a web page, your web server (Apache) checks for an .htaccess file.

The .htaccess file contains specific instructions like redirection issues, security and how to handle certain errors.

You will have to create an .htaccess file at the top level directory (Document Root).

Linux Ex.:/usr/local/apache/htdocs/

Windows Ex.:C:\apache\htdocs\

  • Requirements:

Apache Web Server

Rewrite_Mod Enabled (Every serious hosting company has that on)

Enough With The Theory…Hand Over The code 🙂

Ok.Your .htaccess file on the old domain would be:

————————————————————————–

Options +FollowSymLinks

RewriteEngine on

RewriteBase /

RewriteCond %{HTTP_HOST} ^(www\.)?yourdomain\.com

RewriteRule (.*) http://www.yournewdomain.com/$1 [R=301,L]

Redirect PERMANENT /forum/ http://www.yournewdomain.com/forum/

—————————————————————————

Keep in mind that the URLS are case sensitive.

You can make it work for directories too. Say you have a forum on a folder one level deeper

then your htdocs.

That is what the last line does and by adding the PERMANENT flag has the same effect as [R=301] in the line above.

  • Beware The Old Man

You should be aware though for there is indeed such a thing called domain age.

Search Engines know how old a domain is.

Google for example uses it as one of their main criteria, along with content, linking from other sites, etc…

For more information about .htaccess, rewriting_mod, rules and directives you should check the Apache web site.

That’s all folks 😀