How to use .htaccess to change default index page
DirectoryIndex alternative-default-home-page.php
a christian web developer’s random writings
Archive for the ‘Programming’ Category.
DirectoryIndex alternative-default-home-page.php
<?php
$result = exec('traceroute ' . $_SERVER["REMOTE_ADDR"], $lines);
echo '<h1>Your IP is ' . $_SERVER["REMOTE_ADDR"] . '</h1>';
echo '<pre>';
foreach ($lines as $n => $line) {
if ($n) echo '<br />';
echo $line;
}
echo '</pre>';
echo '<p>-end-</p>';
Here’s how the resulting page looks like: reverse-traceroute.php
Here are the SQL commands:
create database newdb;
grant CREATE,INSERT,DELETE,UPDATE,SELECT on newdb.* to newuser@localhost;
SET PASSWORD FOR 'newuser'@'localhost' = password(’newuserpass’);
– or –
SET PASSWORD FOR 'newuser'@'localhost' = old_password(’newuserpass’);
flush privileges;
Windows:
Save the following to the folder to clean to a filename with a .cmd extension (cleansvn.cmd). After that issue the command, eg., C:\www>cleansvn
for /f "tokens=* delims=" %%i in ('dir /s /b /a:d *svn') do ( rd /s /q "%%i" )
Linux:
Cleaning a svn folder:
find . -name .svn -exec rm -rf {} \;
Using svn export:
Export from your working copy (doesn’t print every file and directory):
$ svn export a-wc my-export
Export complete.
Export directly from the repository (prints every file and directory):
$ svn export file:///var/svn/repos my-export
A my-export/test
A my-export/quiz
…
Exported revision 15.
I have set up svn repositories on dedicated Linux server of my clients but the constant typing of svn password everytime I access the repository makes life for a developer less livable. Until I found the solution…
So here it is, follow the step and hurray!
/Applications/Utilities/Terminal)
ssh-keygen -b 1024 -t dsa
Do not enter a passphrase. Hit enter when prompted for one.
cat ~/.ssh/id_dsa.pub
Copy the output to the clipboard.
cd .ssh
If the directory doesn’t exist, create it:
mkdir .ssh
cd .ssh
vi ~/.ssh/authorized_keys
Hit i to enter Insert mode and then paste your public key (if there is already a key in this file, move to the bottom before pasting). Hit the ESC key to leave Insert mode and type :wq and hit enter to save and exit vi.
That’s it, no more password typing while doing your svn stuff. Go ahead and try your svn commands.