- source/ -> kopiert nur den Inhalt des Verzeichnisses
- source -> kopiert auch den Ordner selbst
- Option -avz behält u.a. das Änderungsdatum (a), komprimiert die Datein bei der Übertragung (z) und gibt Infos aus (v)
- Filterregeln: https://askubuntu.com/questions/320458/how-to-exclude-multiple-directories-with-rsync
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html { | |
box-sizing: border-box; | |
} | |
*, *:before, *:after { | |
box-sizing: inherit; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_expires.c> | |
ExpiresActive on | |
ExpiresDefault "access plus 1 month" | |
# CSS | |
ExpiresByType text/css "access plus 1 year" | |
# Data interchange | |
ExpiresByType application/atom+xml "access plus 1 hour" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function uuid() | |
{ | |
return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', | |
mt_rand(0, 0xffff), mt_rand(0, 0xffff), | |
mt_rand(0, 0xffff), | |
mt_rand(0, 0x0fff) | 0x4000, | |
mt_rand(0, 0x3fff) | 0x8000, | |
mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* GitHub webhook handler template. | |
* | |
* @see https://developer.github.com/webhooks/ | |
* @author Miloslav Hůla (https://github.com/milo) | |
*/ | |
$hookSecret = 's.e.c.r.e.t'; # set NULL to disable check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Elixir asset helper | |
* | |
* @param string $file File name | |
* @return string | |
* | |
* @throws \InvalidArgumentException | |
*/ | |
function elixir($file) |
- https://pngquant.org/
sudo apt-get install pngquant
- https://addyosmani.com/blog/image-optimization-tools/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## From https://github.com/te-online | |
# BEGIN Performance | |
# Compress text files | |
<IfModule mod_deflate.c> | |
AddOutputFilterByType DEFLATE text/plain | |
AddOutputFilterByType DEFLATE text/html | |
AddOutputFilterByType DEFLATE text/xml | |
AddOutputFilterByType DEFLATE text/css |
- Init local git repository (remember to create
.gitginore
withwp-config.php
before staging anything) - Configure SSH-key access to server with git [https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/, https://help.ubuntu.com/community/SSH/OpenSSH/Keys#Transfer_Client_Key_to_Host]
- Init a bare repo on the server
git init && git config core.bare true
- Create a new post-receive hook with
nano .git/hooks/post-receive
(content see below!) - Execute
chmod 755 post-receive
on the script - Add remote to local repository
git remote add staging [email protected]:www/your-website
- Try pushing
git push staging master
- Check if everything works as expected.
- Add a
.htaccess
to the.git
directory with content:deny from all