Created
October 17, 2014 15:08
-
-
Save fedir/5b1b050d56e414495e02 to your computer and use it in GitHub Desktop.
Simple shell renderer with example of usage
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
export DEVELOPER="fedir" | |
export PROJECT_KEY="toto" | |
./render templates/vhostDev > templates/toto |
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
#!/usr/bin/python | |
# Usage : render templateFile > renderedFile | |
import fileinput | |
import os | |
import re | |
def transform(match): | |
return os.getenv(match.group(1)) | |
for line in fileinput.input(): | |
print re.sub('\$(\w+)', transform, line) |
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
<VirtualHost *:80> | |
ServerAdmin webmaster@localhost | |
DocumentRoot /home/$DEVELOPER/www/$PROJECT_KEY/www/ | |
<Directory /> | |
Options FollowSymLinks | |
AllowOverride None | |
</Directory> | |
<Directory /home/$DEVELOPER/www/$PROJECT_KEY/www/> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride None | |
Order allow,deny | |
allow from all | |
</Directory> | |
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ | |
<Directory "/usr/lib/cgi-bin"> | |
AllowOverride None | |
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch | |
Order allow,deny | |
Allow from all | |
</Directory> | |
ErrorLog /home/$DEVELOPER/www/$PROJECT_KEY/logs/error.log | |
# Possible values include: debug, info, notice, warn, error, crit, alert, emerg. | |
LogLevel warn | |
CustomLog /home/$DEVELOPER/www/$PROJECT_KEY/logs/access.log combined | |
Alias /xcache-admin "/usr/share/xcache/admin/" | |
<Directory "/usr/share/xcache/admin/"> | |
Order Allow,Deny | |
Allow from all | |
</Directory> | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment