Skip to content

Instantly share code, notes, and snippets.

View hetykai's full-sized avatar
🏠
Working from home

hetykai

🏠
Working from home
View GitHub Profile
channels:
- defaults
show_channel_urls: true
default_channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
custom_channels:
conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
wget -q -O ~/.condarc https://gist.githubusercontent.com/hetykai/009981512d819c79ce3628cf3eb91a28/raw && \
conda config --set show_channel_urls yes && \
echo -e "[global]\nindex-url = https://mirrors.cloud.tencent.com/pypi/simple" | install -D /dev/stdin ~/.config/pip/pip.conf && \
echo -e "[global]\nindex-url = https://mirrors.cloud.tencent.com/pypi/simple" | install -D /dev/stdin ~/.pip/pip.conf && \
pip install pip -U && \
pip config set global.index-url https://mirrors.cloud.tencent.com/pypi/simple
@hetykai
hetykai / setNodeMirror.sh
Last active July 7, 2023 02:44
修改node npm yarn的镜像源设置,替换为国内的淘宝源
npm set registry https://registry.npm.taobao.org && \
npm set disturl https://npm.taobao.org/dist && \
npm set sass_binary_site https://npm.taobao.org/mirrors/node-sass && \
npm set electron_mirror https://npm.taobao.org/mirrors/electron/ && \
npm set puppeteer_download_host https://storage.googleapis.com.cnpmjs.org && \
npm set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver && \
npm set operadriver_cdnurl https://npm.taobao.org/mirrors/operadriver && \
npm set phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs && \
npm set selenium_cdnurl https://npm.taobao.org/mirrors/selenium && \
npm set node_inspector_cdnurl https://npm.taobao.org/mirrors/node-inspector && \
[Macaron] 2018-05-22 11:11:04: Started GET / for 172.17.0.1
2018/05/22 11:11:04 [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `description`, `num_teams`, `num_members`, `diff_view_style` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{1}
2018/05/22 11:11:04 [D] Session ID: xxxxxxxxxxxxxxxxxxxxxxxx
2018/05/22 11:11:04 [D] CSRF Token: yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
2018/05/22 11:11:04 [I] [SQL] SELECT count(*) FROM `notification` WHERE (user_id = ?) AND (status = ?) []interface {}{1, 0x1}
2018/05/22 11:11:04 [I] [SQL] SELECT * FROM `org_user` LEFT J
#!/bin/sh
#/usr/sbin/service aria2 stop
list=`wget -qO- https://newtrackon.com/api/live|awk NF|sed ":a;N;s/\n/,/g;ta"`
if [ -z "`grep "bt-tracker" /media/AiDisk_a1/aria/config/aria2.conf`" ]; then
sed -i '$a bt-tracker='${list} /media/AiDisk_a1/aria/config/aria2.conf
echo add......
else
sed -i "s@bt-tracker.*@bt-tracker=$list@g" /media/AiDisk_a1/aria/config/aria2.conf
echo update......
@hetykai
hetykai / Arith.java
Created December 7, 2015 10:17 — forked from binjoo/Arith.java
JAVA:BigDecimal加减乘除运算
import java.math.BigDecimal;
/**
* 由于Java的简单类型不能够精确的对浮点数进行运算,这个工具类提供精确的浮点数运算,包括加减乘除和四舍五入。
*/
public class Arith { // 默认除法运算精度
private static final int DEF_DIV_SCALE = 10; // 这个类不能实例化
private Arith() {
}