<?php
// List all Timezoney for Europe
var_dump('Timezones:', DateTimeZone::listIdentifiers(DateTimeZone::EUROPE));
$timeZone = new DateTimeZone("Europe/Sofia");
$dateTime = new DateTime("now", $timeZone);
$timeOffset = $dateTime->getOffset();
// get offset in hours with daylight time savings included
var_dump('Offset:', $timeOffset / 3600);
Calculate timezone offset and list all available time zones.
Regular Expressions:
. (any character)* (zero of more of the preceding)+ (one or more of the preceding){} (minimum to maximum quantifier)? (ungreedy modifier)! (at start of string means "negative pattern")^ (start of string, or "negative" if at the start of a range)$ (end of string)[] (match any of contents)- (range if used between square brackets)() (group, backreferenced group)| (alternative, or)\ (the escape character itself)Flags:
By default p tags are block elements, which means they take 100% of the parent width.
You can change their display property with:
#container p {
display:inline-block;
}
But it puts the elements side by side.
To keep each element on its own line you can use:
#container p {
clear:both;
float:left;
}
When you setup WP you (the webserver) may need write access to the files. So the access rights may need to be loose.
chown www-data:www-data -R * # Let Apache be owner
find . -type d -exec chmod 755 {} \; # Change directory permissions rwxr-xr-x
find . -type f -exec chmod 644 {} \; # Change file permissions rw-r--r--
After the setup you should tighten the access rights, according to Hardening WordPress all files except for wp-content should be writable by your user account only. wp-content must be writable by www-data too.
chown <username>:<username> -R * # Let your useraccount be owner
chown www-data:www-data wp-content # Let apache be owner of wp-content
Maybe you want to change the contents in wp-content later on. In this case you could
www-data with su,www-data orUpdate:
new shit
define('FS_METHOD', 'direct'); // in wp-config.php
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
WS_GROUP=www-data # <-- webserver group
# reset to safe defaults
find ${WP_ROOT} -exec chown ${WP_OWNER}:${WP_GROUP} {} \;
find ${WP_ROOT} -type d -exec chmod 755 {} \;
find ${WP_ROOT} -type f -exec chmod 644 {} \;
# allow wordpress to manage wp-config.php (but prevent world access)
chgrp ${WS_GROUP} ${WP_ROOT}/wp-config.php
chmod 660 ${WP_ROOT}/wp-config.php
# allow wordpress to manage wp-content
find ${WP_ROOT}/wp-content -exec chgrp ${WS_GROUP} {} \;
find ${WP_ROOT}/wp-content -type d -exec chmod 775 {} \;
find ${WP_ROOT}/wp-content -type f -exec chmod 664 {} \;
Use the sharing options in nemo.
..then..
Add user and password to samba.
sudo smbpasswd -a [username]