Skip to content

Instantly share code, notes, and snippets.

View lmayorga1980's full-sized avatar

lmayorga lmayorga1980

  • UKG
  • Bermuda
View GitHub Profile
@lmayorga1980
lmayorga1980 / fix_labels.py
Created April 12, 2023 13:02
GCloud Update Labels
View fix_labels.py
import subprocess
import json
lb1 = "label1"
lb2 = "label2"
gcloud_instances_command = "gcloud compute instances list --filter=\"labels.lb1:*\" --format json"
gcloud_disks_command = "gcloud compute disks list --filter=\"-labels:lb1 AND -labels:lb2\" --format json"
result = subprocess.run(gcloud_instances_command, shell=True, text=True, capture_output=True)
@lmayorga1980
lmayorga1980 / README.md
Last active March 26, 2022 12:06
Terraform Notes
View README.md
@lmayorga1980
lmayorga1980 / .README.md
Last active May 16, 2023 16:15
OSX NVIM Environment(zsh/nvim/tmux/osx-terminal)
View .README.md
@lmayorga1980
lmayorga1980 / my-gcloud-cheat-sheed.md
Last active December 29, 2021 14:21
gcloud useful commands
View my-gcloud-cheat-sheed.md

Images

  • gcloud compute images list --project ubuntu-os-cloud --filter="name:ubuntu-2004*"
  • gcloud compute images describe cis-windows-server-2012-r2-v2-2-1-level-1 --project cis-public --format json
  • gcloud compute images list --project cis-public
  • gcloud compute images list --project windows-cloud

References

@lmayorga1980
lmayorga1980 / zsh-powerline.xml
Created February 13, 2020 16:53
My ZSH Powerline Terminal OSX Catalina
View zsh-powerline.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPECcw
LjMwNTg4MjM1MjkgMC4zMDU4ODIzNTI5IDAuMzA1ODgyMzUyOQAQAoAC0hAREhNaJGNs
YXNzbmFtZVgkY2xhc3Nlc1dOU0NvbG9yohIUWE5TT2JqZWN0XxAPTlNLZXllZEFyY2hp
@lmayorga1980
lmayorga1980 / zsh-powerline.xml
Created February 13, 2020 16:53
My ZSH Powerline Terminal OSX Catalina
View zsh-powerline.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPECcw
LjMwNTg4MjM1MjkgMC4zMDU4ODIzNTI5IDAuMzA1ODgyMzUyOQAQAoAC0hAREhNaJGNs
YXNzbmFtZVgkY2xhc3Nlc1dOU0NvbG9yohIUWE5TT2JqZWN0XxAPTlNLZXllZEFyY2hp
@lmayorga1980
lmayorga1980 / click_subcommand.py
Created January 11, 2020 15:13
Click Subcommands
View click_subcommand.py
import click
@click.group()
def account():
pass
@account.command()
def list():
click.echo('This is the list command')
@lmayorga1980
lmayorga1980 / scan-ports.py
Created January 8, 2020 15:40
Scan Ports with NMap
View scan-ports.py
`nmap -p0- -v -A -T4 <ip>`
@lmayorga1980
lmayorga1980 / ami-cleanup.py
Created November 18, 2019 15:43
Cleanup Old AMIS
View ami-cleanup.py
from __future__ import print_function
import json
import boto3
import logging
from datetime import datetime, timedelta
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def get_outdated_images():
@lmayorga1980
lmayorga1980 / kitchen-docker-windows-inspec-1.md
Last active June 18, 2019 01:12
Kitchen Docker Windows Inspec
View kitchen-docker-windows-inspec-1.md

error

D, [2019-06-17T18:05:02.138580 #4032] DEBUG -- Kitchen: Class: Kitchen::ActionFailed
D, [2019-06-17T18:05:02.141131 #4032] DEBUG -- Kitchen: Message: Failed to complete #verify action: [getaddrinfo: No such host is known.  (SocketError)]
D, [2019-06-17T18:05:02.143625 #4032] DEBUG -- Kitchen: ----------------------

Gemfile