For symmetic encryption, you can use the following:
To encrypt:
openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt
To decrypt:
from random import randint | |
def d6(): | |
return randint(1,6) | |
day = money = 0 | |
time = patience = 10 | |
while day < 10 and money < 10: | |
day += 1 |
from __future__ import print_function | |
import argparse | |
import boto3 | |
def copy_table(source, target): | |
dynamodb = boto3.resource("dynamodb") | |
source_table = dynamodb.Table(source) | |
target_table = dynamodb.Table(target) |
# Reference: https://www.exclamationlabs.com/blog/continuous-deployment-to-npm-using-gitlab-ci/ | |
# GitLab uses docker in the background, so we need to specify the | |
# image versions. This is useful because we're freely to use | |
# multiple node versions to work with it. They come from the docker | |
# repo. | |
# Uses NodeJS V 9.4.0 | |
image: node:9.4.0 | |
# And to cache them as well. |
AWSTemplateFormatVersion: '2010-09-09' | |
Description: Cognito Stack | |
Parameters: | |
AuthName: | |
Type: String | |
Description: Unique Auth Name for Cognito Resources | |
Resources: | |
# Creates a role that allows Cognito to send SNS messages | |
SNSRole: |
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "AWS CloudFormation sample template that contains a single Lambda function behind an API Gateway", | |
"Resources": { | |
"GreetingLambda": { | |
"Type": "AWS::Lambda::Function", | |
"Properties": { |
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "Launches a Jenkins server.", | |
"Parameters": { | |
"InstanceType": { | |
"Description": "EC2 instance type", | |
"Type": "String", | |
"Default": "t2.small", | |
"AllowedValues": [ | |
"t1.micro", |
{% assign all_hosts = "" | split: "" %} | |
{% for host in site.data.shared_hosts %} | |
{% assign all_hosts = all_hosts | push: host %} | |
{% endfor %} | |
{% for host in site.data.paas_hosts %} | |
{% assign all_hosts = all_hosts | push: host %} | |
{% endfor %} |
<?php | |
/** | |
* Time unit defaults to seconds to follow the example shown here: | |
* http://mitan.co.uk/erlang/elgcmath.htm | |
* exp calculates e to some specified exponent: | |
* https://secure.php.net/manual/en/function.exp.php | |
* factorial function for php: | |
* http://www.hackingwithphp.com/4/18/0/recursive-functions | |
* Basically, all calculated values are private. |
@JSONObject | |
public class Slideshow { | |
@JsonField(name = "id") | |
int mSlideshowId; | |
@JsonField(name = "created_at") | |
long mCreatedAt; | |
@JsonField(name = "title") | |
String mTitle; | |
@JsonField(name = "user_id") | |
int mUserId; |