View dotfiles-atuin-config
This file contains 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
db_path = "~/.config/atuin/history.db" | |
dialect = "uk" | |
style = "compact" | |
inline_height = 25 | |
invert = true | |
update_check = false | |
sync_frequency = "5m" | |
{{- if eq (env "CODESPACES") "true" }} | |
auto_sync = true |
View gist:63010c3024030f2f76f4c0b20becfb55
This file contains 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
# https://bendews.com/posts/implement-dns-over-https | |
configure | |
set service dns forwarding options "no-resolv" | |
set service dns forwarding options "server=127.0.0.1#5053" | |
delete service dns forwarding options "server=1.1.1.1" | |
commit | |
save | |
exit | |
sudo /etc/init.d/dnsmasq force-reload |
View 1-rule.rego
This file contains 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
# Here is the basic Rego rule | |
package main | |
# deny creating duplicate resource in the same namespace | |
deny_duplicate_resources[{"msg": msg, "details": details}] { | |
i != j | |
currentFilePath = input[i].path | |
input[i].contents.kind == input[j].contents.kind | |
input[i].contents.metadata.name == input[j].contents.metadata.name |
View temp_handler.py
This file contains 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
sql_con = sqlite3.connect('medbot.db') | |
temp_regex = re.compile(r'[0-9]{2}[.][0-9]') | |
async def track_temp(ctx: ChatContext) -> None: | |
## or not is_med_group(ctx): | |
if ctx.message.empty(): | |
return | |
name = get_name(ctx) # No included, just a regex to pull out the childs name from the msg | |
temp = temp_regex.search(ctx.message.get_body().lower()).group() |
View dsc_config.ps1
This file contains 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
<# | |
.SYNOPSIS | |
Uses PowerShell DSC to configure the machine to run the container | |
.PARAMETER Image | |
Docker Image to run complete with tag | |
.PARAMETER Command | |
Command to run in the docker image | |
.PARAMETER RegistryUrl | |
Azure container registry url |
View .Dockerfile
This file contains 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
# Very basic devcontainer, see line 15 copying in build agent start script | |
# https://github.com/Azure/azure-functions-docker/blob/master/host/3.0/buster/amd64/dotnet/dotnet-core-tools.Dockerfile | |
FROM mcr.microsoft.com/azure-functions/dotnet:3.0-dotnet3-core-tools | |
# To make it easier for build and release pipelines to run apt-get, | |
# configure apt to not require confirmation (assume the -y argument by default) | |
ENV DEBIAN_FRONTEND=noninteractive | |
RUN echo "APT::Get::Assume-Yes \"true\";" > /etc/apt/apt.conf.d/90assumeyes | |
# Install system tools |
View main.tf
This file contains 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
terraform { | |
required_providers { | |
shell = { | |
source = "scottwinkler/shell" | |
version = "1.7.7" | |
} | |
} | |
} | |
resource "azurerm_function_app" "functions" { |
View storagediagnosticlogs.tf
This file contains 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
resource "random_string" "random" { | |
length = 5 | |
special = false | |
upper = false | |
number = false | |
} | |
resource "azurerm_log_analytics_workspace" "core" { | |
name = "corelaw${random_string.random.result}" | |
location = "westeurope" |
View run.ps1
This file contains 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
Install-Module -Name Pester -RequiredVersion 4.6.0 -force | |
$testFilePath = "./tests" | |
# Start a jobs running each of the test files | |
$testFiles = Get-ChildItem $testFilePath | |
$resultFileNumber = 0 | |
foreach ($testFile in $testFiles) | |
{ | |
$resultFileNumber++ | |
$testName = Split-Path $testFile -leaf |
View buildyamlsnippet.yaml
This file contains 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
- job: ciml | |
displayName: "Machine Learning CI" | |
pool: | |
vmImage: 'Ubuntu 20.04' | |
steps: | |
- task: PowerShell@2 | |
displayName: 'Run CI Task from make.ps1 in Devcontainer' | |
inputs: | |
targetType: 'inline' | |
script: 'Install-Module -Name PSake -Force && Invoke-psake ./make.ps1 ciml' |
NewerOlder