Skip to content

Instantly share code, notes, and snippets.

View cagingulsen's full-sized avatar
🌩️
Focusing

Kemal Cagin Gulsen cagingulsen

🌩️
Focusing
View GitHub Profile
import random
import string
# To randomize encoded data to seem like different
NUMBER_OF_OUTPUT_FILES = 100
LOOP_REAL_DATA = 94
def work(read_filename, file_index):
try:
line_arr = []
import socket
import base64
import struct
import time
import binascii
""" Break a large file into small 96 byte chunks
Sequence the chunks, pack and b64 encode them
Then send DNS queries """
# If you don't like non-valid characters in the hostname,
import pandas as pd
import numpy as np
from faker import Faker
# create some fake data
fake = Faker()
# function to create a dataframe with fake values for our workers
def make_workers(num):
@cagingulsen
cagingulsen / bootstrap-template-code-section.yaml
Created May 9, 2022 21:03
A code section of AWS CDK bootstrap template
Description: This stack includes resources needed to deploy AWS CDK apps into this
environment
Parameters:
.
.
.
.
.
PublicAccessBlockConfiguration:
Description: Whether or not to enable S3 Staging Bucket Public Access Block Configuration
@cagingulsen
cagingulsen / bootstrap-template.yaml
Created May 9, 2022 20:53
AWS CDK Bootstrap Template for Custom Bootstrapping - Version 12 - with a Permissions Boundary
Description: This stack includes resources needed to deploy AWS CDK apps into this
environment
Parameters:
TrustedAccounts:
Description: List of AWS accounts that are trusted to publish assets and deploy
stacks to this environment
Default: ''
Type: CommaDelimitedList
TrustedAccountsForLookup:
Description: List of AWS accounts that are trusted to look up values in this
import socket
import base64
import struct
import time
""" Break a large file into small 96 byte chunks
Sequence the chunks, pack and b64 encode them
Then send DNS queries """
# If you don't like non-valid characters in the hostname,
# then use hex encoding rather than base64
@cagingulsen
cagingulsen / lambda-stack.test.ts
Created March 1, 2022 21:21
for Production-Ready CDK - CDK Pipelines
import * as cdk from 'aws-cdk-lib';
import { Template } from 'aws-cdk-lib/assertions';
import { LambdaStack } from '../src/lambda-stack';
test('Lambda created', () => {
const app = new cdk.App();
const stack = new LambdaStack(app, 'LambdaStack');
const template = Template.fromStack(stack);
template.resourceCountIs('AWS::Lambda::Function', 1);
@cagingulsen
cagingulsen / main.ts
Created March 1, 2022 21:15
for Production-Ready CDK - CDK Pipelines
import { App } from 'aws-cdk-lib';
import { CdkPipelineStack } from './cdk-pipeline-stack';
// for development, use account/region from cdk cli
const devEnv = {
account: process.env.CDK_DEFAULT_ACCOUNT,
region: process.env.CDK_DEFAULT_REGION,
};
const app = new App();
@cagingulsen
cagingulsen / cdk-pipeline-stack.ts
Last active March 2, 2022 17:06
for Production-Ready CDK - CDK Pipelines
import { Stack, StackProps, Stage } from 'aws-cdk-lib';
import { CodePipeline, CodePipelineSource, ShellStep } from 'aws-cdk-lib/pipelines';
import { Construct } from 'constructs';
import { LambdaStack } from './lambda-stack';
// 3a. We define a Lambda Stage that deploys the Lambda Stack.
export class LambdaStage extends Stage {
constructor(scope: Construct, id: string) {
super(scope, id);
new LambdaStack(this, 'LambdaStack');
@cagingulsen
cagingulsen / lambda-stack.ts
Last active March 1, 2022 21:16
for Production-Ready CDK - CDK Pipelines
import { Stack, StackProps } from 'aws-cdk-lib';
import * as lambda from 'aws-cdk-lib/aws-lambda';
import { Construct } from 'constructs';
// example cdk app stack
export class LambdaStack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);