Skip to content

Instantly share code, notes, and snippets.

View bydmm's full-sized avatar
🦆
Gu Gu Gu

ChengKa bydmm

🦆
Gu Gu Gu
View GitHub Profile
@bydmm
bydmm / ali.md
Last active April 10, 2018 06:33
阿里云小工具
sudo bash -c 'CMS_HOME="/usr/local/cloudmonitor" CMS_VERSION="1.2.21" CMS_ARCH="linux64" CMS_PROXY="szcmsproxy.aliyun.com:3128"; \
if [ -f $CMS_HOME/wrapper/bin/cloudmonitor.sh ] ; then $CMS_HOME/wrapper/bin/cloudmonitor.sh remove; rm -rf $CMS_HOME; fi ; \
mkdir -p $CMS_HOME && \
wget -e "http_proxy=$CMS_PROXY" -O "$CMS_HOME/cloudmonitor.tar.gz" "http://cms-download.aliyun.com/release/$CMS_VERSION/$CMS_ARCH/agent-$CMS_ARCH-$CMS_VERSION-package.tar.gz" && \
tar -xf  $CMS_HOME/cloudmonitor.tar.gz -C $CMS_HOME && \
chown -R root:root $CMS_HOME && \
$CMS_HOME/wrapper/bin/cloudmonitor.sh install && \
$CMS_HOME/wrapper/bin/cloudmonitor.sh start'
@bydmm
bydmm / docker.md
Last active February 5, 2018 12:11
清理过期的docker容器和image
docker system prune
@bydmm
bydmm / ss.sh
Created December 28, 2017 09:55
ss.sh
#!/usr/bin/env bash
sudo apt-get update
sudo apt-get -y install python-pip
pip install shadowsocks
echo '{ "server":"0.0.0.0", "server_port":13388, "local_address": "127.0.0.1","local_port":1080, "password":"Daoyuan123", "timeout":300, "method":"aes-256-cfb", "fast_open": false }' >> /etc/shadowsocks.json
sudo ssserver -c /etc/shadowsocks.json -d start
0x72414f03DAEF77e19cFaeC8D5B3c913B22d3e403
@bydmm
bydmm / main.go
Last active December 8, 2017 08:05
用算力工作证明实现抽卡
package main
import (
"encoding/hex"
"math/rand"
"strconv"
"crypto/sha256"
"time"
"fmt"
)
@bydmm
bydmm / gitlab-442.md
Last active October 26, 2017 14:39
gitlab-442

重启后不能登陆的话,

进入docker修改/etc/nginx/sites-enabled/gitlab

修改其中一行使其变为,

proxy_set_header    X-Forwarded-Proto   https;
@bydmm
bydmm / ss.sh
Last active August 25, 2017 09:49
quick ss
#!/usr/bin/env bash
sudo cat <<EOT >> /etc/sysctl.conf
# max open files
fs.file-max = 1024000
# max read buffer
net.core.rmem_max = 67108864
# max write buffer
net.core.wmem_max = 67108864
# default read buffer
@bydmm
bydmm / mirror.md
Created July 3, 2017 16:40
各种镜像资源

NVM Nodejs

export NVM_NODEJS_ORG_MIRROR=https://npm.taobao.org/mirrors/node

NPM

npm instal xxx --registry=https://registry.npm.taobao.org

@bydmm
bydmm / cloud.html
Last active May 26, 2017 03:33
Quantum Cloud
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<title>Quantum Cloud</title>
<style>
header {
text-align: center;
}
.canvas-container {
display: block;
@bydmm
bydmm / _pg_tag_usage.md
Created April 9, 2017 10:00 — forked from raykin/_pg_tag_usage.md
Extent PG array query in Rails

In Gemfile

gem 'pg_tag', git: 'git://gist.github.com/895e8e58ba83f72efd2a.git', require: 'pg_tag'

In rails model file

has_pg_tag **** # your col name