Skip to content

Instantly share code, notes, and snippets.

@koh1
koh1 / aws-cognito.md
Created December 17, 2020 17:04
AWS Cognito Sample

AWS Cognito

Get session

$ aws cognito-idp admin-initiate-auth  --user-pool-id ap-northeast-1_xxxx   --client-id xxxxxxxxxxxxxx   --auth-flow ADMIN_NO_SRP_AUTH
  --auth-parameters "USERNAME=user,PASSWORD=password"
{
    "ChallengeName": "NEW_PASSWORD_REQUIRED",
    "Session": "XXXXX",
@koh1
koh1 / GStreamer-1.0 some strings.sh
Last active February 26, 2020 09:05 — forked from strezh/GStreamer-1.0 some strings.sh
GStreamer-1.0 personal cheat sheet
#!/bin/bash
# play YUV444 FULL HD file
gst-launch-1.0 -v filesrc location=size_1920x1080.yuv ! \
videoparse width=1920 height=1080 framerate=25/1 format=GST_VIDEO_FORMAT_Y444 ! \
videoconvert ! \
autovideosink
# play YUV422 FULL HD file
gst-launch-1.0 -v filesrc location=size_1920x1080.yuv ! \
@koh1
koh1 / fcd-output-file.xml
Created July 12, 2019 07:59
sumo --fcd-output fcd-output-file.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- generated on 06/15/19 03:28:32 by Eclipse SUMO Version 1.2.0
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/sumoConfiguration.xsd">
<input>
<net-file value=".\grid_1000m.net.xml"/>
<route-files value=".\grid_1000m.trip.xml"/>
</input>
@koh1
koh1 / test_script.py
Last active July 12, 2019 08:12
http request generator test script
import requests
import json
import time
import datetime
import numpy as np
import xml.etree.ElementTree as ET
from vehicle_access_generator import make_access
import aiohttp
import asyncio
@koh1
koh1 / vehicle_access_generator.py
Last active July 12, 2019 08:13
generate data access scenario from SUMO output file
import numpy as np
import json
import xml.etree.ElementTree as ET
def make_access_matrix(access_counts):
matrix = np.zeros((len(access_counts), 4))
vid_idx = []
idx = 0
for k,v in access_counts.items():
#include <click/config.h>
#include <click/args.hh>
#include "DummyAnswer.hh"
#include "DummyProto.hh"
CLICK_DECLS
DummyAnswer::DummyAnswer() { };
DummyAnswer::~DummyAnswer() { };
$ uname -a
Linux koh1-XPS-15-9570 4.15.0-34-generic #37-Ubuntu SMP Mon Aug 27 15:21:48 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.1 LTS"
$ sudo docker version
Client:
Version: 18.06.1-ce
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#