Skip to content

Instantly share code, notes, and snippets.

@icedfish
icedfish / docker-registry-mirrors.md
Created November 4, 2022 04:35 — forked from y0ngb1n/docker-registry-mirrors.md
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+

创建或修改 /etc/docker/daemon.json

@icedfish
icedfish / auto_switch_kb.py
Created December 19, 2018 07:00 — forked from tiann/auto_switch_kb.py
auto switch keyboard to english in specific applications
#! /usr/bin/env python
# coding: utf-8
'''
auto switch keyboard between different applications
if you want to change the app list, modify the var 'ignore_list'
'''
from AppKit import NSWorkspace, NSWorkspaceDidActivateApplicationNotification, NSWorkspaceApplicationKey
@icedfish
icedfish / surge.conf
Created February 23, 2017 09:08 — forked from jason5ng32/surge.conf
Surge Configs ( for 2.x )
[General]
loglevel = notify
skip-proxy = 127.0.0.1, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local, ::ffff:0:0:0:0/1, ::ffff:128:0:0:0/1
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12
# dns-server = 119.29.29.29,223.5.5.5,114.114.115.115
# external-controller-access = PASSWORD@0.0.0.0:6155
# ipv6 = true
// REMEMBER TO CHANGE THE external-controller-access' PASSWORD
@icedfish
icedfish / export_as_xlsx.py
Created April 19, 2016 01:37 — forked from zhwei/export_as_xlsx.py
MySQL Workbench Plugin: Export Result Set As Excel Xlsx
# -*- coding: utf-8 -*-
#
# Export Result Set As Excel Xlsx File
#
# Installation:
# 1. Install Python(2.7) Module "XlsxWriter", See http://xlsxwriter.readthedocs.org/getting_started.html
# 2. In MySQL Workbench
# Scripting => Install Plugin/Module... => <select this script> => <restart mysql workbench>
#
# Usage:
@icedfish
icedfish / RunFile.php
Created July 26, 2015 08:59
Laravel artisan command to run php script.
<?php namespace App\Console\Commands;
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputArgument;
class RunFile extends Command
{
/**
* The console command name.
@icedfish
icedfish / .tmux.conf
Created October 14, 2014 06:50
tmux personal conf file
# Set prefix key to Ctrl-a
unbind-key C-b
set-option -g prefix C-a
bind-key C-a last-window # 方便切换,个人习惯
bind-key a send-prefix
# shell下的Ctrl+a切换到行首在此配置下失效,此处设置之后Ctrl+a再按a即可切换至shell行首
# reload settings # 重新读取加载配置文件
bind R source-file ~/.tmux.conf \; display-message "Config reloaded..."
@icedfish
icedfish / es_meta.json
Last active August 29, 2015 14:01
curl -X PUT localhost:9200/index_name -d @es_meta.json
{
"index": {
"analysis": {
"analyzer": {
"pinyin_analyzer": {
"tokenizer": "my_pinyin",
"filter": [
"standard",
"nGram"
]
@icedfish
icedfish / how_to_add_jvm_monitor_to_es.md
Last active August 29, 2015 14:01
给ES增加JVM监控支持 (VisualVM Based)
@icedfish
icedfish / ES_ik_analyzer_tset
Last active August 29, 2015 14:01
基于ik的ES分词和搜索测试
1. Dict包含以下:
二手
小米
手机
小米手机
2. elasticsearch.yml
index.analysis.analyzer :
@icedfish
icedfish / create_index_template_for_logstash
Last active August 29, 2015 14:01
Logstash Mapping 说明
curl -XPUT 'http://localhost:9200/_template/logstash_default' -d @/<path>/xxxx.json
# template的mapping和普通mapping略有不同
# 需要在settings前面增加一行
# 非常适合logstash的场景,所以本例中以logstash做sample。
# 相关文档: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html