Skip to content

Instantly share code, notes, and snippets.

@wesky93
wesky93 / I'm an early 🐤
Last active October 29, 2020 01:09
DailyCommit
🌞 Morning 290 commits ██████▉░░░░░░░░░░░░░░ 32.8%
🌆 Daytime 384 commits █████████░░░░░░░░░░░░ 43.4%
🌃 Evening 14 commits ▎░░░░░░░░░░░░░░░░░░░░ 1.6%
🌙 Night 196 commits ████▋░░░░░░░░░░░░░░░░ 22.2%
@wesky93
wesky93 / play.py
Last active August 19, 2018 04:59
import logging
from random import choice
from typing import Dict, List, Set
from .core.cards import Card
from .player import Other
logger = logging.getLogger(__name__)
merge_cards = lambda my, community: my + community
@wesky93
wesky93 / event_parser.py
Last active October 4, 2018 03:00
aws lambda event parser
import base64
import json
import zlib
import boto3
s3 = boto3.resource('s3')
def get_value_type(dic):
@wesky93
wesky93 / Cloud9.yml
Last active May 18, 2018 12:09
AWSKRUG 핸드온2018 서버리스 데이터레이크 Cloud9 구축 템플릿
AWSTemplateFormatVersion: "2010-09-09"
Description: 개발용 환경 구축
Resources:
DevServer:
Type: "AWS::Cloud9::EnvironmentEC2"
Properties:
OwnerArn: !Sub 'arn:aws:iam::${AWS::AccountId}:user/datalake_2018'
Description: "헨드온 실습진행에 사용할 cloud9"
AutomaticStopTimeMinutes: 20
InstanceType: t2.micro

How to setup AWS lambda function to talk to the internet and VPC

I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.

So it might be really unintuitive at first but lambda functions have three states.

  1. No VPC, where it can talk openly to the web, but can't talk to any of your AWS services.
  2. VPC, the default setting where the lambda function can talk to your AWS services but can't talk to the web.
  3. VPC with NAT, The best of both worlds, AWS services and web.
@wesky93
wesky93 / full-ffmpeg.sh
Created July 18, 2017 04:19
Install full ffmpeg in debian wheezy (with aac(m4a) and x264 support)
# Add multimedia source
echo "deb http://www.deb-multimedia.org wheezy main non-free" >> /etc/apt/sources.list
echo "deb-src http://www.deb-multimedia.org wheezy main non-free" >> /etc/apt/sources.list
apt-get update
apt-get install deb-multimedia-keyring # if this aborts, try again
apt-get update
# Go to local source directory
cd /usr/local/src
@wesky93
wesky93 / python361.md
Last active June 2, 2017 14:53 — forked from basaks/python36.md
Install Python3.6 interpreter on ubuntu 16.04

Install Python3.6 interpreter on ubuntu 16.04

From here, we can pretty much follow the exact same procedure.

On a terminal just do the following steps:

Install dependencies:

sudo apt install build-essential checkinstall libreadline-gplv2-dev \

@wesky93
wesky93 / sync_pdf2png.py
Created May 25, 2016 17:02
wand 포맷 오류
import os
import datetime
import glob
from wand.image import Image
def ctime_prefix(name):
"""
파일 생성 시간을 취득하여 prefix를 생성해주는 함수
:param path: 파일 절대경로
@wesky93
wesky93 / sync_pdf2png.py
Created May 25, 2016 16:59
wand 오류
import os
import datetime
import glob
from wand.image import Image
def ctime_prefix(name):
"""
파일 생성 시간을 취득하여 prefix를 생성해주는 함수
:param path: 파일 절대경로
$ sudo apt-get install python-virtualenv