Skip to content

Instantly share code, notes, and snippets.

View 123Daoxyz's full-sized avatar

Daoxyz 123Daoxyz

  • null
  • LA@USA
View GitHub Profile
@123Daoxyz
123Daoxyz / make_docker_build_faster.md
Created August 4, 2019 08:36
How to make docker build images faster in china

make your docker build process faster in china

way one, add these lines in your dockerfile

RUN sed -i "s/archive.ubuntu./mirrors.aliyun./g" /etc/apt/sources.list
RUN sed -i "s/deb.debian.org/mirrors.aliyun.com/g" /etc/apt/sources.list
RUN sed -i "s/security.debian.org/mirrors.aliyun.com\/debian-security/g" /etc/apt/sources.list

way two, use the awesome daocloud, just free

@123Daoxyz
123Daoxyz / bench.sh
Created January 31, 2019 17:05 — forked from TimothyYe/bench.sh
Bench test script
#!/usr/bin/env bash
#
# Description: Auto test download & I/O speed script
#
# Copyright (C) 2015 - 2016 Teddysun <i@teddysun.com>
#
# Thanks: LookBack <admin@dwhd.org>
#
# URL: https://teddysun.com/444.html
#
{"sig":"e596ce75dbab35172f69d4cd81afc4e125e6fc99c1caed1a06ab89f8e423c653f047ab5e1418d4855a173d837533b081f0fcdebeeae9aefee544477f219346991","msghash":"5ab43d3b004173ff9919c233b46d92459b29e8ee3c796f0714e522947f57f751"}
@123Daoxyz
123Daoxyz / keybase.md
Created February 21, 2018 07:48
keybase proof

Keybase proof

I hereby claim:

  • I am zhkzyth on github.
  • I am hugozen (https://keybase.io/hugozen) on keybase.
  • I have a public key ASATrmpdJjqIGb28y1eaZpVwUkclIneXl87ZXcFDUJtCggo

To claim this, I am signing this object:

@123Daoxyz
123Daoxyz / cut_nginx_log.sh
Created August 28, 2017 08:45
cut nginx log by date
#!/bin/bash
# 初始化
LOGS_PATH=/mnt/CodingMonkey/log
YESTERDAY=$(date -d "yesterday" +%Y%m%d)
mv -f ${LOGS_PATH}/api_access.log ${LOGS_PATH}/api_access_${YESTERDAY}.log 2>/dev/null
mv -f ${LOGS_PATH}/api_error.log ${LOGS_PATH}/api_error_${YESTERDAY}.log 2>/dev/null
@123Daoxyz
123Daoxyz / tar
Created February 7, 2017 03:18
Compress a Whole Linux or UNIX Directory
`tar -zcvf archive-name.tar.gz directory-name`
Where,
-z : Compress archive using gzip program
-c: Create archive
-v: Verbose i.e display progress while creating archive
-f: Archive File name
@123Daoxyz
123Daoxyz / mysql
Last active February 11, 2017 06:45
create database
CREATE DATABASE mydatabase CHARACTER SET utf8 COLLATE utf8_general_ci;
### add new column
ALTER TABLE material ADD COLUMN is_synchronized tinyint default '1' NOT NULL COMMENT '0代表未同步到微信,1代表已同步到微信';
@123Daoxyz
123Daoxyz / 0_reuse_code.js
Created February 4, 2017 02:26
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@123Daoxyz
123Daoxyz / on_my_shell_snippets.sh
Last active August 15, 2016 15:31
shell snippets
# handy dirty funcs used frequently
```
- ps aux | grep mysqld | grep -v grep | awk '{print $2}' | xargs kill -9 ; #kill the programe by name
```
@123Daoxyz
123Daoxyz / logging snippets
Created August 14, 2016 12:45
python logging snippets
#!/usr/bin/env python
# encoding: utf-8
import logging
import sys
FMT = (
'[%(levelname)s][%(name)s:%(process)d][%(asctime)s]' +
': %(message)s')