These are my notes based on my experience with using Docker on Mac OS X.
If these assumptions are not true for you, then this document may not be for you.
I assume you have these installed:
- recent-ish Mac OS X
#!/bin/sh | |
echo "Content-type: text/html\n\n" | |
echo "<table>" | |
for user in $(ls -1 /home | egrep -v 'travis|ubuntu'); do | |
echo " | |
<tr> | |
<td valign=\"top\"><img src=\"/icons/folder.gif\" alt=\"[DIR]\"></td> | |
<td><a href=\"/~${user}/\">${user}</a></td> | |
</tr>" | |
done |
#!/usr/bin/env bash | |
# Install shc <http://www.datsi.fi.upm.es/~frosal/> on Ubuntu 14.04 | |
# Requires build-essential | |
if [ ! $(whoami) == "root" ]; then | |
echo "Please run as root!" | |
exit 1 | |
fi | |
# download shc package to be compiled |
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible). | |
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export. | |
var FORMAT_ONELINE = 'One-line'; | |
var FORMAT_MULTILINE = 'Multi-line'; | |
var FORMAT_PRETTY = 'Pretty'; | |
var LANGUAGE_JS = 'JavaScript'; | |
var LANGUAGE_PYTHON = 'Python'; |
<!DOCTYPE html> | |
<title>Where am I?</title> | |
<h1>Where am I?</h1> | |
<select id="countries" name="countries"> | |
<option selected>----------</option> | |
<option value="AF">Afghanistan</option> | |
<option value="AL">Albania</option> | |
<option value="DZ">Algeria</option> | |
<option value="AS">American Samoa</option> | |
<option value="AD">Andorra</option> |
{% if site.github %} | |
<script> | |
if (window.location.hostname.indexOf('{{ site.github.pages_hostname }}') !== -1) { | |
window.location = '{{ site.github.url }}'; | |
} | |
</script> | |
{% endif %} |
#!/bin/sh | |
TOKEN="your-domain-api-token" | |
DOMAIN_ID="yourdomain.com" | |
RECORD_ID="12345" # Replace with the Record ID | |
IP="`curl http://jsonip.com | sed 's/{"ip":"\(.*\)"/\1/g' | sed 's/}//'`" | |
curl -H "Accept: application/json" \ | |
-H "Content-Type: application/json" \ | |
-H "X-DNSimple-Domain-Token: $TOKEN" \ |
from django.contrib import admin | |
from django.contrib.auth.admin import UserAdmin | |
from django.contrib.auth.models import User | |
class RestrictedUserAdmin(UserAdmin): | |
""" | |
Prevent permission escalation in when granting “user change” permissions | |
See: http://stackoverflow.com/a/2298268 | |
""" |
from django.contrib import admin | |
from example.models import Example | |
class ExampleAdmin(admin.ModelAdmin): | |
""" | |
Don't allow addition of more than one model instance in Django admin | |
See: http://stackoverflow.com/a/12469482 | |
""" | |
def has_add_permission(self, request): |
machine: | |
post: | |
- nvm use && nvm alias default $(nvm current) |