Skip to content

Instantly share code, notes, and snippets.

View appleboy's full-sized avatar
🔥
On Fire

Bo-Yi Wu appleboy

🔥
On Fire
View GitHub Profile
@appleboy
appleboy / car_test.go
Created May 13, 2018 07:17
golang testing
package car
import (
"testing"
"github.com/stretchr/testify/assert"
)
// Simple testing what different between Fatal and Error
func TestNew(t *testing.T) {
@appleboy
appleboy / minio.go
Last active January 25, 2018 06:26
minio sdk with AWS iam Role
package main
import (
"log"
"github.com/minio/minio-go"
"github.com/minio/minio-go/pkg/credentials"
)
func main() {
@appleboy
appleboy / docker.md
Created November 15, 2017 01:21
Docker 容器技術教學營

課程簡介

[Docker][2] 是一個開源專案,原始碼放在 [GitHub][1] 上面做維護,支援多平台,從筆電到公、私有雲上能進行快速部署輕量、獨立的作業環境。 Docker 使用 Linux 核心中的功能,Namespace 及 Control Groups (cgroups) 等,來達到建置獨立的環境及控制 CPU 、Memory 、網路等資源。 為什麼要使用 Docker 技術?Docker 帶給我們在工作環境上有什麼樣的優勢:

  1. 更快速的交付和部署
  2. 更有效率的虛擬化
  3. 更輕鬆的遷移和擴展
  4. 更簡單的管理
@appleboy
appleboy / docker-compose.bitbucket.yml
Created November 11, 2017 14:39
Drone with bitbucket config
version: '2'
services:
drone-server:
image: drone/drone:0.8
ports:
- 8080:8000
- 9000:9000
volumes:
- ./:/var/lib/drone/
@appleboy
appleboy / requirement.md
Last active November 10, 2017 14:48
Drone 事前準備

Drone 事前準備

請使用 Linux 或 MacOS 來進行 Drone 實戰,如果你是使用 Windows 環境,請務必裝好 VM 或者是使用 Digital Ocean 機器。Do 機器可以使用小時計費 可以選用最小方案 $20/month,每小時大約 0.03 美金。請務必先安裝底下兩項軟體:

package main
import (
"fmt"
"log"
"golang.org/x/crypto/bcrypt"
)
func main() {
@appleboy
appleboy / .drone.yml
Created October 8, 2017 13:30
drone scp config example.
scp_dev:
image: appleboy/drone-scp
pull: true
host: example.com
port: 22
username: deploy
target: /home/deploy/drone/${DRONE_REPO}
secrets:
- source: deploy_key
target: scp_key
@appleboy
appleboy / deploy.yml
Created July 31, 2017 13:05
drone server + agent for docker swarm
version: "3"
networks:
traefik:
external: true
internal:
internal: true
volumes:
minio:
@appleboy
appleboy / gitea_install.md
Last active January 20, 2024 09:48
how to install gitea in Ubuntu/Debian.

Gitea

Gitea is a painless self-hosted Git service. It is similar to GitHub, Bitbucket or Gitlab. The initial development have been done on Gogs but we have forked it and named it Gitea. If you want to read more about the reasons why we have done that please read this blog post.

Run Gitea service

Download Gitea binary from download page first.

$ wget https://dl.gitea.io/gitea/1.1.0/gitea-1.1.0-linux-amd64 -O gitea
@appleboy
appleboy / gitea
Last active February 17, 2017 07:01
Gitea Init Script with MySQL
#!/bin/sh
### BEGIN INIT INFO
# Provides: gitea
# Required-Start: $syslog $network mysql
# Required-Stop: $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: A self-hosted Git service written in Go.
# Description: A self-hosted Git service written in Go.
### END INIT INFO