Skip to content

Instantly share code, notes, and snippets.

View evvil's full-sized avatar

Evvil evvil

View GitHub Profile
@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
@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 / 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 / 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 / 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 / clowwindy-is-right.md
Created July 28, 2017 06:07 — forked from muink/clowwindy-is-right.md
个人感觉shadowsocks作者说的很对的一句话

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

个人感想:

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

原文内容:

@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 / aria2.bat
Created August 9, 2016 18:03 — forked from aa65535/aria2.bat
Aria2的配置文件 & 启动脚本
:: 启动后需要保留窗口, 关闭窗口则结束进程
aria2c --conf-path=aria2.conf -D