Category Archives: Internet

How To Integrate non-WordPress pages in WordPress and Avoid 404 Errors

So  you want to use your old PHP files, but with your WordPress installation/theme. So the Codex tells you that this can be done, and you just have to include the following in your PHP files:

<?php
/* Short and sweet */
define('WP_USE_THEMES', false);
require('./wp-blog-header.php');
?>

This would make it possible to use all the WordPress functions and include the header, footer, widget area etc. When tested with Chrome developer tools, I noticed that it returned a 404 File not found in the headers. Fortunately I came across the solution from a link on the same Codex page, instead of the above code, use the following:

<?php
define('WP_USE_THEMES', false);
require('p/wp-config.php');
$wp->init();
$wp->parse_request();
$wp->query_posts();
$wp->register_globals();
$wp->send_headers();
?>

This should return a 200 Status OK header instead and everything should be okay.

To include the header and footer you can use the following code/method:

<?php
define('WP_USE_THEMES', false);
require('p/wp-config.php');
$wp->init();
$wp->parse_request();
$wp->query_posts();
$wp->register_globals();
$wp->send_headers();
get_header();
?>
The content goes here...
<?php get_sidebar(); ?>
<?php get_footer(); ?>

That should do the work :)

Free File Hosting: Do NOT use MediaFire!

I have been using MediaFire as a free upload service for some time now. I decided to use them after Megaupload got closed down. Well, i regret that i chosen them now.

A good tip, if you have any files you want to store safe in the sky, don’t use Mediafire. Why? Well, suddenly one day, I get like 60+ emails (for each file), that the file has been removed due to ToS (Terms of Service) violations. Furthermore my account got suspended without any warming at all. I contacted Mediafire to get an explanation, their respond is that I have violated the Terms of Service. I ask for more details, as I can’t find any good reason to my files getting removed without any warning, not even after reading the ToS, but they stopped answering my mails. So I gave up. My files did not contain any copyright infringement or anything else like that.

Just wanted to warn everyone else, before your files suddenly are gone. I used Megaupload for a long time before they went down, without any problems. I have also been using Rapidshare without any problems for a very long time too. If you need a good file hosting provider, I can really recommend Rapidshare. I prefer to use more than one, so please use the comments if you know one i should try (that does not delete your files).

10 Quick Steps To Securing Your WordPress

Securing your WordPress installation. WordPress is the most popular blog software, and this makes in vulnerable to many hackers. Here are 10 quick tips to keep your WordPress safe.

1. Do not use wp_ prefix in your database

When you are installing your WordPress, you get the option to choose your own prefix, choose something else than “wp_“.

2. Change the admin user name to something else and post from a non-admin

Every hackers first guess would be “admin”, rename the admin user!

After you have renamed the default “admin” user to something else, it is recommended that you create another user for posting. This way the admin username will not be exposed when posting on your blog.

3. Add another layer of security with .htaccess password protection for /wp-admin/ folder

Use .htaccess to password protect your /wp-admin folder. Example:

AuthName "WP Admin"
AuthType Basic
AuthUserFile /full/path/to/webhotel/password_protected_folder/htpasswd
require valid-user


# This is the whitelisting of the ajax handler used by some plugins and the install css.
<Files admin-ajax.php css/install.css>
Order allow,deny
Allow from all
Satisfy any
</Files>

Note: This can prevent some plugins to work (the easiest way is to test it and see if your site still works right).

There are lots of tutorials on how to set a password on a folder with .htaccess file, just search Google for “.htaccess password tutorial”.

4. Install WordPress security plugins
Check out these plugins:
– WordFence
– Secure WordPress
– WP Security Scan

5. Remove database Username and Password from your wp-config.php
If possible, create a file outside the web root and put your WordPress login details here.
If this is not possible, put the login details in a .htaccess password protected folder.

Use the PHP require function to include the WP database login details in the config file, like this:

//DB Login
require('full/path/to/root/login-details.php');

6. Protect wp-config.php and .htaccess
If you use a server with .htaccess, you can put this in your .htaccess (at the very top) to deny access to anyone surfing for it:

# Strong .htaccess protection
<Files ~ "^.*\.([Hh][Tt][Aa])">
order allow,deny
deny from all
satisfy all
</Files>

# Protect wp-config.php
<Files wp-config.php>
Order Deny,Allow
Deny from All
</Files>

7. Change File Permissions
It is very important that you have the proper file permissions to ensure your site’s security. I recommend that you restrict your file permissions down to the bare, CHMOD value of 644 for files and CHMOD value 755 for folders, which essentially makes it read-only to everyone except you.

Just open your FTP program and right click the folder or file and click on “File Permissions”. You should change the CHMOD value to at least 744, only giving the “owner” full access, but i recommend using 644 on files, and 755 on folders as said before.

8. Backup your files
Always keep a backup of all your WordPress files and also your database.

If something goes wrong, or your WordPress gets hacked, you got a backup.

Heres is a good guide for backing up your database.

9. Always keep ALL WordPress, plugins, themes etc. updated!
Maybe the most important tip. Always make sure the WordPress installation, and all plugins, themes, etc. are up to date.

10. Disable directory indexing
Put this line in the top of your main .htaccess to prevent directory indexing:

Options All -Indexes

 

Other good resources
This resource is also highly recommended to read.
Hardening WordPress

Quickly select all your contacts when inviting friends to Dropbox

If you want to get more free space using Dropbox, you have to invite friends. Each friend gives you 250 MB extra space, up to a maximum of 8 GB extra space.

If you have hundreds of contacts like me, checking each check-box will take ages.

With a little javascript you can quickly invite all your friends at once. Copy and paste this little javascript code into the adress bar and hit enter, while the invite box is open:

javascript: el = document.getElementById('contact-list').children; for(var i in el) { el[i].children[0].children[0].checked=true; }

If it does not work for you and you are using Firefox, try to install the Firebug plugin and execute the code from the commandline.

el = document.getElementById('contact-list').children; for(var i in el) { el[i].children[0].children[0].checked=true; }

Wise Words – Quotes

Wise words!

I always knew I was going to be rich. I don’t think I ever doubted it for a minute. – Warren Buffet

If you don’t like how things are, change it! You’re not a tree. – Jim Rohn

You’ve got a lot of choices. If getting out of bed in the morning is a chore and you’re not smiling on a regular basis, try another choice. – Steven D. Woodhull

Remember, if you’re headed in the wrong direction, God allows U-turns! – Allison Gappa Bottke

Now that it’s all over, what did you really do yesterday that’s worth mentioning? – Coleman Cox

You can tell more about a person by what he says about others than you can by what others say about him. – Leo Aikman

I would not waste my life in friction when it could be turned into momentum. – Frances Willard

Time you enjoy wasting, was not wasted. – John Lennon

If you have to do it every day, for God’s sake learn to do it well. – Mignon McLaughlin, The Neurotic’s Notebook, 1960

Don’t judge each day by the harvest you reap but by the seeds that you plant. – Robert Louis Stevenson

Whatever you are be a good one. – Abraham Lincoln

Giving up doesn’t always mean you are weak. Sometimes it means that you are strong enough to let go. – Author Unknown

Life is like riding a bicycle – in order to keep your balance, you must keep moving. – Albert Einstein

Never believe in mirrors or newspapers. – Tom Stoppard

It wasn’t raining when Noah built the ark. – Howard Ruff, How to Prosper in the Coming Bad Years, 1979

While seeking revenge, dig two graves – one for yourself. – Doug Horton

Am I not destroying my enemies when I make friends of them? – Abraham Lincoln

The best way to predict your future is to create it. – Peter Drucker

It is better to sleep on things beforehand than lie awake about them afterwards. – Baltasar Gracian

Your future depends on many things, but mostly on you. – Frank Tyger

Be nice to people on your way up because you’ll need them on your way down. – W. Migner

Triple-Boot: Mac OS X, Windows 7 and Ubuntu Linux

In this post I will explain some of the issues i ran into using Mac OS X, Windows 7 and Ubuntu Linux in a triple-boot.

First, if you have a Mac, you should install rEFit before any other OS!

In short, here’s what you do:
– Install rEFIt
– Create partitions for the three operating systems
– Install Windows
– Install Ubuntu

Okay, so you have Mac OS X installed. The first thing you need to do is to install rEFit (http://refit.sourceforge.net/)

Now use the Disc Utillity in OS X to partition your Harddrive. You can also use the Boot Camp assistant to Install Windows. After you have installed Windows, you want to install Ubuntu Linux.

Go to Disc Utillity in Mac OS X, and make a new partition for Ubuntu, just format as “free space”, we will use the Ubuntu installer to format with the right file system later.

Now, I suppose you have burned Ubuntu to a CD that is now ready to install. Go through the installer, when it comes to “Allocate drive space” choose “Specify partitions manually”. Now, choose the “free space” partition you made before and make a 1 GB Swap partition. Use the rest of the free space to make a partition for Ubuntu. You do this by marking the free space and click change, in “Use as” choose Ext4 journaling file system, in “Mount point” choose “/”. Now be sure to install the Boot loader to your Linux partition you just made instead of installing it in the MBR (Master Boot Record). Now finish your installation.

Now, when you start up your Mac, rEFit should be the boot loader and you should be able to choose between MAC OS X, Windows 7 and Ubuntu Linux. Choosing Ubuntu Linux will then take you to Grub (Linux Boot Loader) where you have to choose Ubuntu again (or just wait some seconds) to boot from.

If you want to read a more detailed version, check out the Ubuntu documentation:
https://help.ubuntu.com/community/MacBook/TripleBoot

rEFit currently version 0.14, boot loader:
http://refit.sourceforge.net/

What if I already installed Ubuntu without installing fEFit ?
Okay, so you can’t boot Mac OS X from the Grub boot loader. You have to boot either from Ubuntu or Windows, and create a rEFit CD from the ISO disk image available at refit.sourceforge.net. Burn the CD (when you have burned the CD it appears empty because it’s for the Mac file system, dont worry). Just put the CD in, start your Mac and hold down “c”, this will boot from the CD, where rEFit is on. Now choose to boot from Mac OS X, download rEFit for Mac and install it. Boot 2 or 3 times, and rEFit should now be the default boot loader!

Get Ubuntu
http://www.ubuntu.com/

A good advice
Never use Windows’ own partitioning tools when you’ve installed it using a hybrid MBR, since it only “sees” the MBR side. Instead use Apple’s Disk Utility.

Chuck Norris facts

10 funny Chuck Norris facts:

Chuck Norris can be unlocked on the hardest level of Tekken. But only Chuck Norris is skilled enough to unlock himself. Then he roundhouse kicks the Playstation back to Japan.

Chuck Norris sleeps with a pillow under his gun.

Chuck Norris once ate a whole cake before his friends could tell him there was a stripper in it.

When Chuck Norris falls in water, Chuck Norris doesn’t get wet. Water gets Chuck Norris.

When an episode of Walker Texas Ranger was aired in France, the French surrendered to Chuck Norris just to be on the safe side.

They once made a Chuck Norris toilet paper, but it wouldn’t take shit from anybody.

The show Survivor had the original premise of putting people on an island with Chuck Norris. There were no survivors, and nobody is brave enough to go to the island to retrieve the footage.

Chuck Norris once ate an entire bottle of sleeping pills. They made him blink.

Chuck Norris played Russian Roulette with a fully loaded gun and won.

The Bible was originally titled “Chuck Norris and Friends”.

You can find more Chuck Norris facts at www.chucknorrisfacts.com.

Find Chuck Norris

Try go to Google and type “Find Chuck Norris”, and then hit the “I’m Feeling Lucky”-button. It will come up with a message saying that Chuck Norris can’t be found, Chuck Norris finds you! Haha…

Heres a screendumb.

Chuck Norris can't be found

Google ASCII art Easter egg

Just found an ‘Easter Egg’ in Google search engine.

Try searching for “ascii art” on Google, this will result in the Google logo turn into ASCII itself.

A search for Ascii art on Google will result in the logo in Ascii.

A search for ASCII art on Google will result in the logo in ASCII.

Facebook trick and big MSN smiley

Time for some tricks.

Facebook Easter egg (flare effect) – The Konami Code

When you are on Facebook try pressing the Konami Code:

up up down down left right left right b a enter

The Konami Code

The Konami Code

After this, try scroll down or something. It should give you a flare effect like in this picture:

Facebook trick

Facebook trick

If you want it to stop again, go to your settings or log off.

Next trick:

Big smiley in your Messenger status

Put the following character just before the smiley you want to make HUGE:

⃡͋

Example

⃡͋:D Cool trick

Will look like this:

Big smiley in MSN display name

Big smiley in MSN display name

Thats it… :-)