Skip to content

Instantly share code, notes, and snippets.

Jorge Dias diasjorge

Block or report user

Report or block diasjorge

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View nginx-error_page.conf
# Add into server block
# Put maintenance page in /home/ubuntu/maintenance/maintenance.html
# Return a 503 error if the maintenance page exists.
if (-f /home/ubuntu/maintenance/maintenance.html) {
return 503;
}
location @503 {
if (-f $request_filename) {
View kubetcl-ssh
#!/usr/bin/env bash
trap 'kubectl delete pod $container >/dev/null 2>&1 &' 0 1 2 3 15
usage() { echo -e "Usage: kubectl ssh <options> <pod name>" && grep " .)\ #" $0; exit 0; }
[ $# -eq 0 ] && usage
while getopts ":u:c:p:n:h" arg; do
case $arg in
p) # Specify pod name.
View spinnaker-sizing.yml
spin-redis-bootstrap:
limits:
memory: 1Gi
requests:
memory: 200Mi
spin-front50:
limits:
memory: 1.5Gi
requests:
memory: 1Gi
@diasjorge
diasjorge / selenium-google-oauth-redirect-uri.rb
Last active Sep 25, 2019
Add redirect_uri to google oauth credentials with Selenium
View selenium-google-oauth-redirect-uri.rb
require 'selenium-webdriver'
urls = ['https://example.com']
CREDENTIALS_PAGE = 'https://console.cloud.google.com/apis/credentials/oauthclient/XXXXXXXXXXXXXXXXXXXXX'
driver = Selenium::WebDriver.for(:chrome)
driver.get(CREDENTIALS_PAGE)
View wait_for_instance_profile.py
#!/usr/bin/python
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
View redblack.json
{
"keepWaitingPipelines": false,
"lastModifiedBy": "jdias@example.com",
"limitConcurrent": true,
"parameterConfig": [],
"stages": [
{
"baseLabel": "release",
"baseOs": "bionic",
"cloudProvider": "gce",
View get-most-recent-ami-aws-cli.sh
aws ec2 --region us-east-1 describe-images --query 'reverse(sort_by(Images, &CreationDate))[0].ImageId' --output text
@diasjorge
diasjorge / find-message.sh
Created Jun 14, 2019
Find all branches first message
View find-message.sh
while read line; do
branch=$(echo $line | awk '{print $1}')
message=$(echo $line| sed 's/origin[^ ]* //')
commits=$(git log origin/master --format=oneline --grep "$message")
if [ -n "$commits" ]; then
echo "$branch - $message"
echo "-"
echo "$commits"
echo ""
fi
@diasjorge
diasjorge / tag-eip-instance-name.py
Last active May 30, 2019
Tag elastic ips with their instance name using boto 3
View tag-eip-instance-name.py
import boto3
ec2 = boto3.client('ec2', region_name='us-east-2')
addresses = ec2.describe_addresses()['Addresses']
for address in addresses:
if 'InstanceId' not in address:
continue
View cleanup.py
#!/usr/bin/env python
from google.cloud import monitoring_v3
# # Using a service account with credentials in a json file:
# JSON_CREDS = 'monitoring.json'
# from oauth2client.service_account import ServiceAccountCredentials
# scopes = ["https://www.googleapis.com/auth/monitoring",]
# credentials = ServiceAccountCredentials.from_json_keyfile_name(
# JSON_CREDS, scopes)
You can’t perform that action at this time.