- Install SmartOS
- Login as root (over SSH)
- Create zone (https://wiki.smartos.org/how-to-create-a-zone/):
imgadm import cfa9c88e-03f8-11eb-9980-879ff7980a9f # 20.3.0 64-bit vmadm create <<EOL
{
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
#!/bin/sh | |
set -e # Enable errexit option | |
### Adding arbitrarily large directory structures to IPFS, without running into OOM kills, failure at 99% etc. | |
### Results in directory with same name in MFS, use `ipfs files ls` to see it. | |
### Uses Blake2B for faster hashing and maximum block size, assuming large fiels with lower needs for searching. | |
### Uses filestore as not to duplicate data (make sure to enable it in the ipfs config!). | |
# Create directory structure in MFS |
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
class LimitedAdminInlineMixin(object): | |
""" | |
InlineAdmin mixin limiting the selection of related items according to | |
criteria which can depend on the current parent object being edited. | |
A typical use case would be selecting a subset of related items from | |
other inlines, ie. images, to have some relation to other inlines. | |
Use as follows:: |
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
import platform | |
import re | |
import urllib2 | |
import urlparse | |
from django.core.exceptions import ValidationError | |
from django.core.validators import RegexValidator | |
from django.core.urlresolvers import resolve | |
from django.http import Http404 | |
from django.utils.translation import ugettext_lazy as _ |
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
import logging | |
logger = logging.getLogger(__name__) | |
# Note: we need dnspython for this to work | |
# Install with `pip install dnspython` | |
import dns.resolver, dns.exception | |
from django import forms | |
from django.utils.translation import ugettext as _ |
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
from os.path import splitext | |
from django.core.exceptions import ValidationError | |
from django.utils.translation import ugettext_lazy as _ | |
from django.template.defaultfilters import filesizeformat | |
class FileValidator(object): | |
""" | |
Validator for files, checking the size, extension and mimetype. |
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
from django import template | |
register = template.Library() | |
from templatetag_sugar.register import tag | |
from templatetag_sugar.parser import Constant, Variable, Name | |
from .utils import get_next_or_previous | |
""" | |
Efficient and generic get next/previous tags for the Django template language, |
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
from django.template.defaultfilters import slugify | |
class AutoSlugMixin(object): | |
""" | |
Automatically set slug to slugified version of the name if left empty. | |
Use this as follows:: | |
class MyModel(AutoSlugMixin, models.Model): | |
def save(self): | |
super(MyModel, self).save() |
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
#!/bin/sh | |
./configure \ | |
--with-gdal=/Library/Frameworks/GDAL.framework/Versions/2.4/unix/bin/gdal-config \ | |
--disable-odbc \ | |
CXXFLAGS="-std=gnu++11" \ | |
CPPFLAGS="-I/Library/Frameworks/PROJ.framework/Headers" \ | |
LDFLAGS="-L/Library/Frameworks/PROJ.framework/unix/lib" | |
make -j8 |
- Install XCode from the App Store.
- Install the XCode command line tools from the 'Downloads' pane in the XCode settings.
- Install SublimeText.
Add the following SublimeText configuration options (to User settings):
// Set to true to insert spaces when tab is pressed "translate_tabs_to_spaces": true,
NewerOlder