Skip to content

Instantly share code, notes, and snippets.

###########################################################################################################################
#
# Purpose: beaker-rspec acceptance tests for Puppet Fundamentals lab "Apache Virtual Hosts"
#
# Usage: From the courseware directory:
# 1. 'bundle install' to install required gems
# 2. 'bundle exec rspec spec/acceptance/courses/fundamentals/Defined_Resources/Lab_ApacheVirtualHosts_spec.rb' to run the test
#
###########################################################################################################################
@actionjack
actionjack / operating_system.rb
Created September 12, 2016 15:10 — forked from crhan/operating_system.rb
rbenv.spec
module Gem
class << self
##
# Returns full path of previous but one directory of dir in path
# E.g. for '/usr/share/ruby', 'ruby', it returns '/usr'
def previous_but_one_dir_to(path, dir)
split_path = path.split(File::SEPARATOR)
File.join(split_path.take_while { |one_dir| one_dir !~ /^#{dir}$/ }[0..-2])
# Simple SonarQube database and user creation for Postgresql
#
sudo -u postgres psql postgres
CREATE DATABASE sonar;
CREATE USER sonar WITH PASSWORD 'verysecret';
GRANT ALL PRIVILEGES ON DATABASE sonar TO sonar;
@actionjack
actionjack / merge_junit_results.py
Created November 21, 2016 11:34 — forked from cgoldberg/merge_junit_results.py
Merge multiple JUnit XML results files into a single results file.
#!/usr/bin/env python
#
# Corey Goldberg, Dec 2012
#
import os
import sys
import xml.etree.ElementTree as ET
@actionjack
actionjack / gist:72bab35ac1f419b9f68c9c3c5b201393
Last active December 15, 2016 15:30 — forked from fernandoaleman/gist:5083680
How to update VirtualBox Guest Additions with vagrant
# Start the old vagrant
$ vagrant init centos-6.3
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
# this machine, please update the guest additions and repackage the
# box.
@actionjack
actionjack / oathtool totp google 2 factor example.txt
Created February 21, 2017 10:56 — forked from NapoleonWils0n/oathtool totp google 2 factor example.txt
macosx: oathtool totp google 2 factor authentication
#-----------------------------------------------#
# oathtool totp google 2 factor
#-----------------------------------------------#
# if you have already set up 2 factor authentication with your phone
# you need to remove it from your phone and google authenticator app
# this wont invalidate your backup codes or application codes
# login to your google account go to 2 factor authentication,
@actionjack
actionjack / s3_upload.json
Created February 28, 2017 16:51 — forked from mattmcd/s3_upload.json
IAM policy for uploading files to S3
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:ListAllMyBuckets",
"s3:ListBucket",
"s3:CreateBucket"
@actionjack
actionjack / S3 Security Model
Created February 28, 2017 16:52 — forked from apinstein/S3 Security Model
Notes on S3 Security/Permissions Model
How S3 Permission Work
- The AWS account that creates a bucket owns it.
- The owner of a bucket can never be changed.
- All billing for object usage goes to bucket owner account by default. That's one reason ownership cannot be changed.
- Note that objects in the bucket can have permissions that would prevent even the bucket owner from editing/deleting it.
- There are three styles of permissions:
1. Bucket Policies
- Allows access control to be specified for AWS Accounts or IAM Users
- Specified in Access Policy Language
- Can DENY or ALLOW
@actionjack
actionjack / AWSBucketPolicy.json
Last active November 4, 2018 12:01 — forked from mrsarm/AWSBucketPolicy.json
AWS Bucket Policy to deny access to all except NotPrincipal list
{
"Version": "2012-10-17",
"Id": "Policy9999999990001",
"Statement": [
{
"Sid": "Deny access except NotPrincipal list",
"Effect": "Deny",
"NotPrincipal": {
"AWS": [
"arn:aws:iam::123000004567:role/xxxx-eb-ec2-role",

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to: