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 | |
| # | |
| # Transparent Azure-AD SSH for Ansible | |
| # | |
| # * Generates / refreshes the Azure AD user certificate on-demand | |
| # * Falls back to plain OpenSSH for the real connection | |
| # * Can be invoked in parallel by many Ansible forks (uses a lock) | |
| # | |
| set -euo pipefail |
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
| Application.put_env(:phoenix, :json_library, Jason) | |
| Application.put_env(:sample, SamplePhoenix.Endpoint, | |
| http: [ip: {127, 0, 0, 1}, port: 5001], | |
| server: true, | |
| adapter: Bandit.PhoenixAdapter, | |
| secret_key_base: String.duplicate("a", 64) | |
| ) | |
| Application.put_env(:mime, :types, %{ |
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
| e = {1, 2, 3} | |
| e2 = [1, 2, 3] | |
| test_data = [ | |
| e, | |
| e2, | |
| {{{:ok, "http_response"}, nil}}, | |
| URI.parse("//elixir-lang.org/"), | |
| %{this_is: %{cool: true}} | |
| ] |
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
| defmodule Mix.Tasks.CheckRoutes do | |
| use Mix.Task | |
| @shortdoc "Checks for mismatched routes and controller functions" | |
| def run(_) do | |
| # Load the router module | |
| router_module = YourRouter | |
| # Get all routes | |
| routes = router_module.__routes__() |
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
| from datadog_checks.base import AgentCheck | |
| from datadog_checks.base.utils.subprocess_output import get_subprocess_output | |
| __version__ = "0.0.1" | |
| class AptOutdatedCheck(AgentCheck): | |
| def check(self, instance): | |
| stdout, package_counts, retcode = get_subprocess_output("/usr/lib/update-notifier/apt-check", self.log, raise_on_empty_output=False) | |
| outdated_total, outdated_security = package_counts.split(';') | |
| self.gauge("apt.package.outdated.count", int(outdated_total), tags=['kind:total'] + self.instance.get('tags', [])) |
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 | |
| # | |
| # Connect to multiple SSH servers in iTerm split panes for use with iTerm broadcasting. | |
| # | |
| # Read https://iterm2.com/python-api/tutorial/running.html#command-line for how to run this; | |
| # something like | |
| # $ ~/Library/Application\ Support/iTerm2/iterm2env-3.7/versions/3.7.9/bin/python3 ~/Library/Application\ Support/iTerm2/Scripts/ssh_split.py server1 server2 server3 | |
| # | |
| import argparse |
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
| const httpProxy = require('http-proxy'); | |
| const connect = require('connect'); | |
| const serveStatic = require('serve-static'); | |
| const PORT = (process.env.PORT || 3100); | |
| const staticDir = './public'; | |
| const proxy = new httpProxy.createProxyServer(); | |
| const app = connect(); |
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
| git reset HEAD^ -- (git diff HEAD^ --diff-filter=D --name-only --pretty="format:" | grep -e '\.png' -e '\.gif' -e '.\jpg' -e '.\jpeg') |