Skip to content

Instantly share code, notes, and snippets.

View blue-bird1's full-sized avatar
🏠
fish touching

青鸟 blue-bird1

🏠
fish touching
View GitHub Profile
@blue-bird1
blue-bird1 / install.sh
Created October 9, 2018 04:29
portainer install
docker volume create portainer_data
docker run -d -p 9000:9000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
@blue-bird1
blue-bird1 / install.sh
Created October 9, 2018 06:51
cheat.sh install #debian
sudo apt install rlwrap
sudo curl https://cht.sh/:cht.sh > /bin/cht.sh
sudo chmod +x /bin/cht.sh
@blue-bird1
blue-bird1 / install.sh
Last active October 10, 2018 00:23
mount google drive #debian
sudo add-apt-repository ppa:alessandro-strada/google-drive-ocamlfuse-beta
sudo apt-get update
sudo apt-get install google-drive-ocamlfuse
google-drive-ocamlfuse
@blue-bird1
blue-bird1 / =templete=.react
Created October 14, 2018 09:30
temple react and redux #templeate
import React from 'react';
class %CLASS% extends React.Component {
render(){
}
}
export default %CLASS%
@blue-bird1
blue-bird1 / install.sh
Created October 17, 2018 14:34
google cloud sdk install #debian
export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)"
echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
sudo apt-get update && sudo apt-get install google-cloud-sdk
gcloud init
@blue-bird1
blue-bird1 / install.sh
Last active November 10, 2018 17:40
k8s install
#!/bin/sh
# https://blog.alexellis.io/kubernetes-in-10-minutes/
apt-get update \
&& apt-get install -qy docker.io
apt-get update && apt-get install -y apt-transport-https \
&& curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list
@blue-bird1
blue-bird1 / test.py
Created October 30, 2018 14:59
func print self __doc__
from inspect import *
def my_selfexplaining_function():
"""This is my function document string"""
print getdoc(globals()[getframeinfo(currentframe()).function])
my_selfexplaining_function()
@blue-bird1
blue-bird1 / test.py
Last active October 30, 2018 15:36
print file all fucntion __doc__
import inspect
def get_module_function__doc(module):
module = __import__(module)
name_func_tuples = inspect.getmembers(module, inspect.isfunction)
name_func_tuples = [t[1] for t in name_func_tuples if inspect.getmodule(t[1]) == module]
tmp = ''
for _ in name_func_tuples:
tmp = tmp+_.__doc__
print(tmp)
get_module_function__doc('command')
@blue-bird1
blue-bird1 / install.sh
Last active November 16, 2018 06:45
install bosh
# install bosh cli
wget https://github.com/cloudfoundry/bosh-cli/releases/download/v5.3.1/bosh-cli-5.3.1-linux-amd64
chmod +x bosh-cli-5.3.1-linux-amd64
mv bosh-cli-5.3.1-linux-amd64 /usr/local/bin/bosh
# nstall package
apt-get install -y build-essential zlibc zlib1g-dev ruby ruby-dev openssl libxslt-dev libxml2-dev libssl-dev libreadline6 libreadline6-dev libyaml-dev libsqlite3-dev sqlite3
git clone https://github.com/cloudfoundry/bosh-bootloader bosh && cd bosh
wget https://github.com/cloudfoundry/bosh-bootloader/releases/download/v6.10.18/bbl-v6.10.18_linux_x86-64
#!/usr/bin/python
# -*- coding: utf-8 -*-
import json
import requests
from cqhttp_helper import CQHttp
bot = CQHttp(
access_token="ac0f790e1fb74ebcaf45da77a6f9de47",
api_root="http://127.0.0.1:5700")
import pdb