DOCKER_SOCKET=/var/run/docker.sock
DOCKER_GROUP=docker
JENKINS_USER=jenkins
if [ -S ${DOCKER_SOCKET} ]; then
DOCKER_GID=$(stat -c '%g' ${DOCKER_SOCKET})
sudo groupadd -for -g ${DOCKER_GID} ${DOCKER_GROUP}
sudo usermod -aG ${DOCKER_GROUP} ${JENKINS_USER}
fi
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
/* | |
* object.watch polyfill | |
* | |
* 2012-04-03 | |
* | |
* By Eli Grey, http://eligrey.com | |
* Public Domain. | |
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. | |
*/ |
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
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
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
----- Esc ----- | |
Quick change directory: Esc + c | |
Quick change directory history: Esc + c and then Esc + h | |
Quick change directory previous entry: Esc + c and then Esc + p | |
Command line history: Esc + h | |
Command line previous command: Esc + p | |
View change: Esc + t (each time you do this shortcut a new directory view will appear) | |
Print current working directory in command line: Esc + a | |
Switch between background command line and MC: Ctrl + o | |
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name |
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 command below creates a tgz file with all emails for user@domain.com in .eml format: | |
# execute as root | |
/opt/zimbra/bin/zmmailbox -z -m user@domain.com getRestURL "//?fmt=tgz" > /tmp/account.tgz | |
# You can do the same via a REST URL: | |
wget http://ZIMBRA.SERVER/home/user@domain.com/?fmt=tgz | |
# to restore email: | |
/opt/zimbra/bin/zmmailbox -z -m user@domain.com postRestURL "//?fmt=tgz&resolve=reset" /tmp/account.tgz |
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
_sls_templates() { | |
_values \ | |
'VALID TEMPLATES' \ | |
'aws-nodejs' \ | |
'aws-python' \ | |
'aws-java-maven' \ | |
'aws-java-gradle' | |
} | |
_sls_regions() { |
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
#!/usr/bin/env python | |
# | |
# copy all SSM parameter store parameters to disk | |
# | |
import os, sys, argparse, boto3 | |
parser = argparse.ArgumentParser(description='copy all parameter values to local') | |
parser.add_argument("--path", dest="path", required=True, | |
help="to copy the keys from", metavar="STRING") | |
parser.add_argument("--directory", dest="directory", required=True, |
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
1) Install cloudflared using homebrew: | |
brew install cloudflare/cloudflare/cloudflared | |
2) Create /usr/local/etc/cloudflared/config.yaml, with the following content | |
proxy-dns: true | |
proxy-dns-upstream: | |
- https://1.1.1.1/dns-query | |
- https://1.0.0.1/dns-query |
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
#!/usr/bin/env python | |
""" | |
This script deletes empty log streams from cloudwatch log groups. | |
Your shell should be configured for connecting to the AWS API. This can be done | |
with the CLI command `aws configure`. | |
This script requires Python 3.6 or newer, and you must have boto3 installed. | |
""" |
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: 'CloudFormation exports' | |
Conditions: | |
HasNot: !Equals [ 'true', 'false' ] | |
# dummy (null) resource, never created | |
Resources: | |
NullResource: | |
Type: 'Custom::NullResource' |
OlderNewer