Skip to content

Instantly share code, notes, and snippets.

@gotoweb
gotoweb / LambdaDeploymentRole.yaml
Created February 11, 2025 06:41
CloudFormation을 이용한 IAM 역할 생성
AWSTemplateFormatVersion: '2010-09-09'
Description: 'LambdaDeploymentRole'
Resources:
LambdaDeploymentRole:
Type: AWS::IAM::Role
Properties:
RoleName: MLOps-LambdaDeploymentRole
Path: "/"
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
@gotoweb
gotoweb / docker-compose.yaml
Last active October 5, 2023 02:24
simple kafka
version: '2'
services:
zookeeper:
image: confluentinc/cp-zookeeper:latest
environment:
ZOOKEEPER_SERVER_ID: 1
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ZOOKEEPER_INIT_LIMIT: 5
@gotoweb
gotoweb / gatsby.txt
Created November 8, 2022 04:45
The Great Gatsby
In my younger and more vulnerable years my father gave me some advice
that I’ve been turning over in my mind ever since.
“Whenever you feel like criticizing any one,”
he told me,
“just remember that all the people in this world haven’t had the advantages that you’ve had.”
He didn’t say any more,
but we’ve always been unusually communicative in a reserved way,
and I understood that he meant a great deal more than that.
In consequence,
I’m inclined to reserve all judgments,
@gotoweb
gotoweb / sns_to_discord.py
Created May 3, 2022 18:33
SNS 메시지를 Discord 웹훅을 통해 전달하는 람다 함수입니다.
import boto3
import json
import logging
import os
from base64 import b64decode
from urllib.request import Request, urlopen
from urllib.error import URLError, HTTPError
HOOK_URL = os.environ['HOOK_URL']
const items = [
{
id: 7,
title: "수도 이전 공약",
desc: "부산을 대한민국의 수도로 지정하겠습니다!"
},
{
id: 3,
title: "개발자 임금 공약",
desc: "부산 근무 개발자들의 연봉을 2배로 올리겠습니다!"
@gotoweb
gotoweb / access.log
Created December 13, 2021 09:58
nginx access log
This file has been truncated, but you can view the full file.
83.149.9.216 - - [17/May/2015:10:05:03 +0000] "GET /presentations/logstash-monitorama-2013/images/kibana-search.png HTTP/1.1" 200 203023 "http://semicomplete.com/presentations/logstash-monitorama-2013/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
83.149.9.216 - - [17/May/2015:10:05:43 +0000] "GET /presentations/logstash-monitorama-2013/images/kibana-dashboard3.png HTTP/1.1" 200 171717 "http://semicomplete.com/presentations/logstash-monitorama-2013/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
83.149.9.216 - - [17/May/2015:10:05:47 +0000] "GET /presentations/logstash-monitorama-2013/plugin/highlight/highlight.js HTTP/1.1" 200 26185 "http://semicomplete.com/presentations/logstash-monitorama-2013/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
83.149.9.216 - - [17/May/2015:10:05:12 +0
@gotoweb
gotoweb / goodjob.txt
Created February 19, 2021 06:11
wget 실습
wget을 이용해서 파일을 다운로드 받았군요! 잘 하셨습니다 :)
@gotoweb
gotoweb / ordering-coffee-async.js
Created June 26, 2019 08:46
ordering-coffee-async.js
function waitAsync(callback, ms) {
setTimeout(callback, ms); // 특정 시간 이후에 callback 함수가 실행되게끔 하는 브라우저 내장 기능입니다
}
function drink(person, coffee) {
console.log(person + '는 ' + coffee + '를 마십니다');
}
function orderCoffeeSync(coffee) {
console.log(coffee + '가 접수되었습니다');
@gotoweb
gotoweb / ordering-coffee-sync.js
Created June 26, 2019 08:45
ordering-coffee-sync.js
function waitSync(ms) {
var start = Date.now();
var now = start;
while(now - start < ms) {
now = Date.now();
}
} // 현재 시각과 시작 시각을 비교하며 ms 범위 내에서 무한 루프를 도는 blocking 함수입니다
function drink(person, coffee) {
console.log(person + '는 ' + coffee + '를 마십니다');
function wait(ms) {
var start = Date.now();
var now = start;
while (now - start < ms) {
now = Date.now();
}
}
function drink(person, coffee) {
console.log(person + '는 <' + coffee + '>를 마십니다');