Writing & notes

Field notes on infrastructure, Linux, Python and — increasingly — AI engineering. 55 posts.

2019

Kubernetes Cookbook

Osiris - A general purpose, Scale to Zero component for Kubernetes…

#cookbook #kubernetes

Wechat Mini Program Development

https://github.com/jxtech/wechatpy https://github.com/gusibi/python-weixin https://github.com/wechat-miniprogram/miniprogram-demo…

#mini program #wechat

Django Cookbook

FROM python:3.8.1-alpine3.11 WORKDIR /app # https://docs.python.org/3/using/cmdline.html#envvar-PYTHONDONTWRITEBYTECODE ENV PYTHONDONTWRITEBYTECODE 1 #…

#cookbook #django

Security Review

Basic Facts Linux port range: 1 to 65535 Ephemeral port SSH Change default port 22 to other ports.

#security

NFS Setup

Allow only clients from IP matching nfs_network to access to NFS server. Allow nfs client connects to nfs server within the same machine using default IP of…

#nfs

The Addressing of Cats - Cats

(猫奴之歌) (Translated by Song) You’ve heard of several kinds of cat 你肯定已经听说过好几种猫 And my opinion now is that 我如今的观点如下 You should need no interpreter to…

#Andrew Lloyd Webber #The Addressing of Cats #music #翻译作品

Agent

https://github.com/sunsong/agent

#agent #devops

Chinese Amount in Words

Table of Chinese Amount in Figures and Amount in Words 1 2 3 4 5 6 7 8 9 0 十 百 千 万 亿 元 壹 贰 叁 肆 伍 陆 柒 捌 玖 零 拾 佰 仟 万 亿 圆

#amount in figures #amount in words

TICK Monitoring

Documentation https://www.digitalocean.com/community/tutorials/how-to-monitor-system-metrics-with-the-tick-stack-on-centos-7…

#Grafana #InfluxDB #Telegraf #monitoring

Superset Introduction

Test Run Run using docker-compose git clone https://github.com/apache/incubator-superset/ cd incubator-superset/contrib/docker docker-compose run -e…

#superset

New Project Standard

https://developer.github.com/webhooks/securing/ https://stackoverflow.com/questions/6317980/you-have-already-activated-x-but-your-gemfile-requires-y…

#project #standard

Ansible Skills

To Fix this issue, just upgrade setuptools: pip install --upgrade setuptools

#Ansible

Regular Expression

https://github.com/ziishaned/learn-regex

#Regular Expression

Tools

fullstack-tutorial gridstudio

#Tool

Amazon Seller Central Note

Settings -> User Permissions -> Amazon MWS Developer Access Keys

#amazon

Mac Tricks

Screenshots Hold (Shift (⇧) + Command (⌘)), Click 3 Hold (Control (⌃) + Shift (⇧) + Command (⌘)), Click 3 Hold (Shift (⇧) + Command (⌘)), Click 4 Hold…

#mac #tricks

Resources for New People to Industry

Resources for New People to Industry https://www.digitalocean.com/docs/droplets/how-to/add-ssh-keys/create-with-openssh/

#freshman

Imagine - John Lennon

约翰·列侬 (Translated by Song) Imagine there’s no heaven 设想一下这个世界没有天堂 It’s easy if you try 尝试下就知道这很容易 No hell below us 脚下没有地狱 Above us only sky 抬头只见天空 Imagine…

#Imagine #John Lennon #music #翻译作品

DevOps Checklist

Database Do daily backup. Make sure backup be compressed. Name the backup properly, with pattern like {project}_{environment}_{db_identifier}_$(date…

#checklist #devops #ssl

Couchbase Maintenance

Run couchbase docker run -d --name couchbase \ -p 8091-8094:8091-8094 \ -p 11210:11210 \ -v $(pwd)/data:/opt/couchbase/var:rw \ couchbase:community-5.1.1…

#couchbase

Python Tooling Environment

Standard Python Environment for DevOps FROM ubuntu:19.04 ADD sources.list /etc/apt/sources.list RUN apt-get update RUN apt-get install -y build-essential \…

#python #tooling

Setup Samba Server

Setup Samba Server Setup Samba Server in container sudo docker run -d --name samba \ -e USERID=0 \ -e GROUPID=0 \ -p 137:137/udp \ -p 138:138/udp \ -p…

#linux #samba

Packer Guide: Create a Windows VM Box

The latest Windows 10 image is Win10_1903_V1_Chinese\(Simplified\)_x64.iso, and rename it to Win10_1903.iso. Then put this image to iso folder.…

#packer

Python Skills

In Python 2 In Python 3 https://stackoverflow.com/questions/7943751/what-is-the-python-3-equivalent-of-python-m-simplehttpserver

#python

Wordpress Maintenance Guide

Test curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar mv wp-cli.phar /usr/local/bin/wp chmod +x /usr/local/bin/wp…

#wordpress

Keycloak Kong Guide

Run Keycloak, Kong, Konga, Postgres in Docker container Create a dedicated bridge in Docker docker network create kong Start Kong docker run -d --name…

#keycloak #kong

Postgres Handbook

https://github.com/zalando/patroni https://axiomq.com/blog/backup-and-restore-a-postgresql-database/…

#postgres #postgresql

Setup XAMPP in Ubuntu

We are going to setup XMAPP in Ubuntu, before executing the detailed steps, a runing Ubuntu 18.04 server with Internet access is required. Download XAMPP…

#XAMPP

Linux Shell Skills

https://www.cyberciti.biz/faq/how-to-find-my-public-ip-address-from-command-line-on-a-linux/ Is there a way for one SSH config file to include another one?…

#Linux #bash #shell #zsh

Cloud Computing Guide

Amazon Web Services (AWS) Google Cloud Reference Amazon Web Services — a practical guide Amazon Web Services - Documentation Aliyun Homepage Console RAM用户登陆…

#cloud #computing #guide

Online Marketing Guide

Introduction Reference Online Marketing Tools Google Analytics Google Search Console Instagram Facebook Our Online Marketing Platform Github: sunsong…

#marketing

Mail-in-a-Box Installation and Maintenance

If you only want a simple SMTP server, run command: Or check this page https://blog.edmdesigner.com/send-email-from-linux-command-line/

#mail #mail-in-a-box

Google Authenticator and One-Time Password(OTP) Implementation

There are no account backups in any of the apps by design. You can not export account information from Google Authenticator APP after you scaned QR code.…

#2FA #Authenticator #Google #MFA

Use 1Password Family Subscription as Password Manager

1Password best practices. Before you start, you need to sign up 1Password Families

#1Password

Vue.js Notes

This page contains my notes when I am learning Vue.js.

#vue.js

Login Integration

Login Integration with Google Pre-requisite Register a Google account with a company organization. Create Credentials Login to Google Developer Console…

#Google #integration #login

Install and Manage KVM

After the box started, the OS image will be loaded and the linux installation can be done using VNC. This command will not exit until the installation have…

#kvm #linux

Android CI CD Using Docker

We are going to use docker to create an environment with Android SDK. The following are the goals to achieve. The current version of Java inside the…

#android #docker

Change DNS Server from Terminal on MacOS

Use the following command to see which network interface you are using

#dns #macos #terminal

Java Environment Setup

Check reference links below. Run command in shell An example of the output Switching to 1.8.0_212 Or Switching to 12.0.1 Check the version

#java

Node Environment Setup

Add the following snippet to ~/.zshrc The node will be installed to NVM_DIR, so you need to create that folder if it does not exists.

#javascript #node

How to handle dates, time and timezone programmatically

The conversion among different date and time format is intricate. In this page I am going to summarize and implement it in different languages.

#datetime #python #timezone

Docker Related Resources

Download Docker.dmg from this link, then install it. Or, you can also use brew to install. Update in /etc/docker/daemon.json…

#docker

Learning Material

Javascript You Don’t Know JS Kubernetes Kubernetes The Hard Way Tutorial Markdown Mastering Markdown Basic Syntax Bash pure bash bible Deep Learning Dive…

#reference

Install and Manage Xen on Ubuntu 20.04

Assuming you just did a clean installation of Ubuntu 20.04 in your server, we are going to install xen hypervisor. To be noted, you need to use lvm to…

#linux #xen

Increase Max Number of Couchbase Buckets

The default max number of couchbase buckets supported is 10, couchbase will raises error saying creating more buckets decrease performance, yet you still…

#couchbase

Get Let’s Encrypt Certificate With Certbot

Create an SSL certificate can be costly and painful to maintain. Since Let’s Encrypt start providing free SSL for each domain, the only thing needs to spend…

#HTTPS #Let's Encrypt #SSL

Introduction to Couchbase Python SDK

Docker Couchbase Environment

#couchbase