This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| gemini_licenses.py - A CLI tool to manage Google Cloud Gemini Enterprise Licenses | |
| This script interacts with the Google Cloud Discovery Engine API to manage user | |
| licenses for Gemini Enterprise. It supports listing subscriptions, listing | |
| assigned licenses, batch assigning/removing licenses, syncing state from a CSV, | |
| and pruning stale unused licenses. | |
| Prerequisites: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import argparse | |
| import os | |
| import sys | |
| import json | |
| import httpx | |
| import google.auth | |
| import google.auth.transport.requests | |
| # ------------------------------------------------------------------------------ | |
| # Configuration & Constants |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Android ClientState Security Patch Updater | |
| ========================================== | |
| Function: | |
| This script syncs the Android Security Patch level from the device inventory | |
| (Google Endpoint Management) into a custom "Client State" attribute. | |
| It writes a single value to a custom Client State on every device: | |
| - securityPatchLevel (String): e.g., "2023-10-05T00:00:00Z" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import argparse | |
| import csv | |
| import os | |
| import json | |
| import logging | |
| import socket | |
| import sys | |
| import time | |
| from itertools import batched |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "Secure Cloud Console Redirect", | |
| "version": "1.0", | |
| "declarative_net_request": { | |
| "rule_resources": [ | |
| { | |
| "id": "ruleset_1", | |
| "enabled": true, | |
| "path": "rules1.json" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| runtime: python314 | |
| handlers: | |
| - url: / | |
| secure: always | |
| script: auto | |
| redirect_http_response_code: 301 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Optimized Chrome Extension ID generator | |
| in_file="$1" | |
| if [[ ! -f "$in_file" ]]; then | |
| echo "ERROR: File ${in_file} does not exist" | |
| exit 1 | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| runtime: python314 | |
| handlers: | |
| - url: /.* | |
| secure: always | |
| script: auto |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| ### | |
| ### Shell script to reset Yubikey PIV app and then fully generate and setup a | |
| ### non-exportable private key on the Yubikey that's ready to make mTLS | |
| ### requests. | |
| ### | |
| ### Running on Ubuntu, the following packages are needed: | |
| ### | |
| ### sudo apt update; sudo apt install opensc yubikey-manager gnutls-bin libengine-pkcs11-openssl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| ''' | |
| Perform 3-legged OAuth with optional mTLS and Google Workspace API calls | |
| ''' | |
| import argparse | |
| import http.client | |
| import json | |
| import os |
NewerOlder