- Enable Firewall
- Enable FileVault
- Disable all sharing
0.- Install XCode Compiler
| import boto3 | |
| # Get the service resource | |
| sqs = boto3.resource('sqs') | |
| # Get the queue. This returns an SQS.Queue instance | |
| queue = sqs.get_queue_by_name(QueueName='my-queue') | |
| # You can now access identifiers and attributes | |
| logger.info(queue.url) |
| #!/bin/bash | |
| echo "Creating docker machine on AWS: $1" | |
| source .env | |
| docker-machine create -d amazonec2 \ | |
| --amazonec2-access-key=$AWS_ACCESS_KEY_ID \ | |
| --amazonec2-secret-key=$AWS_SECRET_ACCESS_KEY \ | |
| --amazonec2-vpc-id=$AWS_VPC_ID \ | |
| --amazonec2-instance-type=c4.4xlarge \ |
| # ViewSets define the view behavior. | |
| class FooViewSet(viewsets.ModelViewSet): | |
| lookup_field = 'slug' | |
| queryset = Foo.objects.all() | |
| serializer_class = FooSerializer | |
| def get_queryset(self): | |
| """ | |
| This view should return a list of all records |
| ; Assumes dockerfile with: | |
| ; ENTRYPOINT ["/usr/bin/supervisord", "-c", "/var/app/supervisord.conf"] | |
| [supervisord] | |
| ;logfile=/var/app/logs/ ; (main log file;default $CWD/supervisord.log) | |
| logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB) | |
| logfile_backups=5 ; (num of main logfile rotation backups;default 10) | |
| loglevel=debug ; (log level;default info; others: debug,warn,trace) | |
| pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid) | |
| nodaemon=true ; (start in foreground if true;default false) |
| class SampleFilter(filters.FilterSet): | |
| start_date = django_filters.DateFilter(name="date", lookup_type='gte') | |
| end_date = django_filters.DateFilter(name="date", lookup_type='lte') | |
| # How to filter by a foreign key that uses slug as a lookup | |
| foo = django_filters.ModelMultipleChoiceFilter( | |
| queryset=MyModel.objects.all(), | |
| to_field_name='slug', | |
| conjoined=True, | |
| ) | |
| class Meta: |
| /** | |
| * This is based on: http://docs.aws.amazon.com/lambda/latest/dg/walkthrough-s3-events-adminuser.html | |
| */ | |
| // dependencies | |
| var async = require('async'); | |
| var AWS = require('aws-sdk'); | |
| var gm = require('gm').subClass({ imageMagick: true }); // Enable ImageMagick integration. | |
| var util = require('util'); | |
| var MAX_WIDTH; |
| if [ -f ~/.bashrc ]; then | |
| source ~/.bashrc | |
| fi | |
| # pip should only run if there is a virtualenv currently activated | |
| export PIP_REQUIRE_VIRTUALENV=true | |
| gpip(){ | |
| # gpip allows to install on global env | |
| PIP_REQUIRE_VIRTUALENV="" pip "$@" | |
| } |
| {% extends "base.html" %} | |
| {% load i18n %} | |
| {% block media %} | |
| <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/s/bs/dt-1.10.10,r-2.0.0/datatables.min.css"/> | |
| {% endblock %} | |
| {% block js %} | |
| <!-- DataTable --> | |
| <script type="text/javascript" src="https://cdn.datatables.net/s/bs/dt-1.10.10,r-2.0.0/datatables.min.js"></script> |
| //Sample using LiquidCrystal library | |
| #include <LiquidCrystal.h> | |
| #include <CurieBLE.h> | |
| // select the pins used on the LCD panel | |
| LiquidCrystal lcd(8, 9, 4, 5, 6, 7); | |
| // define some values used by the panel and buttons | |
| int lcd_key = 0; | |
| int adc_key_in = 0; |