Troubleshooting instances with failed status checks and how to improve it.

image source: https://pixabay.com/illustrations/traffic-lights-problem-analysis-466950/

Recently, we try to improve our failure management, because one of our EC2 instance became unavailable out of the blue. Failure Management, as AWS Well-Architected Framework defines in the chapter of Reliability, means

In any system of reasonable complexity, it is expected that failures will occur. Reliability requires that your workload be aware of failures as they occur and take action to avoid impact on availability. Workloads must be able to both withstand failures and automatically repair issues.

We have an internal application running on an EC2 instance and…


CloudMile、adGeek、活動購、Lative、趨勢科技、Appier、蝦皮、一加手機

image source: https://www.picpedia.org/chalkboard/i/interview.html

目錄

  1. 求職背景
  2. 面試常見問題
  3. 面試公司
  4. 心得

求職背景

四大文組學士,在校有修一年的程式課程(Python、C++、資料結構、演算法 etc),2017 年畢業後北漂到北京當兩年後端工程師,2019 年回台灣工作,這次求職時有快三年的 python 後端兼快一年的 DevOps(弱弱的地端 + AWS) 經驗。有鑒於 2019 年求職時沒有刷題導致可以面的公司有限,2020 三月有空的時候就開始看大神整理的github https://github.com/labuladong/fucking-algorithm 照類別刷經典題,大概刷了 50 題左右,easy:medium:hard 約 4:4:2。六月中開始找工作, …


簡介 AWS 證照、SAA、以及準備心得

image source: Amazon

一、AWS 證照簡介


簡介如何用 ngrok 讓 Github Webhook 觸發本地 Jenkins Pipeline

image source: google

Jenkins 版本:2.190.1 (2019–09–25)

本篇會介紹如何 push commit 到 Github 後自動觸發本地 Jenkins Pipeline 執行 CI/CD。假定讀者已經安裝並初始化好 Jenkins ,如果沒有可以又希望用 Docker 起的話,可參考 用 Docker 安裝 CI 工具 Jenkins,如果希望用 EC2 起 Jenkins 可參考:Set Up a Jenkins Build Server。其他可參考:Jenkins download and deployment

目錄:

  1. 安裝並啟動 ngrok 讓本地 Jenkins map 到 ngrok 的 dom …

Hard Core Tech 映瀚、大數據、StreetVoice 街聲、KooData 酷訊搜索、雲端互動

image source: https://www.picpedia.org/chalkboard/i/interview.html

目錄

  1. 個人背景
  2. 求職準備
  3. 面試常見問題
  4. 面試公司
  5. 心得

一、個人背景

四大文組學士,大學最後一年才開始接觸程式,在修了一年學校資管系的 Python、C++、演算法、電機系的資料結構以及線上課程的 HTML、CSS、JavaScript 後,因為喜歡寫程式想轉行當工程師,加上想離開台灣看看,所以畢業後就買了張單程機票飛到北京當北漂。先是透過短期暑期行政實習了解當地環境,然後很幸運地被前老闆內推到 AI 新創公司彩雲科技做了 3 個月的全職後端實習工程師,加上後來轉正的經歷,總共在北京做了兩年 Python 後端開發工程師。2019 年回台灣後,因為自己沒有刷 leetcode、加上希望可以早點工作,所以找工作的目標 …


Python 3.7 + Django 2 + Nginx 1.10.3

Nginx

If you want to upload a large file of which size is more than 1 MB to Django application (Django + uWSGI + Nginx), you may get ‘413 Request Entity Too Large problem’.

This is because in Nginx, the default maximum accepted body size of client request is 1 MB. If you want to increase the limit, you can set client_max_body_size in nginx.conf. According to documentation:

Syntax:client_max_body_size size;
Default:client_max_body_size 1m;
Context:http, server, location

The default maximum accepted body size is indicated by the line Content-Length in the header of request. Content-Length means…


Django 2 + uWSGI + Nginx + AWS (ECR + ECS + EC2 + ALB + VPC + CloudFront)

image source: google

Recently, we had a memory leak problem after deploying a small Django application on AWS. Fortunately, we finally solved this problem by modifying uswgi.ini.

Before getting this problem, we dockerized the application with uWSGI and Nginx, built an image, and pushed to AWS ECR with CI/CD. After that, we deployed it with VPC, ALB, ECS, EC2, and CloudFront.

Problem

At first, it worked as excepted. However, after running for several hours, we got some 500 errors. After doing some research, we found…


簡介 Swagger、Django REST Framework 以及 drf-yasg

適用讀者:對 Django 有基本認識想要用 Django REST Framework 撰寫 RESTful API 並生成 Swagger 文檔。如果沒有聽過 Django,建議先閱讀官方文檔

本篇假定讀者已有基本的 Django REST Framework 專案,希望能增加 Swagger,如果還沒有可以參考上篇

用 Django REST framework swagger 套件 drf_yasg 生成 Swagger UI

drf-yasg 是一個可以在 Django REST framework 自動生成 Swagger 的套件。我們先用 pip 安裝:

pip install -U drf-yasg

再將 drf_yasg 加到的 demo/settings.py

INSTALLED_APPS = [

簡介如何自訂義 Django REST framework 生成 swagger 的套件 drf-yasg 的文檔。

本篇主要介紹如何自訂義 drf-yasg 的 swagger 文檔,如果對 drf-yasg 不熟悉可以參考此篇:用 Django REST Framework 撰寫 RESTful API 並生成 Swagger 文檔,本篇的 code 可以參考這個 Pull Request

以下的操作都是會用到 drf_yasg 的裝飾器 swagger_auto_schemaswagger_auto_schema 的功用依照 drf_yasg 的定義為:

Decorate a view method to customize the Operation object generated …


適用讀者:對 K8s 有基礎了解、想要在 Raspberry Pi 安裝 K8s。

image source: google

本篇安裝的 Raspbian image 版本為:

Image with desktop and recommended software based on Debian BusterVersion:February 2020
Release date:2020–02–13
Kernel version:4.19
Size:2530 MB

如果是全新的 Raspberry ,可以先下載 Raspbian image,然後依照這篇安裝 Raspbian

都好了後需要先 ssh 到 Raspberry Pi 將權限改為 root:

sudo su

添加加密密鑰:

curl -s https://packages.cloud. …

Jo-Yu Liao

Love studying, programming, and traveling. Graduated from NTU, and worked in Beijing for 2 years. Now live in Taipei. Github: https://github.com/ZoeLiao

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store