Archive

Archive for September, 2008

A simple password generator

September 10th, 2008 No comments

You are going to need this for sure : )

function generatePassword($length=9, $strength=0) {
$vowels = 'aeuy';
$consonants = 'bdghjmnpqrstvz';
if ($strength & 1) {
$consonants .= 'BDGHJLMNPQRSTVWXZ';
}
if ($strength & 2) {
$vowels .= "AEUY";
}
if ($strength & 4) {
$consonants .= '23456789';
}
if ($strength & 8 ) {
$consonants .= '@#$%';
}

$password = '';
$alt = time() % 2;
for ($i = 0; $i < $length; $i++) {
if ($alt == 1) {
$password .= $consonants[(rand() % strlen($consonants))];
$alt = 0;
} else {
$password .= $vowels[(rand() % strlen($vowels))];
$alt = 1;
}
}
return $password;
}

and..
Read more…

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

.htaccess problem at Apache2 (Ubuntu)

September 8th, 2008 No comments

Hi, Everyone,

Today i have faced with a problem which made me sick of apache2. Since i’ve done with this stupid problem it will be my pleasure to writing solution to my blog page   :)

Ok!, If you are running apache2 first you should know about that you got the configuration file at ;

sudo nano /etc/apache2/apache2.conf -> just check out this file to see what it contains exaclty

and you can see error log’s at ;

sudo nano /var/log/apache2/error.log  -> which helps a lot

So, to enable .htaccess files on your server first you have to edit ;

sudo nano /etc/apache2/sites-available/default

when you open this file you have to see some lines like;

DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

you have to be sure the Document root is correct. Then you need to change the “AllowOverride None” to “AllowOverride All” then we are done with this part.

Read more…

VN:F [1.9.22_1171]
Rating: 6.5/10 (6 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)
Categories: HowTo, Linux, Ubuntu Tags: , ,