Skip to content

Instantly share code, notes, and snippets.

View andreacarriero's full-sized avatar
:octocat:

Andrea Carriero andreacarriero

:octocat:
View GitHub Profile
require 'base64'
require 'digest'
require 'openssl'
require 'fileutils'
module Jekyll
class ProtectedPage < Page
def aes256_encrypt(password, cleardata)
digest = Digest::SHA256.new
digest.update(password)
---
layout: default
---
{{ page.title | escape}}
<div id="content">
Insert password for decryption
<input id="password" type="password">
<button onclick="decrypt()">Decrypt</button>
docker:
- image: circleci/python:3.6.1
steps:
- checkout
- setup_remote_docker
- run:
name: Install AWScli
command: pip install awscli --upgrade --user
@andreacarriero
andreacarriero / setup_openvpn_management.yml
Created February 28, 2018 21:46
[Ansible Playbook] Setup UFW for SSH and OpenVPN than install OpenVPN management script
---
- hosts: vpn
tasks:
- name: ensure ufw installed
apt:
name: ufw
update_cache: true
- name: ufw deny incoming
ufw:
echo "LANG=en_US.utf-8" >> /etc/environment
echo "LC_ALL=en_US.utf-8" >> /etc/environment
@andreacarriero
andreacarriero / setup_firewall.yml
Created February 28, 2018 19:25
[Ansible Playbook] Setup UFW to allow only incoming ssh connections
---
- hosts: all
become: true
tasks:
- name: ensure ufw installed
apt: name=ufw update_cache=true
- name: ufw deny incoming
ufw:
direction: incoming