export AWS_DEFAULT_REGION=ap-northeast-1
aws logs describe-log-groups --query 'logGroups[*].logGroupName' --output table | \
awk '{print $2}' | grep -v ^$ | while read x; do echo "deleting $x" ; aws logs delete-log-group --log-group-name $x; done
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
[alias] | |
deploy = ! git checkout master && git tag-deploy && git push && git push --tags && git push production master | |
deploy-staging = ! git checkout develop && git tag-deploy staging && git push && git push --tags && git push staging develop:master | |
tag-deploy = ! sh -c 'git tag "${0:-production}-`date +%Y%m%d%H%M%S`-$USER"' |
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 argparse | |
import string | |
parser = argparse.ArgumentParser('Change storage class of s3 objects') | |
parser.add_argument('--bucket', dest='myBucket', default='yourBucketName', help='S3 Bucket to search') | |
parser.add_argument('--from', dest='fromPath', default='', help='s3 path to start search from') | |
cliArgs = parser.parse_args() |
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'); | |
const https = require('https'); | |
const url = require('url'); | |
// to get the slack hook url, go into slack admin and create a new "Incoming Webhook" integration | |
const slack_url = 'https://hooks.slack.com/services/...'; | |
const slack_req_opts = url.parse(slack_url); | |
slack_req_opts.method = 'POST'; | |
slack_req_opts.headers = {'Content-Type': 'application/json'}; |
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
# | |
# Replace FILESYSTEM-ID-HERE and REGION-ID-HERE | |
# | |
option_settings: | |
- option_name: EFS_VOLUME_ID | |
value: FILESYSTEM-ID-HERE | |
- option_name: EFS_REGION | |
value: REGION-ID-HERE |
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 | |
### BEGIN INIT INFO | |
# Provides: pocketmine | |
# Required-Start: | |
# Required-Stop: | |
# Should-Start: | |
# Should-Stop: | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 |
When running Puppet in masterless mode, meaning there is no Puppet Master for the node to connect to, one of the problems you have to solve is how to get all your Puppet modules onto the node. Without going into all the possible ways of doing this, one nice and clean way to solve the problem is to use a Puppetfile.
If you know what a Ruby gemfile is, you can guess what a Puppetfile is. If you don't, think of a very simple list declaring the modules that a node should get, including ways to get those modules. Like this:
forge 'forge.puppetlabs.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
/** | |
* @file | |
* Testing a demo of Drupal. The script will log in and check for various | |
* features in Drupal core. This demo was inspired by a similar script for | |
* a Wordpress site. The original script was written by Henrique Vicente. | |
* | |
* @see https://github.com/henvic/phantom-casper-simple-talk/blob/master/wordpress.js | |
*/ | |
// Set up variables to visit a URL and log in. |
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 | |
# remove ':' from screen id | |
PROFILE="session${DISPLAY#:}" | |
PROFILE_DIRECTORY="$HOME/.google-chrome/$PROFILE" | |
mkdir -p $PROFILE_DIRECTORY | |
# import profile (includes bookmark) from origin | |
if [ ! -d "$PROFILE_PATH/Default" ]; then | |
cp -r $HOME/.config/google-chrome/Default $PROFILE_DIRECTORY/Default; |
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 | |
# This script will push your local repository's latest commit to a remote repository on your server. | |
# It's useful for quickly pushing your local changes to deployment servers (Dev, Stage, Prod/Live, etc.) | |
# | |
# This file should be placed in your remote server's project's git hooks folder and named .git/hooks/post-receive. | |
# Security reminder: Your web server should not allow access to the /.git folder URL | |
# | |
# Ensure that this script is executable: | |
# $ chmod +x .git/hooks/post-receive |