Last active
December 16, 2015 20:29
-
-
Save jcantrell-trulia/5492868 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| import re,sys | |
| username = sys.argv[1] | |
| for line in sys.stdin: | |
| break | |
| fh = open('.htaccess_mobile') | |
| for line in fh: | |
| line = re.sub(r'^#(RewriteBase /~)username/web/$', r'\1'+username+'/web/', line) | |
| sys.stdout.write(line) |
This file contains hidden or 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 | |
| import re,sys, subprocess | |
| for line in sys.stdin: | |
| break | |
| command = ["git", "--no-pager", "show", "HEAD:.htaccess"] | |
| p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | |
| for line in iter(p.stdout.readline, b''): | |
| sys.stdout.write(line) |
This file contains hidden or 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 | |
| import re,sys | |
| username = sys.argv[1] | |
| for line in sys.stdin: | |
| line = re.sub(r'^#(RewriteBase %URI_PATH%)$', r'\1', line) | |
| line = re.sub(r'^(RewriteBase /~)'+username+r'/web/$', r'#\1roger/web/', line) | |
| line = re.sub(r'^(php_value error_log /home/)'+username+r'(/logs/php_error_log)', r'#\1roger\2', line) | |
| sys.stdout.write(line) |
This file contains hidden or 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 | |
| import re,sys | |
| username = sys.argv[1] | |
| for line in sys.stdin: | |
| line = re.sub(r'^(RewriteBase %URI_PATH%)$', r'#\1', line) | |
| line = re.sub(r'^#(RewriteBase /~)roger/web/$', r'\1'+username+'/mob/', line) | |
| line = re.sub(r'^#(php_value error_log /home/)roger(/logs/php_error_log)', r'\1'+username+r'\2', line) | |
| sys.stdout.write(line) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment