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 / Naive-VPN.md
Created November 5, 2017 15:55 — forked from klzgrad/Naive-VPN.md
朴素VPN:一个纯内核级静态隧道

朴素VPN:一个纯内核级静态隧道

由于路由管控系统的建立,实时动态黑洞路由已成为最有效的封锁手段,TCP连接重置和DNS污染成为次要手段,利用漏洞的穿墙方法已不再具有普遍意义。对此应对方法是多样化协议的VPN来抵抗识别。这里介绍一种太简单、有时很朴素的“穷人VPN”。

朴素VPN只需要一次内核配置(Linux内核),即可永久稳定运行,不需要任何用户态守护进程。所有流量转换和加密全部由内核完成,原生性能,开销几乎没有。静态配置,避免动态握手和参数协商产生指纹特征导致被识别。并且支持NAT,移动的内网用户可以使用此方法。支持广泛,基于L2TPv3标准,Linux内核3.2+都有支持,其他操作系统原则上也能支持。但有两个局限:需要root权限;一个隧道只支持一个用户。

朴素VPN利用UDP封装的静态L2TP隧道实现VPN,内核XFRM实现静态IPsec。实际上IP-in-IP隧道即可实现VPN,但是这种协议无法穿越NAT,因此必须利用UDP封装。内核3.18将支持Foo-over-UDP,在UDP里面直接封装IP,与静态的L2TP-over-UDP很类似。

创建一个朴素VPN

@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