Skip to content

Instantly share code, notes, and snippets.

@sebasmonia
Last active June 7, 2023 20:40
Show Gist options
  • Save sebasmonia/26ee5dc5c203b4bb46669d998d2028b3 to your computer and use it in GitHub Desktop.
Save sebasmonia/26ee5dc5c203b4bb46669d998d2028b3 to your computer and use it in GitHub Desktop.
(defun hoagie-kmonad-start ()
(interactive)
(start-process "kmonad-process"
"*kmonad*"
"kmonad"
"c:\\home\\.config\\kmonad\\config.kbd")
(message "kmonad started (•_•) ( •_•)>⌐■-■ (⌐■_■)"))
(defun hoagie-kmonad-stop ()
(interactive)
(kill-process "kmonad-process")
(message "kmonad stopped (⌐■_■) (╥﹏╥)>⌐■-■ (╥﹏╥)"))
(global-set-key (kbd "<f5>") #'hoagie-kmonad-start)
(global-set-key (kbd "C-<f5>") #'hoagie-kmonad-stop)
(hoagie-kmonad-start)
@sebasmonia
Copy link
Author

@sebasmonia
Copy link
Author

(defun hoagie-okta-awscli-login (user pass 2fa-token profile)
"Login to a profile with okta-awscli using USER, PASS, 2FA-TOKEN, PROFILE.
Process runs synchronously."
(with-current-buffer (get-buffer-create "okta-awscli output")
(goto-char (point-max))
(insert "Output from okta-awscli @ ")
(insert (format-time-string "%Y-%m-%d %T"))
(insert "\n")
(unless (equal 0 (call-process
"okta-awscli"
nil
t
nil
"--okta-profile" profile "--profile" profile
"-U" user "-P" pass
"-t" 2fa-token "-f"))
(error "okta-awscli returned non-zero exit code"))))

@sebasmonia
Copy link
Author

@sebasmonia
Copy link
Author

@sebasmonia
Copy link
Author

@sebasmonia
Copy link
Author

image

@sebasmonia
Copy link
Author

| Who | Timezone | Start | End |
|-----------+----------+-------+-------|
| Diego | | 9 | 6 |
| Luis | | 8 | 5 |
| Fermin | | 08:30 | 05:30 |
| Pedro | | 8 | 5 |
| Hugo | | | |
| Juan | | | |
| Sebastián | | | |

@sebasmonia
Copy link
Author

sebasmonia commented Mar 9, 2023

@sebasmonia
Copy link
Author

(defun hoagie-okta-awscli-login (user pass 2fa-token profile)
  "Login to a profile with okta-awscli using USER, PASS, 2FA-TOKEN, PROFILE.
Process runs synchronously."
  (with-current-buffer (get-buffer-create  "*okta-awscli output*")
    (goto-char (point-max))
    (insert "Output from okta-awscli @ ")
    (insert (format-time-string "%Y-%m-%d %T"))
    (insert "\n")
    (unless (equal 0 (call-process
                      "okta-awscli"
                      nil
                      t
                      nil
                      "--okta-profile" profile "--profile" profile
                      "-U" user "-P" pass
                      "-t" 2fa-token "-f"))
      (error "okta-awscli returned non-zero exit code"))))
      ```

@sebasmonia
Copy link
Author

@sebasmonia
Copy link
Author

@sebasmonia
Copy link
Author

image

@sebasmonia
Copy link
Author

go get github.com/aws/aws-sdk-go-v2
go get github.com/aws/aws-sdk-go-v2/config

@sebasmonia
Copy link
Author

go get github.com/aws/aws-sdk-go-v2
go get github.com/aws/aws-sdk-go-v2/config

image

@sebasmonia
Copy link
Author

image

image

@sebasmonia
Copy link
Author

@sebasmonia
Copy link
Author

@sebasmonia
Copy link
Author

@sebasmonia
Copy link
Author

(defun golang-stdlib-reference ()
"Open the Go stdlib reference in EWW."
(interactive)
(hoagie-eww-readable (format "https://pkg.go.dev/%s" (read-string "Package: "))))

@sebasmonia
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment