git fetch <remote>
git checkout -b <branch> --track <remote>/<branch>
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
# Automatic nginx virtual subdomains with sub-folders or sub-directories | |
# | |
# Since the original source where I found this code is now offline, I have decided to mirror it here. | |
# All credit goes to: http://web.archive.org/web/20150307193208/http://www.messaliberty.com/2010/10/automatic-nginx-virtual-subdomains-with-sub-folders-or-sub-directories | |
# | |
# Description: In my web root directory I wanted create a folder called photos, and another called | |
# music using a sftp program. Without manually going back to the config file or to the shell I like to | |
# be able to access them at photos.nginxdomain.com and music.nginxdomain.com. That is what this config does. | |
# Redirect visitors from http://nginxdomain.com/ to http://www.nginxdomain.com/ |
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 | |
DBUSER="root"; | |
DBPASS=""; | |
DBHOST="localhost"; | |
DB_OLD=mydatabase | |
DB_NEW=clone_mydatabase | |
DBCONN="--host=${DBHOST} --user=${DBUSER} --password=${DBPASS}"; |
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: S3 Queue Notifications Test | |
Metadata: | |
AWS::CloudFormation::Interface: | |
ParameterGroups: | |
- Label: | |
default: Stack Variables | |
Parameters: | |
- Environment | |
- Label: |
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
Using jq, we can convert between CloudFormation parameter files and CodePipeline template configuration files: | |
$ jq '{ Parameters: [ .[] | { (.ParameterKey): .ParameterValue } ] | add } ' < cloudformation_parameter_file.json | |
This is useful in the case of receiving 'Template configuration is not valid' when running a CloudFormation action. | |
A CloudFormation parameter file has format: | |
[ | |
{ |
echo '
#! /bin/bash
####### yum update is optional #####
#yum -y update
yum install firewalld -y
systemctl start firewalld
firewall-cmd --add-port=8300/tcp --add-port=8301/tcp --add-port=8302/tcp --add-port=8400/tcp --add-port=8500/tcp --add-port=80/tcp --add-port=443/tcp --permanent
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: Global assets needed for Inventory Discovery | |
Metadata: | |
AWS::CloudFormation::Interface: |
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
import boto3 | |
import time | |
# Example RDS Instance tags: | |
# | |
# Scheduled : True | |
# ScheduleStart : 06:00 | |
# ScheduleStop : 18:00 | |
## |
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
S3Bucket: | |
Type: "AWS::S3::Bucket" | |
Properties: | |
BucketName: | |
Fn::Sub: "${TagProduct}-${TagEnvironment}-${TagEnvironmentNumber}-audit-${AWS::AccountId}-${AWS::Region}" | |
NotificationConfiguration: | |
QueueConfigurations: | |
- Event: "s3:ObjectCreated:*" | |
Queue: | |
Fn::GetAtt: [ "ObjectCreatedQueueAudit", "Arn" ] |
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: Configure AWS CloudTrail | |
Parameters: | |
ManagedResourcePrefix: | |
Type: 'String' | |
Description: 'Prefix for the managed resources' | |
EnableLogFileValidation: | |
Type: String |
OlderNewer