Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
fish touching

青鸟 blue-bird1

🏠
fish touching
View GitHub Profile
View test.py
#!/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
@blue-bird1
blue-bird1 / install.sh
Last active Nov 16, 2018
install bosh
View install.sh
# 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
@blue-bird1
blue-bird1 / test.py
Last active Oct 30, 2018
print file all fucntion __doc__
View test.py
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 / test.py
Created Oct 30, 2018
func print self __doc__
View test.py
from inspect import *
def my_selfexplaining_function():
"""This is my function document string"""
print getdoc(globals()[getframeinfo(currentframe()).function])
my_selfexplaining_function()
View install.sh
#!/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 / install.sh
Created Oct 17, 2018
google cloud sdk install #debian
View install.sh
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 / =templete=.react
Created Oct 14, 2018
temple react and redux #templeate
View =templete=.react
import React from 'react';
class %CLASS% extends React.Component {
render(){
}
}
export default %CLASS%
@blue-bird1
blue-bird1 / install.sh
Last active Oct 10, 2018
mount google drive #debian
View install.sh
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 / install.sh
Created Oct 9, 2018
cheat.sh install #debian
View install.sh
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
Created Oct 9, 2018
portainer install
View install.sh
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