Skip to content

Instantly share code, notes, and snippets.

View Nanyte25's full-sized avatar

Mark Freer Nanyte25

View GitHub Profile
@Nanyte25
Nanyte25 / backup-to-s3.sh
Created April 19, 2017 13:26 — forked from aarongustafson/backup-to-s3.sh
backup to S3 as a shell command (uses s3cmd)
#!/bin/bash
##
# Backup Server to S3 script
#
# Creates a local cached backup of the source folder using rsync and then
# synchronises that with Amazon S3.
#
#
# It is assumed you have rsync installed on the server.
@Nanyte25
Nanyte25 / backup-to-s3.sh
Created April 19, 2017 13:28 — forked from MikeRogers0/backup-to-s3.sh
A method of backing up your website to Amazon S3.
#!/bin/bash
## Email Variables
EMAILDATE=`date --date="today" +%y-%m-%d`
EMAIL="you@yourdomain.com"
SUBJECT="[servername] Backup Script Started! - "$EMAILDATE
EMAILMESSAGE="/tmp/emailmessage1.txt"
echo "Just to let you know that the backup script has started."> $EMAILMESSAGE
/bin/mail -s "$SUBJECT" "$EMAIL" < $EMAILMESSAGE

JQL Syntax for the Impatient

There are a few JQL syntax bits to get you started:

  • AND --- allows you to add qualifiers to a list
  • != Thing --- target one thing
  • is in (List, Of, Things) --- target a bunch of things (Done, Closed, Resolved) typically
  • not in (List, of, Things) --- do not include a bunch of things
  • -1w --- relative time. You can also use -1d for day
  • "2015/3/15" --- specific dates
@Nanyte25
Nanyte25 / ansible-summary.md
Created October 17, 2017 11:31 — forked from andreicristianpetcu/ansible-summary.md
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@Nanyte25
Nanyte25 / cloudwatch_events.yml
Created June 6, 2018 13:06 — forked from danvaida/cloudwatch_events.yml
Ansible Playbook for Creating CloudWatch Events Rules with Lambda Targets
# For creating the lambda functions, see instructions here: https://github.com/pjodouin/ansible-lambda
# Run this playbook with:
# ansible-playbook cloudwatch_events.yml --extra-vars debug=True
# Ansible CloudWatch Event module PR: https://github.com/ansible/ansible-modules-extras/pull/2101
# Ansible Lambda modules PR: https://github.com/ansible/ansible-modules-extras/pull/1890
---
- name: CloudWatch Events
hosts: localhost
connection: local
gather_facts: False
@Nanyte25
Nanyte25 / openshift-cheatsheet.md
Last active December 11, 2018 16:59 — forked from rafaeltuelho/openshift-cheatsheet.md
My Openshift Cheatsheet

My Openshift Cheatsheet

Examine the cluster quota defined for the environment:

$ oc describe AppliedClusterResourceQuota

Install pkgs using yum in a Dockerfile

# A script for running a backup of Gitea inside an OpenShift Pod and storing it
# locally. Assumes Gitea is running in the 'gitea' namespace.
readonly NAMESPACE='gitea'
readonly POD_NAME=$(oc get pods -n $NAMESPACE --selector='app=gitea' -o jsonpath='{ .items[0].metadata.name }')
readonly OUTPUT_DIR=${1:-/tmp/gitea-backups}
echo "Creating Gitea backup"
oc exec -n $NAMESPACE $POD_NAME -- /home/gitea/gitea dump -c /home/gitea/conf/app.ini
# Export all objects
$ tower-cli receive --all
# Export all credentials
$ tower-cli receive --credential all
# Export a credential named "My Credential"
$ tower-cli receive --credential "My Credential"
# Import from a JSON file named assets.json
amq_streams: false
amq_streams_repo_url: 'https://github.com/jboss-container-images/amqstreams-1-openshift-image'
amq_version: 1.1.0
apicurito: true
apicurito_version: 0.2.18.Final
application_metrics: false
aws_s3_backup_secret_name: s3-credentials
backup_image: 'quay.io/integreatly/backup-container:{{ backup_version }}'
backup_namespace: openshift-integreatly-backups
backup_resources_location: >-
@Nanyte25
Nanyte25 / aws.rotate_iam.sh
Created May 20, 2020 07:37
aws_rotate_iam_creds
#!/bin/bash
ENVIRONMENT=$1
CLUSTER_ID=$2
# make sure we have no state for the aws cli
unset AWS_PROFILE
unset AWS_ACCESS_KEY_ID
unset AWS_SECRET_ACCESS_KEY
# Region is a mandatory value to be set when using AWS CLI.