$ ssh -A vm
$ git config --global url."git@github.com:".insteadOf "https://github.com/"
$ cat ~/.gitconfig
[url "git@github.com:"]
insteadOf = https://github.com/
$ go get github.com/private/repo && echo Success!
Success!
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
| #!/bin/sh | |
| # Reset Parallels Desktop's trial and generate a casual email address to register a new user | |
| rm /private/var/root/Library/Preferences/com.parallels.desktop.plist /Library/Preferences/Parallels/licenses.xml | |
| jot -w pdu%d@gmail.com -r 1 |
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
| -- Create a group | |
| CREATE ROLE readaccess; | |
| -- Grant access to existing tables | |
| GRANT USAGE ON SCHEMA public TO readaccess; | |
| GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess; | |
| GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO readaccess; | |
| -- Grant access to future tables | |
| ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess; |
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
| from django.conf import settings | |
| from django.utils import translation | |
| class LocaleByDomainMiddleware(): | |
| def process_request(self, request): | |
| host = request.META['HTTP_HOST'].lower() | |
| locales = dict(settings.LOCALE_DOMAINS) | |
| if not host in locales: |
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
| # | |
| # Launches configured Graylog 2.3.1 instance | |
| # | |
| # - Docker-compose 1.16 required | |
| # - Please configure following according to your network: | |
| # * gelf-address URL (for each container) | |
| # * GRAYLOG_WEB_ENDPOINT_URI | |
| # - After launch define GELF tcp and GELF udp inputs in graylog web ui | |
| # - Containers send logging to the graylog itself | |
| # - By default tuned to 30 days retention |
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
| // To the extent possible under law, the Yawning Angel has waived all copyright | |
| // and related or neighboring rights to orhttp_example, using the creative | |
| // commons "cc0" public domain dedication. See LICENSE or | |
| // <http://creativecommons.org/publicdomain/zero/1.0/> for full details. | |
| package main | |
| import ( | |
| // Things needed by the actual interface. | |
| "golang.org/x/net/proxy" |
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
| #!/bin/bash | |
| # Usage: | |
| # $ ./heroku-deploy.sh <app name> <git repo url> <heroku api key> | |
| APP="$1" | |
| REPO="$2" | |
| APIKEY="$3" | |
| echo "-----> Creating application $APP" | |
| curl -u ":$APIKEY" -d "app[name]=$APP" -X POST https://api.heroku.com/apps -s > /dev/null |