Skip to content

Instantly share code, notes, and snippets.

View diasjorge's full-sized avatar
🤖

Jorge Dias diasjorge

🤖
View GitHub Profile
cask "gitx-gitx" do
arch = Hardware::CPU.intel? ? "x86_64" : "arm64"
version "0.19"
if Hardware::CPU.intel?
sha256 "c22a03b93d00228eca78aafa2502987f50dd4ce89088660ede1ece81f95c0c68"
else
sha256 "7bba8efece314f07f3e2f70a1b4da34c93eba1ec14692d1d55003ab3742d96cf"
end
#!/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
//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 February 11, 2020 12:45
Gather attributes from a list of subnets with terraform
# 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
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]
# 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) {
#!/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.
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 September 25, 2019 12:25
Add redirect_uri to google oauth credentials with Selenium
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)
#!/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 = '''
---