Skip to content

Instantly share code, notes, and snippets.

View lmayorga1980's full-sized avatar

lmayorga lmayorga1980

  • Spearfishing Co.
  • Bahamas
View GitHub Profile
@lmayorga1980
lmayorga1980 / ansible-facts.sh
Last active June 20, 2024 20:30
Running Ansible Against Windows to Retrieve Facts
##Windows over Winrm
ansible all -m setup -i <IP-ADDRESS>, -u Administrator -e ansible_connection=winrm -e ansible_password="<PASSWORD-HERE>" -e ansible_winrm_server_cert_validation=ignore -e ansible_port=5986
##Linux AWS SSH
ansible all -m setup -i <IP-ADDRESS>, -u ec2-user --private-key <PRIVATE-KEY> -v
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<servicing/>
<settings pass="windowsPE">
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<DiskConfiguration>
<Disk wcm:action="add">
<CreatePartitions>
<CreatePartition wcm:action="add">
<Order>1</Order>
@lmayorga1980
lmayorga1980 / .README.md
Last active May 16, 2023 16:15
OSX NVIM Environment(zsh/nvim/tmux/osx-terminal)
@lmayorga1980
lmayorga1980 / fix_labels.py
Created April 12, 2023 13:02
GCloud Update Labels
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

Terraform Apply

  • terraform apply -auto-approve

Terraform Plan

  • terraform plan -out plan.out -> save the plan
  • terraform show -json plan.out > plan.json -> write the plan as json

Terraform State

@lmayorga1980
lmayorga1980 / my-gcloud-cheat-sheed.md
Last active December 29, 2021 14:21
gcloud useful commands

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 / Nord.terminal
Last active April 21, 2021 12:45
OSX Mac Sur Terminal Theme
<?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>
YnBsaXN0MDDUAQIDBAUGBwpYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMS
AAGGoF8QD05TS2V5ZWRBcmNoaXZlctEICVRyb290gAGjCwwTVSRudWxs0w0ODxARElVO
U1JHQlxOU0NvbG9yU3BhY2VWJGNsYXNzTxAnMC4xNzY0NzA1ODgyIDAuMTk2MDc4NDMx
NCAwLjI1NDkwMTk2MDgAEAGAAtIUFRYXWiRjbGFzc25hbWVYJGNsYXNzZXNXTlNDb2xv
@lmayorga1980
lmayorga1980 / .vimrc.local
Last active April 21, 2021 12:39
Spf13 Personal VIM Scheme
let g:go_version_warning = 0
let g:go_gopls_enabled = 0
let g:hcl_fmt_autosave = 0
let g:tf_fmt_autosave = 0
let g:nomad_fmt_autosave = 0
let g:rainbow_active = 0
set nocompatible
colorscheme nord
set cursorline
"hi CursorLine term=bold cterm=bold guibg=Black
@lmayorga1980
lmayorga1980 / .tmux-2.4.conf
Last active November 5, 2020 21:06
TMux(2.4) Configuration for OSX.
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf
#set-option -g default-command "reattach-to-user-namespace -l zsh"
if-shell "type 'reattach-to-user-namespace' >/dev/null" "set -g default-command 'reattach-to-user-namespace -l $SHELL'"
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
set-option -g status-attr default
# set window split
bind-key v split-window -h
bind-key b split-window
@lmayorga1980
lmayorga1980 / zsh-powerline.xml
Created February 13, 2020 16:53
My ZSH Powerline Terminal OSX Catalina
<?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