I hereby claim:
- I am parttimelegend on github.
- I am parttimelegend (https://keybase.io/parttimelegend) on keybase.
- I have a public key ASBOysuH2LzHfN-GrFx_dY-yv1gTz-wL1jcnQ4ROD8AIdwo
To claim this, I am signing this object:
| Get-EC2Instance | Where-Object {$_.RunningInstance.StateReason.Code} | Start-EC2Instance |
| Get-EC2Instance | Where-Object {!$_.RunningInstance.StateReason.Code} | Remove-EC2Instance |
| param( | |
| [Parameter(Mandatory=$True)] | |
| [string]$localDirectory, | |
| [Parameter(Mandatory=$True)] | |
| [string]$s3Bucket, | |
| [Parameter(Mandatory=$True)] | |
| [string]$logFile | |
| ) | |
| Write-Output "Syncing to S3 Bucket" $(Get-Date -Format o) > $logFile | |
| aws s3 sync $localDirectory s3://$s3bucket > $logFile |
I hereby claim:
To claim this, I am signing this object:
| files = {} | |
| files.each do |filename| | |
| originalFilesize = File.size(filename) | |
| puts "Original Filesize #{originalFilesize}" | |
| newFilesize = Random.rand(1,9999999999) | |
| Random.rand(0xff).each do |byte| | |
| File.open(filename, 'wb') do |fo| | |
| newFilesize.times { fo.print(byte.chr) } | |
| end | |
| end |
| import boto3 | |
| ec2 = boto3.client('ec2') | |
| volume_id= "i-1234567890" | |
| list_of_snapshots = [] | |
| snapshots = ec2.describe_snapshots(Filters=[{'Name':'tag:volume_id', 'Values': [volume_id]}])['Snapshots'] | |
| for snapshot in snapshots: | |
| if snapshot: | |
| list_of_snapshots.append(snapshot['SnapshotId']) | |
| print(list_of_snapshots) |
| echo "127.0.0.1 xn-9q8h" >> etc/hosts |
| #Copyright 2020 Antony Bailey <hi@antonybailey.net> | |
| # | |
| #Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
| # | |
| #The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
| # | |
| #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH T |
| #Copyright 2020 Antony Bailey <hi@antonybailey.net> | |
| # | |
| #Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
| # | |
| #The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
| # | |
| #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH T |
| $s = "google.com" | |
| $port = 443 | |
| if(!(Test-Connection -TargetName $s -TCPPort $port -quiet)) | |
| { | |
| Write-Host “Problem connecting to $s” | |
| Write-Host “Flushing DNS” | |
| Invoke-Expression "ipconfig /flushdns" |