It happens that there are many standards for storing cryptography materials (key, certificate, ...) and it isn't always obvious to know which standard is used by just looking at file name extension or file content. There are bunch of questions on stackoverflow asking about how to convert from PEM to PKCS#8 or PKCS#12, while many tried to answer the questions, those answers may not help because the correct answer depends on the content inside the PEM file. That is, a PEM file can contain many different things, such as an X509 certificate, a PKCS#1 or PKCS#8 private key. The worst-case scenario is that someone just store a non-PEM content in "something.pem" file.
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
import org.apache.hadoop.util.ShutdownHookManager | |
import org.apache.spark.sql.streaming.StreamingQueryListener | |
import org.apache.spark.sql.streaming.StreamingQueryManager | |
import org.slf4j.LoggerFactory | |
import java.util.UUID | |
import java.util.concurrent.ConcurrentHashMap | |
import java.util.concurrent.SynchronousQueue | |
import java.util.concurrent.TimeUnit |
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
Download the CLI Version of NuGet | |
https://dist.nuget.org/win-x86-commandline/latest/nuget.exe | |
--Create Work Paths | |
md c:\nuget | |
md c:\nuget\source | |
md c:\nuget\publish | |
-- One-Time - Create local NuGet Repo/feed using a local drive path | |
cd c:\nuget |
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
#r "Newtonsoft.Json" | |
using System.Net; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.Extensions.Primitives; | |
using Newtonsoft.Json; | |
using System.Net.Http.Headers; | |
public static async Task<IActionResult> Run(HttpRequest req, ILogger log) | |
{ |
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
variable "region" {} | |
variable "access_key" {} | |
variable "secret_key" {} | |
provider "aws" { | |
version = "~> 1.25" | |
region = "${var.region}" | |
access_key = "${var.access_key}" | |
secret_key = "${var.secret_key}"} |
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
# Scheduling the above script hourly. Ensure you're properly authenticated via aws configure. | |
#!/bin/bash | |
zip ebs-backup-worker.zip .schedule-ebs-snapshot-backups.py | |
aws lambda create-function --function-name ebs-backup-worker \ | |
--runtime python2.7 \ | |
--role "arn for your lambda user's role" \ | |
--handler lambda_handler \ | |
--zip-file fileb:///ebs-backup-worker.zip |
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
1. Setup a project | |
2. Add groovy SDK support: | |
https://www.bonusbits.com/wiki/HowTo:Add_Groovy_SDK_to_IntelliJ_IDEA | |
3. Download http://(yourjenkinsurl)/job/(yourpipelinejob)/pipeline-syntax/gdsl | |
- this will give you the .gdsl file - download this to the src folder of your project. | |
4. Finally follow this step - right click on the src folder -> Mark directory as -> Sources Root |
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
/* | |
Program require access to S3 objects. | |
It will download gz file, gunzip it, read flat file and convert output into json. | |
You can use output as a data in HTTP and stream into elastic search(or ELK). | |
INFO: https://aws.amazon.com/blogs/aws/vpc-flow-logs-log-and-view-network-traffic-flows/ | |
*/ | |
package main | |
import ( | |
"bufio" |
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
import boto3 | |
import datetime | |
import json | |
from requests_aws4auth import AWS4Auth | |
import requests | |
boto3.setup_default_session(region_name='us-east-1') | |
identity = boto3.client('cognito-identity', region_name='us-east-1') | |
account_id='XXXXXXXXXXXXXXX' |
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
import base64 | |
import datetime | |
import json | |
import os | |
import time | |
import traceback | |
import urlparse | |
import botocore.auth | |
import botocore.awsrequest |
NewerOlder