The scenario:
- DNS zone
myzone.com
defined in BIND. - Authoritative name server at
123.16.123.1
. - Subzone
sub.myzone.com
with an authoritative name server at123.16.123.10
. - Wishing to forward sub-zone to authoritative name server.
// Adding current user to www-data | |
sudo adduser $USER www-data | |
//change ownership to user:www-data and | |
sudo chown $USER:www-data -R /var/www/html | |
sudo chmod u=rwX,g=srX,o=rX -R /var/www/html | |
// change file permissions of existing files and folders to 755/644 | |
sudo find /var/www/html -type d -exec chmod g=rwxs "{}" \; |
<?php | |
/** | |
* getRandomWeightedElement() | |
* Utility function for getting random values with weighting. | |
* Pass in an associative array, such as array('A'=>5, 'B'=>45, 'C'=>50) | |
* An array like this means that "A" has a 5% chance of being selected, "B" 45%, and "C" 50%. | |
* The return value is the array key, A, B, or C in this case. Note that the values assigned | |
* do not have to be percentages. The values are simply relative to each other. If one value | |
* weight was 2, and the other weight of 1, the value with the weight of 2 has about a 66% | |
* chance of being selected. Also note that weights should be integers. |