Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

CHANDRA SHEKHAR GOKA chandra-goka

🏠
Working from home
View GitHub Profile
View AWS_SQS
package com.otp;
import java.util.*;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.sqs.SqsClient;
import software.amazon.awssdk.services.sqs.model.*;
public class SQS_Example {
public static void main(String[] args) {
View ClusterComputeResource
{
"domain-c91": {
"_mor": {
"type": "ClusterComputeResource",
"value": "domain-c91"
},
"availableField": [
{
"key": 1,
"name": "com.rackspace.rpcv.goss",
View host_system
This file has been truncated, but you can view the full file.
{
"host-88": {
"_mor": {
"type": "HostSystem",
"value": "host-88"
},
"availableField": [
{
"key": 1,
View VMs
This file has been truncated, but you can view the full file.
{
"vm-213": {
"_mor": {
"type": "VirtualMachine",
"value": "vm-213"
},
"availableField": [
{
"key": 1,
View data-store
{
"datastore-264": {
"_mor": {
"type": "Datastore",
"value": "datastore-264"
},
"availableField": [
{
"key": 1,
"name": "com.rackspace.rpcv.goss",
View data-centers
{
"datacenter-42": {
"_mor": {
"type": "Datacenter",
"value": "datacenter-42"
},
"availableField": [
{
"key": 1,
"name": "com.rackspace.rpcv.goss",
View vs500.vdo.ord1.rvi.rax.io
{
"group-d1": {
"_mor": {
"type": "Folder",
"value": "group-d1"
},
"availableField": [
{
"key": 1,
"name": "com.rackspace.rpcv.goss",
View admin_script
"script": "Set-ExecutionPolicy Bypass -Scope CurrentUser -Force\n[System.Net.ServicePointManager]::
SecurityProtocol = @(\n [System.Net.SecurityProtocolType]::Tls;,\n
[System.Net.SecurityProtocolType]::Tls12;\n)\n
$ScriptResponse = Invoke-WebRequest \"https://vmc-ssm-agent-install.s3-us-west-2.amazonaws.com/ssm-agent-install.ps1\"
-UseBasicParsing\n$Script = [System.Text.Encoding]::UTF8.GetString($ScriptResponse.Content)\n$ScriptBlock = [Scriptblock]::Create($Script)\n
Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList
($args + @(\"wqdWaDWEe6/KVn6vNxNl\", \"49a31a45-d9b6-4d89-a727-1f9d537646c0\", \"eu-west-2\"))"
execution:: 767cf564-41f5-41e0-846e-7f3058c7ac21
View ssm
function Has-Instance
{
$ssm_path = $Env:Programfiles + "\Amazon\SSM\sam-cli.exe"
if(Test-Path -Path $ssm_path -PathType Leaf)
{
cd $Env:ProgramFiles\Amazon\SSM
$output = .\ssm-cli.exe get-instance-information | ConvertFrom-Json
if([bool] $output.psobject.properties.name -match "instance-id")
{
$managed_instance_id = $output.psobject.properties["instance-id"].value
View sample.ps1
<#
.SYNOPSIS
Registers this host with ssm agent
.DESCRIPTION
Downloads the agent, installs it, must be run as Administrator
#>
$JWT_TOKEN="eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzZXJ2aWNlX2lkIjoiNGM5NjA1MmEtODVjMC00MDZlLWJjZmMtOGI0MWI3OWFiNWY3IiwiZG9tYWluIjoiMTIzNDExNyIsInNlcnZpY2VfdHlwZSI6Ik1BTkFHRURfVk1DIiwidG9rZW5faWQiOiI5OGViOWE0OC1hMjNjLTRiMjMtYWM4Mi1jOWRiNGMxMDFhZTQifQ.kX3aR8X_mO6uSjOMKygTDfNl9Xen0RvCOLHy5-zfpTWwPz7j1XjVPpE24SJztdW7RFdomLCbZ7CA9MFFrcNFv8gyFhlUpe926DIV9TGt1HcC-_KSLtm82PhK5hL8pSDhwj1esPi3xv-JROzgYgfdy_b2aTFdJk4wIxjog7xEIr09ijftfyWZSZglCN7JbmqDMglXJuS1j5fC4Ix9Ji2MUFl2Prb1KNtPLzLSsBYwPYaNi5kxKmFT5VhNJ_6V1p9-QG_vut7A-xFbi_psWJW2xPxzpe2U8sZziEFkZiLHwA1_Whd541f396xz-drJNVFyRa43iqGqGAvvO8B9L0VQDQ"
$error_codes = @{"UNABLE_TO_ACTIVATE"=1; "JOB_RETRIEVE_FAILURE"=2; "NO_JOB_FOUND"=3; "OS_UNSUPPORTED"=4;}