selinux, zstd, flatpak, layered, thinkfan, thinkpad t430, thinkpad t480, tailscale, vscode, nix, rpm-fusion, disable network connectivity check, battery charge threshold, firefox, gnome, gnome-terminal, boxes, celluloid, declarative system changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var USERS = { | |
protecteddir: [{ | |
username: 'user', | |
password: 'pass', | |
}], | |
}; | |
//Response when auth is not valid. | |
var response401 = { | |
statusCode: 401, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: 2010-09-09 | |
Description: > | |
Constructs a managed IAM policy to deploy a serverless project. | |
This template assumes the stack is being deployed in the current region and account. | |
You can then attach this policy to other IAM objects, such as users or roles. | |
Based on the work done in: https://github.com/serverless/serverless/issues/1439 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
exports.handler = (event, context, callback) => { | |
// Get request and request headers | |
const request = event.Records[0].cf.request; | |
const headers = request.headers; | |
// Configure authentication | |
const authUser = 'user'; | |
const authPass = 'pass'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var AWS_KEY = '<your key>'; | |
var AWS_SECRET = '<your secret>'; | |
function generateS3Url(bucket, path) { | |
var expiresDt = Math.floor(Date.now() / 1000) + (60 * 60 * 24); // can be up to 7 days from now | |
var stringToSign = 'GET\n\n\n' + expiresDt + '\n/' + bucket + '/' + encodeURIComponent(path); | |
var hmac = Utilities.computeHmacSignature(Utilities.MacAlgorithm.HMAC_SHA_1, stringToSign, AWS_SECRET, Utilities.Charset.UTF_8); | |
var signed = encodeURIComponent(Utilities.base64Encode(hmac)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
STACK:=myapp-dev | |
TEMPLATE:=cloudformation-template_vpc-iam.json | |
PARAMETERS:=cloudformation-parameters_myapp-dev.json | |
AWS_REGION:=us-east-1 | |
AWS_PROFILE:=aws-dev | |
all: | |
@which aws || pip install awscli | |
aws cloudformation create-stack --stack-name $(STACK) --template-body file://`pwd`/$(TEMPLATE) --parameters file://`pwd`/$(PARAMETERS) --capabilities CAPABILITY_IAM --profile $(AWS_PROFILE) --region $(AWS_REGION) |
This is a mix between two sources:
- http://www.alfielapeter.com/posts/8-transferring-s3-bucket-contents-between-accounts-with-s3cmd
- and http://blog.techopsguru.com/2011/12/s3-bucket-copying-with-multiple-accounts.html
basically the first resource is great but didn't work for me: I had to remove the trailing "/*" in the resource string to make it work. I also noticed that setting the policy on the source bucket was sufficient. In the end these are the exact steps I followed to copy data between two buckets on two accounts
Basically the idea there is:
- we allowe the destination account to read the source bucket (in the console for the source account)
- we log as the destination and start the copy