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 -S uv run --script | |
| # /// script | |
| # requires-python = ">=3.14" | |
| # dependencies = ["httpx>=0.28.1"] | |
| # /// | |
| from pathlib import Path | |
| from dataclasses import dataclass | |
| import inspect | |
| import logging | |
| import httpx |
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
| # Drop this in your profile file and you're good to go. | |
| # Creating ~\.aws\credentials file from creds stored in the aws powershell tools | |
| function Set-BotoCredentials { | |
| [CmdletBinding()] | |
| param ( | |
| [parameter()] | |
| [string] | |
| $ProfileName = 'default' | |
| ) |
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
| # Install the AWS tools for PowerShell, then drop this in e.g. your profile file. | |
| # As a bonus it exports `$Env:ECRHOST` which you can use when e.g. tagging or | |
| # pushing images. | |
| function Grant-ECRAccess { | |
| [CmdletBinding()] | |
| param ( | |
| [parameter()] | |
| [string] | |
| $ProfileName = 'default', |
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
| # Just drop this in the 'Scripts' directory in your virtualenv and run it. | |
| $Dir = Split-Path ((Get-Variable MyInvocation).Value).MyCommand.Path | |
| $Scripts = Get-ChildItem $Dir | Where-Object {($_.name -match '\.py$') -and ($_.name -notmatch '^activa | |
| te')} | |
| foreach ($Script in $Scripts) { | |
| Write-Output "python $($Script.Fullname) @args" | Out-File ($Script.Fullname -replace '\.py$','.ps1') | |
| } |
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
| # Description: Boxstarter Script, forked from Jessie Frazelle's verseion | |
| # Author: Ilkka <ilkka@ilkka.io> | |
| # Last Updated: 2017-09-26 | |
| # | |
| # Install boxstarter: | |
| # . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force | |
| # | |
| # You might need to set: Set-ExecutionPolicy RemoteSigned | |
| # | |
| # Run this boxstarter by calling the following from an **elevated** command-prompt: |
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 jq -r -f | |
| ._meta.hostvars[] | | |
| select(.openstack.metadata.Group | contains("my-host-group"))? | | |
| ("Host " + .openstack.name + "\n Hostname " + .ansible_host + "\n User myusername") |
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
| describe("dummy", function () { | |
| before(function() { | |
| console.log("dummy before"); | |
| }); | |
| it("is a dummy", function() { | |
| console.log("dummy test"); | |
| }); | |
| }); |
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 fish | |
| if not command -s system_profiler >/dev/null | |
| echo "system_profiler not found" ^&2 | |
| exit 1 | |
| else if not command -s osascript >/dev/null | |
| echo "osascript not found" ^&2 | |
| exit 1 | |
| else if not command -s xmlstarlet >/dev/null | |
| echo "xmlstarlet not found" ^&2 | |
| exit 1 |
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
| # Prerequisites: brew install xmlstarlet | |
| system_profiler -xml SPDisplaysDataType \ | |
| | xmlstarlet sel -t -v "//array/dict/key[. = '_spdisplays_pixels']/following-sibling::string[1]" 2>/dev/null |
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
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| Vagrant.configure(2) do |config| | |
| config.vm.define 'first' do |first| | |
| first.vm.box = "trusty-server-cloudimg-i386" | |
| first.vm.hostname = "first" | |
| first.vm.provision "shell", inline: <<-SHELL | |
| echo "this runs only in 'first', now in `hostname`" | |
| SHELL |
NewerOlder