#tips:
#sometimes, use udp and send by parallel is the only way, if you behind a proxy
#----------------------nc way-----------------------------
## input part
SSH_HOST=your_host_ip
# --way 1-- direct
for PORT in $PORT1 $PORT2 $PORT3; do nc -vz $SSH_HOST $PORT; done; ssh $SSH_USER@SSH_HOST
#include <windows.h> | |
#include <stdio.h> | |
#include <tchar.h> | |
#define MAX_BUF 1024 | |
#define pipename "\\\\.\\pipe\\LogPipe" | |
int main() | |
{ | |
HANDLE pipe = CreateFile(pipename, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); | |
if (pipe == INVALID_HANDLE_VALUE) |
set default="0" | |
function load_video { | |
insmod efi_gop | |
insmod efi_uga | |
insmod video_bochs | |
insmod video_cirrus | |
insmod all_video | |
} |
# Stop all containers | |
docker stop `docker ps -qa` | |
# Remove all containers | |
docker rm `docker ps -qa` | |
# Remove all images | |
docker rmi -f `docker images -qa ` | |
# Remove all volumes |
#!/bin/bash | |
# | |
# the basic idea from https://gist.github.com/vishvananda/7094676 | |
# | |
# if [ "$4" == "" ]; then | |
# echo "usage: $0 <local_ip> <remote_ip> <new_local_ip> <new_remote_ip>" | |
# echo "creates an ipsec tunnel between two machines" | |
# exit 1 |
由于路由管控系统的建立,实时动态黑洞路由已成为最有效的封锁手段,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很类似。
In response to a StackOverflow question:
This is code to build a Direct3D wrapper DLL, intercepting all calls to Direct3D interface functions so that you can draw your own objects to display over the game. Just plop the DLL into the same folder as the game's executable, and it should load it as if it were the real d3d9.dll file. It still forwards all calls to the real one in system32, just allows stuff to happen in between. original stackoverflow answer
cmake_minimum_required(VERSION 3.5) | |
project(myproject) | |
set(SOURCE_FILES src/main.cpp) | |
add_executable(myproject ${SOURCE_FILES}) | |
set_target_properties(${PROJECT_NAME} PROPERTIES VS_DOTNET_TARGET_FRAMEWORK_VERSION "v4.6") | |
set_target_properties(${PROJECT_NAME} PROPERTIES VS_DOTNET_REFERENCES "System") | |
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/clr /EHa") | |
string(REGEX REPLACE "/RTC(su|[1su])" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") | |
string(REGEX REPLACE "/RTC(su|[1su])" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") |
from StringIO import StringIO | |
from lxml import etree | |
xslt_root = etree.XML('''\ | |
<xsl:stylesheet version="1.0" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:template match="/"> | |
<foo><xsl:value-of select="/a/b/text()" /></foo> | |
</xsl:template> | |
</xsl:stylesheet>''') |
<?xml version="1.0" encoding="utf-8"?> | |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a ="http://microsoft.com/schemas/VisualStudio/TeamTest/2006" xmlns:b ="http://microsoft.com/schemas/VisualStudio/TeamTest/2010" > | |
<xsl:output method="xml" indent="yes" /> | |
<xsl:template match="/"> | |
<testsuites> | |
<xsl:variable name="buildName" select="//a:TestRun/@name"/> | |
<xsl:variable name="numberOfTests" select="count(//a:UnitTestResult/@testId) + count(//b:UnitTestResult/@testId)"/> | |
<xsl:variable name="numberOfFailures" select="count(//a:UnitTestResult/@outcome[.='Failed']) + count(//b:UnitTestResult/@outcome[.='Failed'])" /> | |
<xsl:variable name="numberOfErrors" select="count(//a:UnitTestResult[not(@outcome)]) + count(//b:UnitTestResult[not(@outcome)])" /> | |
<xsl:variable name="numberSkipped" select="count(//a:UnitTestResult/@outcome[.!='Passed' and .!='Failed']) + count(//b:UnitTestResult/@outcome[.!='Passed' and .!='Failed'])" /> |