Skip to content

Instantly share code, notes, and snippets.

Avatar
🤖

Jorge Dias diasjorge

🤖
View GitHub Profile
View gitx-gitx.rb
cask "gitx-gitx" do
arch = Hardware::CPU.intel? ? "x86_64" : "arm64"
version "0.19"
if Hardware::CPU.intel?
sha256 "c22a03b93d00228eca78aafa2502987f50dd4ce89088660ede1ece81f95c0c68"
else
sha256 "7bba8efece314f07f3e2f70a1b4da34c93eba1ec14692d1d55003ab3742d96cf"
end
View snapshots.py
#!/usr/local/bin/python3
import csv
import re
from collections import OrderedDict
from pprint import pprint
import boto3
import click
from botocore.exceptions import ClientError
View tsohost.com.js
//Get dns records
results = []
$('form[name="existing"] .clientareatableactive').each(function(i,e) {
var inputs = e.querySelectorAll('input,select');
console.log(e.innerHTML)
results.push({
data: inputs[4].value,
type: inputs[1].value,
record_ttl: inputs[2].value,
host: inputs[0].value,
@diasjorge
diasjorge / main.tf
Created Feb 11, 2020
Gather attributes from a list of subnets with terraform
View main.tf
# terraform aws_subnet return multiple elements
data "aws_vpc" "main" {
tags = {
Name = "your-vpc"
}
}
data "aws_subnet_ids" "main" {
vpc_id = data.aws_vpc.main.id
View gist:60c88da6c3512b70155ee2dd1721d043
ubuntu@host:~$ ruby --version
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
ubuntu@host:~$ sudo add-apt-repository -y ppa:brightbox/ruby-ng
Hit:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://us-east-1.ec2.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:3 http://us-east-1.ec2.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Hit:4 https://archive.serverdensity.com/ubuntu bionic InRelease
Hit:5 https://pkg.threatstack.com/v2/Ubuntu bionic InRelease
Get:6 http://packages.cloud.google.com/apt google-cloud-logging-wheezy InRelease [3,795 B]
Get:7 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
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 = '''
---