[:en]Youtube dl Python Set Headers[:ko]Youtube dl 파이썬 헤더 설정[:]

[:en]Youtube dl Python Set Headers[:ko]Youtube dl 파이썬 헤더 설정[:]

[:en] Youtube-dl can download videos in most situations; however, you may want to set headers. In order to do that, you need to import youtube_dl.utils. Here is the example! [:ko] Youtube-dl 라이브러리로 대부분의 상황에는 비디오 파일을 다운로드할 수 있지만, 헤더 설정을 필요로 하시는 분들도 종종 있을 겁니다. 그럴 때는 youtube_dl.utils 를 임포트 해서 사용하시면 됩니다! 예제 코드! [:]

[:en]Sending simultaneous requests using Python[:ko]Python에서 여러 Request 동시에 보내기[:]

[:en]Sending simultaneous requests using Python[:ko]Python에서 여러 Request 동시에 보내기[:]

[:en] Python is a perfect programming language unless you have to deal with asynchronous action. Many programmers using Javascript complain about ‘callback hell’. Still, people become grateful when they have to deal with asynchronous action (simultaneous, parallel, concurrent, etc.). Recently I needed to send several requests at the same time, instead of waiting for the previous request to finish. Moreover, all responses should be collected as one variable. 1. Ordinary request If we call 10 requests sequentially, it took 11.285…

Read More Read More

[:en]Django 301 redirect problem with React[:ko]React에서 Django 301 리다이렉트 문제[:]

[:en]Django 301 redirect problem with React[:ko]React에서 Django 301 리다이렉트 문제[:]

[:en] The answer is: ‘/’ Sometimes when you change your client-side code, and suddenly you experience a 301 redirect response from your server-side. In my case, I was using Django as a serverside and use ReactJS as a client-side. The API was implemented in a RESTful style. Most of the cases, the reason was I forgot to end with ‘/’ in my request URL. (Good) https://api.example.com/api/100/ (Bad) https://api.example.com/api/100 I haven’t really investigated what is behind this rule but, don’t panic…

Read More Read More

[:en]How to install Flask in Ubuntu 18.04[:ko]Ubuntu 18.04에 Python Flask 설치하기[:]

[:en]How to install Flask in Ubuntu 18.04[:ko]Ubuntu 18.04에 Python Flask 설치하기[:]

[:en] Ubuntu version : 18.04Python version: 3.6.7 Let’s get started from Ubuntu. If you are in ubuntu server and type below command you will see the version of your current python installation. In my case, it was Python 3.6.9. Now we need to install ‘virtualenv’ module.(There are several approaches that we can set a virtual environment for python, but it seems like this one is recommended these days.) Then, we make our project directory. In side the project directory, we…

Read More Read More

[:en]AWS EMR Tutorial – Part 1[:ko]AWS EMR 튜토리얼 – Part 1[:]

[:en]AWS EMR Tutorial – Part 1[:ko]AWS EMR 튜토리얼 – Part 1[:]

[:en] Hello! We have set up the Hadoop environment from the previous post. And YES! It IS a hassle unless you need your own tuned version of the environment. Therefore, I’ll introduce a more convenient way to use Hadoop environment from this post. We’ll test MRjob or PySpark using AWS EMR. In part 1 we’ll launch the EMR and use it very naively (static instances and using HDFS). From part 2 we’ll use EMR more correctly (?) (using AWS CLI…

Read More Read More

[:en][Docker-Compose] Django + PostgreSQL[:]

[:en][Docker-Compose] Django + PostgreSQL[:]

[:en] When you need to launch multiple containers that work as a single application, it is difficult to manage with single Dockerfile. That’s why we need to use “docker compose” so that we can manage our containers from a higher level. The application that we will test is a simple Django application. The database is PostgreSQL, and it will also be installed using Docker. Normally, it is not recommended to install the database using Docker. The database should be running…

Read More Read More

[:en]CSMA CD/CA[:ko]CSMA CD/CA[:]

[:en]CSMA CD/CA[:ko]CSMA CD/CA[:]

[:ko] CSMA (Carrier Sense Multiple Access)는 Contention-Based Schemes 중에 가장 기본이 되는 Aloha나 Slotted Aloha의 보완 형이라고 보면 되는데, 이 Aloha들의 문제점은 미디어의 상태를 고려하지 않고 그냥 계속 시도를 하다 보니까 아무래도 충돌을 피할 수 없는다. 그래서 이를 보완한 것이 CSMA방식이다. 이름에서 알 수 있듯이, Media를 계속 감지를 하면서 만약 Media가 비어 있다면 즉시 전송을 시작하고 만약 Media가 사용 중이라면, 3가지 경우로 나뉜다. CSMA의 3가지 Persistent Mechanism 1-Persistent CSMA 계속 감지하다가, 미디어가 비어 있을 때 바로 전송을 한다. 만약에 미디어가…

Read More Read More

[:en]Hadoop 101: Multi-node installation using AWS EC2[:ko]Hadoop 101: 멀티노드 설치 AWS EC2[:]

[:en]Hadoop 101: Multi-node installation using AWS EC2[:ko]Hadoop 101: 멀티노드 설치 AWS EC2[:]

[:en] In this post, we will build the multi-node Hadoop cluster using three EC2 instances ( one for master, two for slaves). (I will assume that you know how to use AWS. If you don’t, please check this link) To run Map-Reduce task properly, you need enough memory. Therefore, we will use t2.medium type instance. (If you are a student and need some free credit, check this link.) AWS EC2 t2.medium×3 (1 for a name node, 2 for data nodes)…

Read More Read More

[:en][Docker] React.js + Nginx[:]

[:en][Docker] React.js + Nginx[:]

[:en] When you deploy your React.js application through Docker, you can deploy with Nginx. The basic principle is, first build a React.js application and move the generated files to “share/nginx/html” in the container. You are just replacing the default Nginx welcoming page to your React.js application. Now you just need to run Nginx. Please check the Docker file below. Check the sample project [:ko] React.js 앱을 Docker를 이용해 배포 할 때는 Nginx를 이용하면 깔끔하게 처리할 수 있다.기본적인 원리는, 우선 React로 작성된 앱을 빌드를 하고…

Read More Read More

[:en]Get id, name, and class values using Javascript / jQuery[:ko]Javascript / jQuery 를 이용한 id, name, class 값 가져오기[:]

[:en]Get id, name, and class values using Javascript / jQuery[:ko]Javascript / jQuery 를 이용한 id, name, class 값 가져오기[:]

[:en] Last time, I tried to get each input value using id, name, and class. This time we will use the id to get name/class, name to get id/class and class to get id and name. (I do not remember exactly, sometimes you need them.) Declare the div first. One for using jQuery, the other for using the vanilla javascript. Using jQuery. Using vanilla javascript  (getElementById element is singular, class and name are plural) That’s it. * If you use…

Read More Read More