Skip to content

Instantly share code, notes, and snippets.

View evvil's full-sized avatar

Evvil evvil

View GitHub Profile
@evvil
evvil / live.fc2.com-downloader.bash
Created October 28, 2021 11:51 — forked from calvinthefreak/live.fc2.com-downloader.bash
Script to download liveshows from live.fc2.com
#!/bin/bash
# Written by https://github.com/calvinthefreak
#
# MIT License
#
# Copyright (c) 2019 Calvin "calvinthefreak" Speckhals
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@evvil
evvil / dynmotd
Created August 21, 2021 12:12 — forked from Equim-chan/dynmotd
Dynamic motd for CentOS7
#!/bin/bash
# Installation:
#
# 1. vim /etc/ssh/sshd_config
# PrintMotd no
#
# 2. vim /etc/pam.d/login
# # session optional pam_motd.so
#
@evvil
evvil / hosts
Created July 2, 2019 08:21 — forked from alswl/hosts
hosts for OpenWRT, for disable AD in xiaomi TV
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
@evvil
evvil / adblock
Last active January 30, 2019 13:45
mo3399.net###right_down_float_ad
mo3399.net###left_down_float_ad
@evvil
evvil / tree.md
Created December 11, 2018 03:32 — forked from upsuper/tree.md
一行 Python 实现树

一行 Python 实现树

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

def tree(): return defaultdict(tree)

就是这样!

@evvil
evvil / Clear-unwanted-URL-on-Chrome-address-bar.md
Created November 2, 2018 10:13 — forked from muink/Clear-unwanted-URL-on-Chrome-address-bar.md
删除Chrome地址栏记录中不需要的网址

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

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

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

@evvil
evvil / DbUnitSampleTest.groovy
Created August 8, 2018 02:30 — forked from kiy0taka/DbUnitSampleTest.groovy
[Groovy][DbUnit] Using DbUnit with 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 August 8, 2018 02:30 — forked from kenwdelong/DbUnitWithGroovy.md
Use Groovy to assign test data with DbUnit

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

0x01 网关意义

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

0x02 网关介绍

  1. 配置后台和地址
  2. 过滤器 sign -> auth -> route -> translate -> response
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;