The first thing to do is to install Git on the remote server.
Once you do that the rest of the process is split into three sections:
- Server set-up
- Local set-up (push commits)
- Server (pull commits)
import difflib | |
print("Levenshtein distance implementation !") | |
_str = 'appel' | |
difflib.get_close_matches('appel', ['ape', 'apple', 'peach', 'puppy'], n=2) | |
# returns ['apple', 'ape'] | |
# difflib.get_close_matches finds the best "good enough" matches. | |
# Here, first argument is being matched against the second one. |
# ____ _ _ ____ ___ _ _ | |
# | _ \| | / \ / ___|/ _ \| \ | | | |
# | |_) | | / _ \| | _| | | | \| | | |
# | __/| |___ / ___ \ |_| | |_| | |\ | | |
# |_| |_____/_/ \_\____|\___/|_| \_| | |
# -------------------------------------- | |
from os import listdir as os_listdir, path as os_path | |
# pip install -U scikit-learn | |
from sklearn.feature_extraction.text import TfidfVectorizer |
import React from 'react'; | |
const handleDragStart = (event: React.DragEvent) => { | |
event.dataTransfer.effectAllowed = 'move'; | |
event.dataTransfer.setData( | |
'text/plain', | |
event.currentTarget.getAttribute('data-index'), | |
); | |
}; |
# Assuming you have a Article Model like this | |
# class Article(models.Model): | |
# ... Some field | |
# media = models.FileField(upload_to="path_to_inner_media_folder", blank=True) | |
from django.core.files.base import ContentFile | |
import os | |
# Create an article with the associated model | |
new_article = Article() |
from __future__ import absolute_import, unicode_literals | |
import django | |
import django.forms | |
import wagtail.wagtailforms.models as form_models | |
from django.db import models | |
from django.shortcuts import render | |
from django.utils.translation import ugettext_lazy as _ | |
from modelcluster.fields import ParentalKey | |
from wagtail.wagtailadmin.edit_handlers import ( |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
fabfile for Django | |
------------------ | |
see http://morethanseven.net/2009/07/27/fabric-django-git-apache-mod_wsgi-virtualenv-and-p/ | |
modified for fabric 0.9/1.0 by Hraban (fiëé visuëlle) | |
several additions, corrections and customizations, too |
package storage | |
import ( | |
"context" | |
_ "github.com/aws/aws-sdk-go-v2/feature/s3/manager" | |
"github.com/aws/aws-sdk-go-v2/service/s3" | |
"github.com/aws/aws-sdk-go-v2/service/s3/types" | |
_ "github.com/aws/aws-sdk-go-v2/service/s3/types" | |
) |
When it comes to databases and AWS VPC, best practice is to place your database in private subnet. By definition, private subnet in AWS is not reachable from the Internet because no Internet gateway is attached to private subnet. This is the way you protect your data. This kind of configuration is good for security but bad for data management.
How can you easily access and manage your secured data?
There are two basic ways to acees it.
###### | |
# Author: Marcello de Sales (marcello.desales@gmail.com) | |
# Description: Create Create Environment Variables in EC2 Hosts from EC2 Host Tags | |
# | |
### Requirements: | |
# * Install jq library (sudo apt-get install -y jq) | |
# * Install the EC2 Instance Metadata Query Tool (http://aws.amazon.com/code/1825) | |
# | |
### Installation: | |
# * Add the Policy EC2:DescribeTags to a User |