Skip to content

Instantly share code, notes, and snippets.

View firefirer1983's full-sized avatar

fyman.zhang firefirer1983

  • China Guangdong Shenzhen
View GitHub Profile
@firefirer1983
firefirer1983 / PIP install from local source.md
Created March 20, 2021 05:42
[PIP install local package]

如果需要安装本地的: pip install file:///home/xy/repo/python/zolo#egg=zolo

@firefirer1983
firefirer1983 / git使用记录.md
Created February 1, 2021 03:16
git使用记录

git使用记录

迁移项目

git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
git remote rm origin
git remote add origin git@github.com:firefirer1983/pytrade-sfa.git

git push --all origin

MYSQL命令

MYSQL增添用户 增添权限

CREATE USER 'xy'@'%' IDENTIFIED BY '123456';
GRANT ALL ON sfa.* TO 'xy'@'%';

MYSQL 数据导入导出

sudo apt-get install mysql-client
@firefirer1983
firefirer1983 / Docker命令.md
Last active January 14, 2021 12:58
Docker命令

Docker Commands

删除image

dr image rm -f eth-coin-in:test

在当前目录下启动python docker

dr run --rm -it -v `pwd`:`pwd` python bash
@firefirer1983
firefirer1983 / Ubuntu安装指南.md
Last active January 11, 2021 05:42
Ubuntu安装指南

Ubuntu安装指导

启动黑屏只有光标

如果有双硬盘(SSD + Disk),需要注意硬盘的插线顺序

因为ubuntu默认会将boot分区安装在sda上,两个硬盘的数据线的插入决定了那个为sda,那个为sdb(sdc/sdd) 一般都是将系统安装在 SSD,所以需要注意将SSD插线设置为 sda 如果系统安装在SSD,而boot安装在Disk,会导致系统黑屏,只有一个光标,说明是找不到boot分区

先安装基础的包

@firefirer1983
firefirer1983 / dont_wirte_classes.md
Last active December 3, 2020 15:09
[Don't write classes] 不要写类 #编程原则

Don't write classes

  1. We ship features, not code.

  2. We want as little code as possible

  3. readibility counts 优先级是(从高到低): 交付功能,不交付代码,

    目标驱动,不忘初心.

    越少代码越好 > 没有代码,是最好的代码

@firefirer1983
firefirer1983 / Docker安装.md
Last active November 17, 2020 05:39
Docker安装

Docker 安装

安装

摘自:https://docs.docker.com

sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get update
sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
@firefirer1983
firefirer1983 / docker_console_log_size_limit.md
Last active September 22, 2020 08:12
Docker console log file size limit

docker会自动保存console log,这样可能会导致磁盘爆掉,通过/etc/docker/daemon.json,配置log:

docker-compose配置Log

查看docker container占用空间:

docker system df -v
du -sh /var/lib/docker/containers/*
@firefirer1983
firefirer1983 / python安装须知.md
Last active August 14, 2020 10:22
python安装须知

python安装须知

install pyenv

git clone https://github.com/pyenv/pyenv.git ~/.pyenv

echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc

echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n  eval "$(pyenv init -)"\nfi' >> ~/.bashrc
source ~/.bashrc
@firefirer1983
firefirer1983 / nodejs安装.md
Last active July 30, 2020 09:20
nodejs安装

nodejs安装

摘自:https://tecadmin.net

sudo apt-get install curl
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install nodejs
node -v
npm -v