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 jira import JIRA | |
| jiraUrl = "" | |
| username = "" | |
| project = "" | |
| # I'm not sure if this is universal, but it's the ID for closed issues on our instance | |
| closed_issue_id = "701" | |
| # This needs to be an API key | |
| password = "" |
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
| require 'spec_helper' | |
| describe 'foo' do | |
| on_supported_os.each do |os, os_facts| | |
| context "on #{os}" do | |
| let(:facts) { os_facts } | |
| describe 'foo equals bar' do | |
| let(:pre_condition) do | |
| 'class {"::foo": |
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
| # /etc/sysconfig/ifcfg-lo | |
| DEVICE=lo | |
| # localhost | |
| IPADDR0=127.0.0.1 | |
| NETMASK0=255.0.0.0 | |
| NETWORK0=127.0.0.0 | |
| BROADCAST0=127.255.255.255 | |
| # virtual ip | |
| IPADDR1=<VIRTUAL IP ADDRESS> | |
| NETMASK1=255.255.255.255 |
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
| $json = '[{ | |
| "certname": "foo.domain.com", | |
| "environment": "production", | |
| "name": "keystores", | |
| "value": { | |
| "/usr/local/cert/foo.jks:foo": { | |
| "days_remaining": 396, | |
| "issuer": "C=COM O=Foo Co. CN=Foo Type 3 CA v1", | |
| "owner": "C=COM L=Rome O=Vatican CN=pope.domain.com" | |
| } |
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
| # Custom validator for one element | |
| class ValidateElementAttribute : System.Management.Automation.ValidateArgumentsAttribute | |
| { | |
| [void] Validate([object]$arguments, [System.Management.Automation.EngineIntrinsics]$engineIntrinsics) | |
| { | |
| # Validation happens here | |
| if ($arguments -ne "foo") { | |
| throw "you should have chosen foo" |
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
| $json = '{ | |
| "keystores": { | |
| "/usr/local/cert/foo/cert1.jks:signing1": { | |
| "days_remaining": 629, | |
| "issuer": "C=SE O=Inera AB CN=SITHS Type 3 CA v1 PP", | |
| "owner": "C=SE L=Vanersborg O=Vastra Gotalands Lans Landsting CN=footest.vgregion.se serialNumber=12345" | |
| }, | |
| "/usr/local/cert/foo/cert1.jks:signing2": { | |
| "days_remaining": 629, | |
| "issuer": "C=SE O=Inera AB CN=SITHS Type 3 CA v1 PP", |
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
| # Custom validator for one element | |
| class ValidateElementAttribute : System.Management.Automation.ValidateArgumentsAttribute | |
| { | |
| [void] Validate([object]$arguments, [System.Management.Automation.EngineIntrinsics]$engineIntrinsics) | |
| { | |
| # Validation happens here | |
| if ($arguments -ne "foo") { | |
| throw "you should have chosen foo" |
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
| function test { | |
| [cmdletbinding()] | |
| param( | |
| [parameter(mandatory)] | |
| [validatescript({test-computer $_})] | |
| [string] $computername | |
| ) | |
| write-host $computername |
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
| # Get MySQL CLI | |
| docker exec -it <CONTAINER> sh -c 'mysql -u${MYSQL_USER} --password=${MYSQL_PASSWORD}' | |
| # Run SQL script | |
| cp my.sql /path/to/mysql/volume | |
| docker exec <CONTAINER> sh -c 'mysql -u${MYSQL_USER} --password=${MYSQL_PASSWORD} $MYSQL_DATABASE < /var/lib/mysql/my.sql' | |
| # Backup MySQL database | |
| docker exec <CONTAINER> sh -c 'exec mysqldump -u${MYSQL_USER} --password=${MYSQL_PASSWORD} $MYSQL_DATABASE' > my.backup.sql |