Skip to content

Instantly share code, notes, and snippets.

View victor-teal's full-sized avatar

Victor Kanopelko victor-teal

View GitHub Profile
@victor-teal
victor-teal / curl.md
Created January 29, 2021 19:35 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@victor-teal
victor-teal / variables.tf
Created January 18, 2021 08:24 — forked from kainlite/variables.tf
snippet
variable "profile_name" {
default = "default"
}
variable "region" {
default = "us-east-1"
}
variable "email_address_arn" {
default = "arn:aws:ses:us-east-1:894527626897:identity/[email protected]"
@victor-teal
victor-teal / key.md
Created January 12, 2021 07:04
Twitter (un)official Consumer Key

Twitter Official Consumer Key

Twitter for Android

type:            PIN
Consumer key:    3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPhone

type:            PIN

Consumer key: IQKbtAYlXLripLGPWd0HUA

@victor-teal
victor-teal / RealTimeCounterImpl.java
Created January 11, 2021 08:41 — forked from cegme/RealTimeCounterImpl.java
From the website: http://symbo1ics.com/blog/?p=2055 I implemented an interview questions: Given a timer time() with nanosecond accuracy and given the interface interface RealTimeCounter: void increment() int getCountInLastSecond() int getCountInLastMinute() int getCountInLastHour() int getCountInLastDay() implement the interface. The getCountInL…
import java.lang.System;
import java.util.Collections;
import java.util.Comparator;
import java.util.ArrayList;
public class RealTimeCounterImpl implements RealTimeCounter {
private static final int MAX_COUNTS = Integer.MAX_VALUE >> 8;
@victor-teal
victor-teal / apigateway.tf
Created January 6, 2021 17:30 — forked from mendhak/apigateway.tf
Terraform - API Gateway with greedy path (proxy+) calling httpbin. Also includes deployment
resource "aws_api_gateway_rest_api" "MyDemoAPI" {
name = "MyDemoAPI"
description = "This is my API for demonstration purposes"
}
resource "aws_api_gateway_resource" "MyDemoResource" {
rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}"
parent_id = "${aws_api_gateway_rest_api.MyDemoAPI.root_resource_id}"
path_part = "{proxy+}"
}
@victor-teal
victor-teal / README.md
Created November 13, 2020 13:35 — forked from crypticmind/README.md
Setup lambda + API Gateway using localstack

Port-forwarding JMX

Proof of concept:

  • Terminal 1:
    • SSH to remote host
    • Start a Java process with JMX registry port 50004, RMI callback port 50005, and RMI hostname pinned to localhost: java -Dcom.sun.management.jmxremote.port=50004 -Dcom.sun.management.jmxremote.rmi.port=50005 -Djava.rmi.server.hostname=localhost -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -cp /some/jar/file main.class
  • Terminal 2: