Skip to content

Instantly share code, notes, and snippets.

Evvil evvil

Block or report user

Report or block evvil

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@evvil
evvil / hosts
Created Jul 2, 2019 — forked from alswl/hosts
hosts for OpenWRT, for disable AD in xiaomi TV
View hosts
127.0.0.1 api.ad.xiaomi.com
127.0.0.1 sdkconfig.ad.xiaomi.com
127.0.0.1 ad.mi.com
127.0.0.1 ad.xiaomi.com
127.0.0.1 ad1.xiaomi.com
127.0.0.1 adv.sec.miui.com
127.0.0.1 test.ad.xiaomi.com
127.0.0.1 new.api.ad.xiaomi.com
View adblock
mo3399.net###right_down_float_ad
mo3399.net###left_down_float_ad
@evvil
evvil / tree.md
Created Dec 11, 2018 — forked from upsuper/tree.md
一行 Python 实现树
View tree.md

一行 Python 实现树

使用 Python 内置的 defaultdict,我们可以很容易的定义一个树形数据结构:

def tree(): return defaultdict(tree)

就是这样!

View Clear-unwanted-URL-on-Chrome-address-bar.md

删除Chrome地址栏记录中不需要的网址(访问历史)

Chrome的地址栏自动补齐功能提供了非常方便的地址预测功能 浏览器可以通过用户当前输入的字符来与用户的访问历史与书签匹配 然后在下拉栏中为用提供准确的补齐方案排名, 提高用户访问效率

在大部分情况下, 这个功能是非常好用的 但是有时, 出于某些原因, 用户需要移除某个记录(网址无法访问,网址更换域名等) Chrome提供了组合键Shift+Delete来删除地址栏下拉记录中的某个网址

@evvil
evvil / DbUnitSampleTest.groovy
Created Aug 8, 2018 — forked from kiy0taka/DbUnitSampleTest.groovy
[Groovy][DbUnit] Using DbUnit with Groovy
View DbUnitSampleTest.groovy
import groovy.grape.Grape
import groovy.sql.Sql
import groovy.xml.StreamingMarkupBuilder
import org.dbunit.*
import org.dbunit.dataset.xml.*
import org.dbunit.database.*
@Grab('org.dbunit:dbunit:2.4.7')
@Grab('org.slf4j:slf4j-nop:1.5.10')
class DbUnitSampleTest extends GroovyTestCase {
@evvil
evvil / DbUnitWithGroovy.md
Created Aug 8, 2018 — forked from kenwdelong/DbUnitWithGroovy.md
Use Groovy to assign test data with DbUnit
View DbUnitWithGroovy.md

DbUnit with Groovy

This little extension to DbUnit allows you to write the test data using Groovy lists and maps rather than XML or Excel. That way you can keep your test data in the same file as your db integration test, which will be easier to grok and maintain.

GroovyDataset is the DbUnit extension that you need to put in your project. GroovyDatasetTest is the unit test for it. UserIntegrationTest is an example, where the "data" attribute is the test data that is inserted into the database. (In real life, you'd create a superclass and move the SessionFactory, the definition of the data field, the setup() method, etc. there).

This was all described in a blog post: http://www.jroller.com/kenwdelong/entry/groovy_based_dbdeploy_tests

For how to use it, see the UserIntegrationTest below. You can specify the data for the test in a List of Maps

View demo.md

0x01 网关意义

  1. 为什么要做网关
  2. 网关现状

0x02 网关介绍

  1. 配置后台和地址
  2. 过滤器 sign -> auth -> route -> translate -> response
View HttpUploadServerInitializer.java
package my.netty.http.upload;
import io.netty.channel.Channel;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.handler.codec.http.HttpRequestDecoder;
@evvil
evvil / WSL-ssh-server.md
Last active May 10, 2018 — forked from dentechy/WSL-ssh-server.md
A step by step tutorial on how to automatically start ssh server on boot on the Windows Subsystem for Linux
View WSL-ssh-server.md

How to automatically start ssh server on boot on Windows Subsystem for Linux

Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.

  1. Uninstall and reinstall the ssh server using the following commands:
    1. sudo apt remove openssh-server
    2. sudo apt install openssh-server
  2. Edit the /etc/ssh/sshd_config file by running the command sudo vi /etc/ssh/sshd_config and do the following
    1. Change Port to 2222 (or any other port above 1000)
    2. Change UsePrivilegeSeparation to no
View yunfile_downloader
#!/usr/bin/env python
# encoding: utf-8
"""
@version: 0.3
@author: endoffiht
@file: yunfile_downloader.py
@time: 15/6/29 18:06
"""
You can’t perform that action at this time.