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
console.log('Loading function'); | |
var AWS = require('aws-sdk'); | |
AWS.config.region = 'us-west-2'; | |
exports.handler = function(event, context) { | |
console.log("\n\nLoading handler\n\n"); | |
var sns = new AWS.SNS(); | |
sns.publish({ |
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
language: ruby | |
git: | |
submodules: false | |
env: | |
global: | |
- AWS_DEFAULT_REGION=eu-west-1 | |
- secure: somestring | |
- secure: somestring |
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
http://d.stavrovski.net/blog/post/how-to-install-and-setup-oracle-java-jdk-in-centos-6 | |
# rpm | |
wget --no-cookies \ | |
--no-check-certificate \ | |
--header "Cookie: oraclelicense=accept-securebackup-cookie" \ | |
"http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.rpm" \ | |
-O jdk-7-linux-x64.rpm | |
# ubuntu |
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
The following characters have special meaning to the shell itself in some contexts and may need to be escaped in arguments: | |
` Backtick (U+0060 Grave Accent) | |
~ Tilde (U+007E) | |
! Exclamation mark (U+0021) | |
# Hash (U+0023 Number Sign) | |
$ Dollar sign (U+0024) | |
& Ampersand (U+0026) | |
* Asterisk (U+002A) | |
( Left Parenthesis (U+0028) |
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
#!/bin/sh | |
# Make sure to: | |
# 1) Name this file `backup.sh` and place it in /home/ubuntu | |
# 2) Run sudo apt-get install awscli to install the AWSCLI | |
# 3) Run aws configure (enter s3-authorized IAM user and specify region) | |
# 4) Fill in DB host + name | |
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket) | |
# 6) Run chmod +x backup.sh | |
# 7) Test it out via ./backup.sh |
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
from __future__ import absolute_import, print_function, unicode_literals | |
import boto3 | |
def clean_old_lambda_versions(): | |
client = boto3.client('lambda') | |
functions = client.list_functions()['Functions'] | |
for function in functions: | |
versions = client.list_versions_by_function(FunctionName=function['FunctionArn'])['Versions'] | |
for version in versions: |
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
### What we are trying to achieve is this: (https://aws.amazon.com/premiumsupport/knowledge-center/authenticate-mfa-cli/) with automatic script ### | |
### Remember you need to install aws-cli and use aws configure to add the credentails, to run aws commands ### | |
### Also assuming you have enabled MFA on aws console and know how to generate MFA code using Authy/Google Authenticator/ etc. | |
#!/bin/bash -xe | |
# Getting temporary credentails from aws using MFA token from authy or google authenticator | |
ARN=arn:aws:iam::{Account ID}:mfa/{UserName} | |
# checking for aws path |
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
#!/bin/bash | |
set -eu | |
export SNAP_NAME="microk8s" | |
export SNAP_DATA="/var/snap/microk8s/current/" | |
export SNAP="/snap/microk8s/current/" | |
export PATH="$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH" | |
source $SNAP/actions/common/utils.sh |
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
Dear BOSS, | |
Please accept this letter as formal notification that I am resigning from my position as JOB TITLE with COMPANY. My last day will be DATE OF LAST DAY. | |
Thank you so much for the opportunity to work in this position for the past DURATION. I’ve greatly enjoyed and appreciated the opportunities I’ve had to WTF DID YOU DO, and I’ve learned many things, all of which I will take with me throughout my career. | |
During my last two weeks, I’ll do everything possible to wrap up my duties and train other team members. Please let me know if there’s anything else I can do to aid during the transition. | |
I wish COMPANY continued success, and I hope to stay in touch in the future. | |
Sincerely, |
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
#### This script is written to update your kubeconfig file for eks. It will first get sts token for the role, that is mapped | |
#### with EKS cluster kubernetes using aws_auth config map. And then update your kubeconfig file for the cluster. | |
#### Replace role-arn with the role that is mapped with EKS cluster kubernetes using aws_auth config map. | |
#### Ref: https://docs.aws.amazon.com/eks/latest/userguide/add-user-role.html | |
#!/bin/bash | |
echo $(whoami) |
OlderNewer