Skip to content

Instantly share code, notes, and snippets.

View kilfu0701's full-sized avatar

kilfu0701 kilfu0701

  • Trend Micro
  • Japan & Taiwan
View GitHub Profile
@kilfu0701
kilfu0701 / quick_setup.sh
Last active February 21, 2019 02:52
CentOS quick setup
##
yum groupinstall "Development tools"
## set system timezone
timedatectl set-timezone Asia/Tokyo
## date sync
yum install -y ntp
chkconfig ntpd on
ntpdate pool.ntp.org
@kilfu0701
kilfu0701 / output_colorful.sh
Created September 23, 2016 02:23
Make stdout/stderr with color.
#!/bin/bash
~/go_appengine/dev_appserver.py --port=8081 --admin_port=8001 --datastore_path=/tmp/myapp_datastore . 2>&1 | \
awk '{ gsub("DEBUG", "\033[1;35m&\033[0m");
gsub("INFO", "\033[1;36m&\033[0m");
gsub("ERROR", "\033[1;31m&\033[0m");
gsub("WARNING", "\033[1;33m&\033[0m");
gsub("CRITICAL", "\033[1;31m&\033[0m");
print
}'
@vasanthk
vasanthk / System Design.md
Last active July 23, 2024 11:24
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@cridenour
cridenour / gist:74e7635275331d5afa6b
Last active August 7, 2023 13:52
Setting up Vim as your Go IDE

Setting up Vim as your Go IDE

The final IDE

Intro

I've been wanting to do a serious project in Go. One thing holding me back has been a my working environment. As a huge PyCharm user, I was hoping the Go IDE plugin for IntelliJ IDEA would fit my needs. However, it never felt quite right. After a previous experiment a few years ago using Vim, I knew how powerful it could be if I put in the time to make it so. Luckily there are plugins for almost anything you need to do with Go or what you would expect form and IDE. While this is no where near comprehensive, it will get you writing code, building and testing with the power you would expect from Vim.

Getting Started

I'm assuming you're coming with a clean slate. For me this was OSX so I used MacVim. There is nothing in my config files that assumes this is the case.

@kilfu0701
kilfu0701 / _install.sh
Last active April 13, 2017 02:19
install python 2.7.6 from source. ( CentOS )
## install deps if need
yum -y install openssl-devel readline-devel bzip2-devel sqlite-devel zlib-devel ncurses-devel db4-devel expat-devel
## if build from python src
cd ~
mkdir src
cd src
wget http://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz
tar zxvf Python-2.7.6.tgz
cd Python-2.7.6
@qrtt1
qrtt1 / GoogleApiUsage.md
Last active January 11, 2022 09:45
Note for learning google api for python (google api 的學習筆記)

由於 Google API 久久才會用一次,但它的文件對我來說實在是不好閱讀,應該花點時間把它筆記起來才是。

學習曲線分析

閱讀 Google API 使用文件,覺得難以閱讀的主要原因是它分成許多部分,每一部分不一定跟你要做的功能相關,而是在滿足你能使用 API 的基本條件。要攻略使用文件就必需清楚知道哪些是屬於「共通科目」、「必修科目」屬於任何產品的 API 使用前都必需滿足的。

內容分為下列主題:

  1. API 的設計哲學:Service Discovery (描述 API 的 API)
  2. API 開通與證認:API Console & OAuth 2
@IanVaughan
IanVaughan / uninstall_gems.sh
Created June 9, 2012 20:37
Uninstall all rbenv gems
#!/usr/bin/env bash
uninstall() {
list=`gem list --no-versions`
for gem in $list; do
gem uninstall $gem -aIx
done
gem list
gem install bundler
}