Skip to content

Instantly share code, notes, and snippets.

View evvil's full-sized avatar

Evvil evvil

View GitHub Profile
@evvil
evvil / aria2.bat
Created August 9, 2016 18:03 — forked from aa65535/aria2.bat
Aria2的配置文件 & 启动脚本
:: 启动后需要保留窗口, 关闭窗口则结束进程
aria2c --conf-path=aria2.conf -D
@evvil
evvil / 0_reuse_code.js
Created February 22, 2017 12:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@evvil
evvil / clowwindy-is-right.md
Created July 28, 2017 06:07 — forked from muink/clowwindy-is-right.md
个人感觉shadowsocks作者说的很对的一句话

shadowsocks作者说的很对的一句话与感想

个人感想:

  • 中国人很投机, 包括本人在部分情况下也是投机者. 总想不劳而获, 抄袭他人劳动成果. 想想我们学生时代的抄袭作弊之风盛行便可知... (然而为什么会这样)
  • "土皇帝"情节, 因自己在某方面上比别人强, 听听粉丝的追捧, 就觉得自己不可一世, 比别人优越, 殊不知人外有人山外有山, 而且自己在其他方面也有不如他人的地方. (然而为什么会这样)
  • 家长情节 总想要一个"家长"来管理一切, 把应该由自己解决的问题抛给别人"包办解决", 图一时之便. 久而久之结果就是并不了解你一切的"家长""包办解决"你的一切, 而你却失去了基本的思考解决问题能力, 看不到目标, 找不到方法, 只好任由"家长"摆布. 这种"爱"是现实的囚笼. (然而为什么会这样)

原文内容:

@evvil
evvil / baidupan
Created February 22, 2018 02:08 — forked from acgotaku/baidupan
新版百度云盘aria2c导出下载 ,目前只实现了核心功能.
// ==UserScript==
// @name 百度网盘aria2导出工具
// @author acgotaku311
// @description 一个方便吧百度网盘的Aria2rpc导出的脚本。
// @encoding utf-8
// @include http://*n.baidu.com/s/*
// @include http://*n.baidu.com/disk/home*
// @include http://*n.baidu.com/share/link*
// @include https://*n.baidu.com/s/*
// @include https://*n.baidu.com/disk/home*
@evvil
evvil / automatic-nightly-backups-for-mongodb.md
Created February 25, 2018 06:53 — forked from lzl/automatic-nightly-backups-for-mongodb.md
服务器每日自动备份 MongoDB 数据库的配置方法

第一步,创建一个存放备份的文件夹:

比如 mkdir /alidata/backup

第二步,新建一个自动备份的脚本:

#!/bin/sh
NAME='mxlzb' # 手动修改为待备份项目的数据库名
DATE=`date +%Y%m%d%H%M%S`
@evvil
evvil / yunfile_downloader
Created March 3, 2018 16:20
A python script
#!/usr/bin/env python
# encoding: utf-8
"""
@version: 0.3
@author: endoffiht
@file: yunfile_downloader.py
@time: 15/6/29 18:06
"""
@evvil
evvil / WSL-ssh-server.md
Last active May 10, 2018 14:48 — 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

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)
  3. Change UsePrivilegeSeparation to no
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;

0x01 网关意义

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

0x02 网关介绍

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