Site Cloner PHP Script
Bargain Hunter PHP Script
Job Hunter PHP Script
Site Login and Access Control PHP Script

Resizing a Fixed Size Virtual Machine Using Virtualbox on Windows

Although it could be a hindsight or a mistake, you could have a Virtual machine that is almost out of disk space and you feel your only option is to resize it. If this is the case, this lesson will explain how you can do that.

The first step is to clone the fixed disk sized Virtual machine. The code is shown below.
In order to do this, you will need to open up the Command Prompt with administrative priviliges. For example, you may find it at All Programs >Accessories >Command Prompt. Just right click to open as an administrator.

Once you have opened it, you will need to navigate to the folder where the VBoxmanage.exe file is located. In this case, it isn located at ‘C:\Program Files\Oracle\VirtualBox’.

 cd C:\Program Files\Oracle\VirtualBox 

The next step is to use the clonehd command to clone a VDI file. The example is shown below and it uses 2 parameters at the end to state the VDI file type and to make it a standard VDI. A standard VDI is dynamic and resizable, unlike the original.

 VBoxManage.exe clonehd "C:\Users\ted\VirtualBox VMs\Ubuntu 14_04 64-bit Clone\Ubuntu 14_04 64-bit Clone-disk1.vdi" "C:\Users\ted\VirtualBox VMs\Ubuntu 14_04 64-bit Clone\Ubuntu 14_04 64-bit Clone-disk2.vdi" --format VDI --variant Standard 

Resizing the Disk Space

The command below can be used to resize the new clone into your desired size. In this case, it was made to be about 10 GB.

 VBoxManage modifyhd "C:\Users\ted\VirtualBox VMs\Ubuntu 14_04 64-bit Clone\Ubuntu 14_04 64-bit Clone-disk2.vdi" --resize 10000 

For more instructions, you can see a previous article about resizing dynamic disks used with Virtualbox.


How To Transfer a Domain From Godaddy To Dynadot

2) Login to your Dynadot account.
2) Select ‘Your Account’.
3) Scroll down the page and look for Transfer Domain on the right hand side.
4) Login to GoDaddy and go to the desired domain you want to transfer. Domain Manager will have your list of domains.
5) Unlock the domain and get your AUTH code emailed to you.
6) Back at Dynadot, add the domain you want to transfer anbd put in the AUTH code.
7) At this point, you can check out the shopping cart with Dynadot.
8) Now, you will get an email from Godaddy to ‘Accept ‘ or ‘Decline’ the transfer. You obviously click ‘Accept’.
9) Finally, you just need to wait out the process.


How To Develop A Website

This article will explain how to develop a website. The methods explained may not be suitable for all users, but, the could enable you to start with a blank editor at point A and end up with a completed website at point B which loads at example.com.

To build a web site will need a domain name, the website files and database(if using a database) and hosting. The domain name must point to the location where the website is hosted. For example, you can point the nameservers for example.com to ns1.example.com and ns2.example.com.

Those are the basics to having a website on the web. However, I could go on about hosting and files until you would be so bored reading this you would be missing the good stuff which is about to come. 

how to develop a website
 


The Files

As far as the files go, they could be written from a professional programmer or they could be a commercial template with the words and images swapped. This area is wide open and the skill range can be huge. The coding could be php, C#, Java, Python, html, css, Jquery and mySQL… to name a few. For a noob, you may only use a template and edit the HTML files and swap images.

The Hosting

Cheap is a good way to start since traffic needs to be earned and it can take quite a while to have so much that you need a better service.

Full Stack Web Developer

Getting to the expert zone of things, you would have an overall grasp of the Linux server, SEO, programming in multiple languages and some graphic design skills. Of course, you may have weaknesses. 

As a full stack web web developer, you possess the skills to oversee all parts of a project and manage all who are involved.

For example, you could be a Linux and PHP / mySQL expert that does the heavy lifting and website set up. At this point, you have many options to complete a project. You could use a system like Smarty templating and outsource the design work. You can put the jobs up for bid, or use a service like Fiverr. You could send a rough image to graphic artist on Fiverr and get a $5 job that is a good as a local web designer who thinks it is worth $50.

Since the web design work and imagery has so many options for you to use, the full stack web developer can pick and choose what SEO and design work to hire that will save lots of time and yield good results. This is efficiency.


Why Every Web Developer Should Write or Blog

This might come as a surprise to write such an article, but it could help with your journey as a web developer / programmer. The main reason I would even suggest such a title or this advice can be put in the next simple sentence. All coding can be learned much more effectively if it is presented to you in a form that you learn best.

Before we get to your writing, let’s start with something you can relate to… good teacher and bad teacher. For example, I remember taking Calculus back in the day when one teacher was in his own world and nobody really knew what he was talking about. To make things worse, the text book he chose was written by an author who just could not get through to the masses.

After the semester, I switched to a professor that was great communicator that kept everyone interested. In addition to that, he wrote the textbook which just made sense. Now, the outcome should be obvious and I will state the obvious. Since the second teacher had made learning easier and enjoyable, the concepts stuck and my grade was significantly better.

So, with that said, I will continue explaining why your should blog or write. The main reason is that your notes and methods probably make the best fit for your learning. Therefore, if you read or learn from another source and it is off the grid from your normal methodology, you may want to create a better resource you can always come back to. Here is where you can create a code snippet and great blog post that not only will help others and yourself, but, it will save you time in the future when you need to use it again. If there is one thing a web developer will do in the future it is doing something very similar to what he had already done. 

Asides from structured learning and a better resource, your blogging and writing could help supplement your career choice and drive targetted traffic your way.

Although writing and blogging can accelerate your skills, it does not mean that other sources are invaluable.. just the opposite. It is always good to learn how to see through the eyes of another and know what the coding does. The more code you read from other sources, the better you will be at handing all sorts of coding from various web applications, frameworks and content management systems. Eventually, the coding suprises will become fewer and far between and your production will skyrocket.

Essentially, your writing should be an accellerator and your reading and curiosity should better your knowledge.


Web Development Skills

The definition for a web developer is rather broad and the skills needed to become a web developer can be very, very diverse too. Nevertheless, I will attempt to explain the skills that could be implemented by a web developer.

Please note that larger companies often hire specific people to do various coding and graphic design for a website. Therefore, defining this term ‘web developer’ can be a little more difficult. But, if the company is a freelance web developer, it can be more easily to define since one person would oversee and maintain the projects. Since a web developer will be doing and managing all entire projects, the developer is often referred to as a ‘Full Stack Web Developer’.

For the remainder of the article, the description for a web developer will be related to one freelance web developer who maintains all the websites.

Web Developer Skills
 


Introducing Typical Progression For a Web Developer

Normally, a future web developer starts off by making basic static websites with html code. Then, other client side languages like Javascript and Jquery are introduced. After that, making dynamic websites with a server side language like PHP and a database like mySQL is implememted and PHP / mySQL is used. However, some people actually build a website based on these languages using a tool like WordPress, but, they have no idea about the code under the hood. Not having a deeper understanding will cause big limitations for building custom websites.

Once a person has strong skills with the coding previously described, he may move on to knowing more about the system where the files are stored. More often than not, that is a Linux distribution. Knowing how to navigate the file system and commanding it will really help a web developer.

Apart from the website, a web developer may want to have the ability to create mobile applications for Android and the iphone. in addition, custom apps for other web sites like Facebook could be added to the toolkit too. 

For the next level, knowing a low or medium level compiling language like C can make it easy to edit and create custom Linux packages. The next section will detail the steps of progression.

The stages of progression to be able to code secure applications and edit and run the Linux system can take a while. However, persistence and a strong desire to be able to have a large array of web development tools will help make the journey an enjoyable process.

On top of all of the code and systems that will be used, a web developer will need to be able to analyze content, SEO and Google Adwords accounts. Traffic is always important and it is an ongoing procedure. There are many tools that will help the web developer analyze and deliver the desired results. 

The rest of this article will go into more detail onto the topics that had been previously mentioned. 

Web Development Skills 

Website Coding Skills

On a basic level, a web developer should have the skills to create and maintain a database driven website. This would include knowledge of the file system and all coding for the website. For example, a website could contain PHP , mySQL, Html5, CSS, XML, Javascript and JQuery.

Meanwhile, another web developer could maintain a similar website but that person uses ASP, MSSQL, Html5, CSS, XML, Javascript and Jquery. As you can see, the main differences here are the scripting language and database. 

Asides from the actual languages, there are many programmed applications that have graphical user interfaces and you may want to become familiar with them. For example, content management systems like Joomla, WordPress and Joomla and shopping carts like Magento and Prestashop use PHP , mySQL, html and css; but you actually create pages with a ‘point and click’ system. Then, you may dig into the source code for web pages and make alterations. Therefore, using these systems efficiently can be important to completing projects quickly.

Beyond The Website

Email

After there are websites, you often have the need to create and modify email accounts. An email server will run on the hosting accounts and it will be used so that people can send and receive email from the website address.

Traffic Analysis

Once websites have been built, the web developer can use tools that analyze visitor log files (ie Awstats) or add Javascript to the website files to monitor traffic with Google Analytics. Google Analytics can allow you to view where the visitors came from, what pages are being viewed and much more.

Google Web Master Tools

Google Webmaster Tools is very valuable for users to view their impressions from organic traffic and upload sitemaps for the websites. It also has many other useful tools like ‘Fetch as Bot’ so you can see what the Google bot receives when it hits your web pages. Spam can be injected into pages and this tool can let you know if Google is receiving clean pages. Also, there are tools to check for infected pages too.

Google Adwords

Using Google Adwords can be used to bring in desired traffic and help find beneficial paid and organic keywords. Many large companies gain most of their revenue from this service.

Coding Beyond The Website

As times goes forward, it is very likely your skills will too. So, if you acquire significant traffic to your website, or find a need for which you need a custom web server setup, there will probably come a day when you will need to migrate from a shared or cloud host to a VPS or dedicated server. When this happens, your whole world as you knew it could change since you will have root access to the Linux operating system and will need to take care of this system. If you don’t want to care for the operating system, you will need to pay someone to do that for you.

With that said, having Linux System Administrator skills will mean that you will like need a decent skillset with Bash, Sed, Awk and knowledge of the Linux file system. There are courses that will teach these skills.

On top of that, you may come to a point where you will be regularly editing installed Linux packages like the Apache server and Varnish. Like a lot of Linux packages and system files, they are written in C. So, learning C would not hurt as well. If you have a fairly strong background with PHP or Perl, you will find editing C files sort of straight forward. In addition, learning C will give the deeper understanding to your Unix based operating system too.

If you want to create your own C programs and packages for Linux, building them with C is an option. After you build and compile them, you can run them like any other package.

Conclusion

As you see, the toolbox for a web developer can be rather broad. You may find a person calling himself a web developer that builds basic web pages with html / css that are stored on a shared host, or you could find one that has a more well rounded skillset using the LAMP(Linux, Apache, mySQL and PHP) stack.


Protect Yourself From Image Hotlinking

In web development terms, hotlinking takes place when a remote server links to your images and uses them in their for their own purposes. Although it is a negative activity, the best way to deal with it is to not allow your content to be snatched. The easiest way to perform this task is to use Cpanel, Apache or .htaccess. The tutorial will describes these procedures with Cpanel and .htaccess.


Cpanel

With Cpanel, you can login and select ‘Hotlink Protection’. Once you read this page, you can add your domains, file extensions and enable this feature. When you enable this feature, your .htaccess has these new directives written it. Although this feature convenient, it can leave a lot of code within the htaccess file, especially if you have many addon domains within a Cpanel account.

 

Alter Settings

 


HTACCESS

Using your HTACCESS file is a very good method to fine disable hotlinking. Adding the snippet below into your .htaccess file will result in example.com and example.ca domains to have access to the image links. 

HTTP

RewriteCond %{HTTP_REFERER} !^http://(.+\.)?example\.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?example\.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?example\.ca/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpeg|jpg|gif|bmp|png)$ – [F,NC]

HTTPS

The example below will disable hotlinking for http and https image links. The change from above is that it checks to see if the https variable is set. In the second set of conditions, the code allows only the https version of the website to pull images.

RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_REFERER} !^(http)://example.ca/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^(http)://example.ca$      [NC]
RewriteCond %{HTTP_REFERER} !^(http)://www.example.ca/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^(http)://www.example.ca$      [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ – [F,NC]

RewriteCond %{HTTPS} =on
RewriteCond %{HTTP_REFERER} !^https://example.ca/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://example.ca$      [NC]
RewriteRule .*\.(jpe?g|gif|bmp|png)$ – [F,NC]

When you add ‘RewriteCond’ and ‘RewriteRule’, they come in pairs with the conditions followed by the rules. You can have multiple sets of conditions and rules.


Checking and testing Hotlinking

You can test to see if your images can be hotlinked by going to the websites
http://altlab.com/hotlinkchecker.php or http://www.htaccesstools.com/test-hotlink-protection/

Its is important to make sure that no images are kept in the cache when you make a check.

Varnish users

If you use the Varnish cache, you will need to restart the service with the Linux command line or use the Varnish Admin to flush the Varnish cache, in addition to clearing the browser cache(if necessary). The Varnish admin command is shown below.

A simpler way to explain the details above is to make sure to flush every caching system. If you use only Varnish, flush it. If you use browser caching, flush it. 

root# varnishadm “ban req.http.host ~ example.com”


Extra HTACCESS Tips

Now that you have hotlinking working, you may want to make a few other minor adjustments to your image files and folders. One major detail you may want to add to make sure thaat nobody can see a list of files within a folder.

To deny users the ability to read a list of files within a directory you can add one of theb two code blocks shown below. Although both give the desired results for hiding images, the first option hides all files from being listed while the second block does not allow listing to take place.

Options +Indexes
IndexIgnore *
Options -Indexes