- GitHub Staff
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
| # ESPHome file for accessing serial relays on a Eujgoov 4-Channel WiFi Smart Home Relay Module | |
| # https://www.amazon.com/dp/B09LQNYPHQ | |
| esphome: | |
| name: relay-controller | |
| friendly_name: relay-controller | |
| esp8266: | |
| board: esp01_1m | |
| framework: | |
| version: recommended |
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 os | |
| import sys | |
| import logging | |
| from bs4 import BeautifulSoup | |
| from markdownify import markdownify as md | |
| def convert_html_to_markdown(folder): | |
| # Set up logging | |
| logging.basicConfig(filename='conversion.log', level=logging.INFO, | |
| format='%(asctime)s - %(levelname)s - %(message)s') |
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
| curl -H "Authorization: token ${GH_PAT}" -X POST \ | |
| -d '{"query": "mutation {create_org: createEnterpriseOrganization(input: {adminLogins: [\"<ADMIN_HANDLE>\", \"<ADMIN_HANDLE>\", \"<ADMIN_HANDLE>\"] billingEmail: \"<ADMIN_EMAIL>\" enterpriseId: \"<ENTPRISE_ID>\" login: \"<ORG_SLUG>\" profileName: \"<ORG_FULL_NAME>\" }){organization {id}}}"}' https://api.github.com/graphql |
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 ruby | |
| require 'octokit' | |
| require 'json' | |
| client = Octokit::Client.new(access_token: ENV['GITHUB_TOKEN']) | |
| query = <<-GRAPHQL | |
| query { | |
| enterprise(slug: "<MY-ENT-NAME>"){ |
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
| package policy["com.styra.kubernetes.validating"].test.test | |
| import data.policy["com.styra.kubernetes.validating"].rules.rules | |
| test_block_priv_mode { | |
| in := { | |
| "kind": "AdmissionReview", | |
| "request": { | |
| "kind": { | |
| "kind": "Pod", |
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
| block_priv_mode[decision] { | |
| not excludedNamespaces[input.request.namespace] | |
| data.library.v1.kubernetes.admission.workload.v1.block_privileged_mode[message] | |
| decision := { | |
| "allowed": false, | |
| "message": message | |
| } | |
| } |
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
| enforce[decision] { | |
| not excludedNamespaces[input.request.namespace] | |
| data.library.v1.kubernetes.admission.workload.v1.block_privileged_mode[message] | |
| decision := { | |
| "allowed": false, | |
| "message": message | |
| } | |
| } |
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
| test_post_allowed { | |
| in := {"path": ["users"], "method": "POST"} | |
| allow with input as in | |
| } |
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
| #example_test.rego | |
| test_post_allowed { | |
| allow with input as {"path": ["users"], "method": "POST"} | |
| } |
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
| #example.rego | |
| package authz | |
| allow { | |
| input.path == ["users"] | |
| input.method == "POST" | |
| } |
NewerOlder