openvpn learn-address script to manage a hosts-like file
- intended to allow dnsmasq to resolve openvpn clients
- written for openwrt (busybox), but should work most anywhere
| // Handlebars Localisation Helper | |
| // Source: https://gist.github.com/tracend/3261055 | |
| Handlebars.registerHelper('l10n', function(keyword) { | |
| var lang = (navigator.language) ? navigator.language : navigator.userLanguage; | |
| // pick the right dictionary (if only one available assume it's the right one...) | |
| var locale = window.locale[lang] || window.locale['en-US'] || window.locale || false; | |
| // exit now if there's no data | |
| if( !locale ) return target; |
| #!/bin/sh | |
| # was it a merge? | |
| if test `git rev-list --parents -n 1 HEAD | wc -w` -lt 3; then | |
| exit 0; | |
| fi | |
| if test `git rev-list ^HEAD^1 HEAD^@ -- sq/migrations | wc -l` -gt 0; then | |
| echo '#' | |
| echo '# WARNING: Migrations detected in merge; you may want to apply them.' |
| from fabric.api import env, run, sudo, local, put | |
| def production(): | |
| """Defines production environment""" | |
| env.user = "deploy" | |
| env.hosts = ['example.com',] | |
| env.base_dir = "/var/www" | |
| env.app_name = "app" | |
| env.domain_name = "app.example.com" | |
| env.domain_path = "%(base_dir)s/%(domain_name)s" % { 'base_dir':env.base_dir, 'domain_name':env.domain_name } |
| # Guide | |
| # Configure the essential configurations below and do the following: | |
| # | |
| # Repository Creation: | |
| # cap deploy:repository:create | |
| # git add . | |
| # git commit -am "initial commit" | |
| # git push origin master | |
| # | |
| # Initial Deployment: |
| """ | |
| This fabric file makes setting up and deploying a django application much | |
| easier, but it does make a few assumptions. Namely that you're using Git, | |
| Apache and mod_wsgi and your using Debian or Ubuntu. Also you should have | |
| Django installed on your local machine and SSH installed on both the local | |
| machine and any servers you want to deploy to. | |
| _note that I've used the name project_name throughout this example. Replace | |
| this with whatever your project is called._ |