Skip to content

Instantly share code, notes, and snippets.

View sy264115809's full-sized avatar

邵羽 sy264115809

View GitHub Profile
@sy264115809
sy264115809 / centos7-certbot-fix.md
Last active March 25, 2020 16:49
centos 7 下安装 certbot 执行失败
#!/bin/bash
# project_id, find it here: https://gitlab.com/[organization name]/[repository name]/edit inside the "General project settings" tab
project_id="3034900"
# token, find it here: https://gitlab.com/profile/personal_access_tokens
token="Lifg_azxDyRp8eyNFRfg"
server="gitlab.com"
# go to https://gitlab.com/[organization name]/[repository name]/-/jobs
@sy264115809
sy264115809 / rsa_example.go
Last active September 27, 2017 10:53
golang rsa encryption
package main
import (
"crypto"
"crypto/rand"
"crypto/rsa"
"crypto/sha256"
"crypto/x509"
"encoding/base64"
"encoding/pem"
@sy264115809
sy264115809 / admin_user_tree_model.go
Last active July 13, 2016 03:38
Organization Tree Model in Mongo
// follow https://docs.mongodb.com/manual/tutorial/model-tree-structures-with-materialized-paths/
package models
import (
"errors"
"fmt"
"strings"
"time"
"qbox.us/mgo2"
@sy264115809
sy264115809 / oh-my-zsh.honukai.zsh-theme
Last active July 9, 2016 07:48
oh-my-zsh/themes/honukai.zsh-theme
# Based on the great ys theme (http://ysmood.org/wp/2013/03/my-ys-terminal-theme/)
# Machine name.
function box_name {
[ -f ~/.box-name ] && cat ~/.box-name || echo $HOST
}
# Directory info.
local current_dir='${PWD/#$HOME/~}'
@sy264115809
sy264115809 / models.event.go
Last active July 22, 2016 08:30
models example
package models
import (
"time"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"github.com/qbox/gogo/lib/model"
)