Skip to content

Instantly share code, notes, and snippets.

View evilUrge's full-sized avatar
🎮

Gilad Maoz evilUrge

🎮
View GitHub Profile
@evilUrge
evilUrge / Paginator.ts
Last active June 8, 2022 14:28
Aws SDK Paginator
/**
* Paginates over a AWS service function.
* @param functionToExec The function to execute
* @param methodToExec The method to execute
* @param params The parameters to pass to the method
* @param keyToAppend The key to append to the result
* @returns A promise that resolves to an array of results
*/
export async function paginator(
functionToExec: any,
@evilUrge
evilUrge / generateCommonColumns.ts
Created January 27, 2022 14:31
Create a parquet columns and Glue table columns from a common object
import { Schema } as GlueSchema from '@aws-cdk/aws-glue';
/**
* Create a parquet columns and Glue table columns from a common object
* @param attributes { name: type }
* @returns {
* parquetSchema: { name: { type: 'type' }, ...},
* glueSchema: [
* { name: 'name', type: 'UTF8' },
* ...
@evilUrge
evilUrge / req.js
Created June 17, 2022 11:54
SSL Pinning
const { Agent } = require("https"),
request = require("request");
const FINGERPRINTSET = [
"C3:07:56:2C:08:A5:E1:2E:41:20:10:7A:02:87:86:C3:72:49:45:BF",
];
const req = request(
{
url: "https://www.duckduckgo.com/",
@evilUrge
evilUrge / stack-lib.ts
Last active December 1, 2022 14:08
Generic CDK
import { join } from "path";
import { fileURLToPath } from "url";
import type { Construct } from "constructs";
import { Duration, Stack, StackProps } from "aws-cdk-lib";
import { LogLevel, NodejsFunction } from "aws-cdk-lib/aws-lambda-nodejs";
import { Runtime } from "aws-cdk-lib/aws-lambda";
import { Rule, Schedule } from "aws-cdk-lib/aws-events";
import { LambdaFunction } from "aws-cdk-lib/aws-events-targets";
import { Effect, PolicyStatement } from "aws-cdk-lib/aws-iam";