Skip to content

Instantly share code, notes, and snippets.

#include <windows.h>
#include <stdio.h>
#pragma pack(push, 2)
#define RT_ICON MAKEINTRESOURCE(3)
#define RT_GROUP_ICON MAKEINTRESOURCE((ULONG_PTR)(RT_ICON) + 11)
/* Icon file header */
typedef struct
@missdeer
missdeer / gen_Corefile.sh
Last active April 12, 2024 10:08
generate Corefile which uses your ISP's DNS servers to resolve domain names in China and uses OpenDNS/Cloudflare/Google DNS servers to resolve domain names outside China for CoreDNS. You should change 119.29.29.29/223.5.5.5 to your ISP's DNS server address or use public DNS server such as 114/DNSPod etc. directly.
#!/bin/sh
echo 'use "curl -sSL git.io/corefile | bash" to update Corefile'
echo "remember to change 192.168.1.1 to your ISP's DNS server address or use public DNS server such as 114/DNSPod etc. directly"
china=`curl -sSL https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/accelerated-domains.china.conf | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
apple=`curl -sSL https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/apple.china.conf | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
google=`curl -sSL https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/google.china.conf | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
bogus=`curl -sSL https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/bogus-nxdomain.china.conf | grep "=" | while read line; do awk -F '=' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
cat>Corefile
@missdeer
missdeer / mergeip.py
Created August 24, 2018 06:41
merge ip list
import sys
from collections import defaultdict
route_map=defaultdict(set)
try:
input_file=open(sys.argv[1],'r')
except:
input_file=sys.stdin
iplist=set()
ln=0
for line in input_file:
@missdeer
missdeer / weixin_jump_to_alipay_redbag.js
Created January 5, 2018 13:30
weixin jump to alipay redbag
<!DOCTYPE html>
<html lang="zh-cmn-hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
<title>正在打开资源,请稍候……</title>
</head>
<body>
</body>
@missdeer
missdeer / ProxyUtils.java
Created July 23, 2017 14:22 — forked from mcxiaoke/ProxyUtils.java
set proxy for Android WebView, worked on api 9 ~ 19
package com.mcxiaoke.next.utils;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.net.Proxy;
import android.os.Build;
import android.os.Parcelable;
import android.util.ArrayMap;
import android.util.Log;
#!/bin/bash
env PATH=$androidNDKRoot/toolchains/x86-linux-android-4.9/prebuilt/darwin-x86_64/bin/:$PATH ./bjam -j2 --reconfigure link=static threading=multi threadapi=pthread target-os=android stage --stagedir=android/x86 toolset=gcc-x86 define=BOOST_MATH_DISABLE_FLOAT128 include=$androidNDKRoot/sources/cxx-stl/gnu-libstdc++/4.9/include include=$androidNDKRoot/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/include/ include=$androidNDKRoot/platforms/android-21/arch-x86/usr/include
env PATH=$androidNDKRoot/toolchains/x86_64-linux-android-4.9/prebuilt/darwin-x86_64/bin/:$PATH ./bjam -j2 --reconfigure link=static threading=multi threadapi=pthread target-os=android stage --stagedir=android/x86_64 toolset=gcc-x86_64 define=BOOST_MATH_DISABLE_FLOAT128 include=$androidNDKRoot/sources/cxx-stl/gnu-libstdc++/4.9/include include=$androidNDKRoot/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86_64/include/ include=$androidNDKRoot/platforms/android-21/arch-x86_64/usr/include
env PATH=$androidNDKRoot/toolchains/arm-linux-android-4.9/p
#===============================================================================
# Filename: boost.sh
# Author: Pete Goodliffe, Daniel Rosser
# Copyright: (c) Copyright 2009 Pete Goodliffe, 2013 Daniel Rosser
# Licence: Please feel free to use this, with attribution
# Modified version ## for ofxOSXBoost
#===============================================================================
#
# Builds a Boost framework for the OSX.
# Creates a set of universal libraries that can be used on OSX (i386, x86_64)
call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x86
set cores=%NUMBER_OF_PROCESSORS%
echo Building boost with %cores% cores
call bootstrap.bat
rem Most libraries can be static libs
b2 -j%cores% toolset=msvc-14.0 address-model=64 architecture=x86 link=static threading=multi runtime-link=shared --build-type=minimal stage --stagedir=stage/msvc2015-x64
b2 -j%cores% toolset=msvc-14.0 address-model=32 architecture=x86 link=static threading=multi runtime-link=shared --build-type=minimal stage --stagedir=stage/msvc2015-x86
#===============================================================================
# Filename: build-libc++.sh
# Author: Pete Goodliffe, Daniel Rosser
# Copyright: (c) Copyright 2009 Pete Goodliffe, 2014 Daniel Rosser
# Licence: Please feel free to use this, with attribution
# Modified version ## for ofxiOSBoost
#===============================================================================
#
# Builds a Boost framework for the iPhone.
# Creates a set of universal libraries that can be used on an iPhone and in the
@missdeer
missdeer / gist:e22631912ddc858f4894
Created November 5, 2015 04:16 — forked from msmuenchen/gist:9318327
KeePass v2.x (KDBX v3.x) file format
Convention: Byte array notation as it would appear in a hexeditor.
= Layout=
KDBX files, the keepass database files, are layout as follows:
1) Bytes 0-3: Primary identifier, common across all kdbx versions:
private static $sigByte1=[0x03,0xD9,0xA2,0x9A];
2) Bytes 4-7: Secondary identifier. Byte 4 can be used to identify the file version (0x67 is latest, 0x66 is the KeePass 2 pre-release format and 0x55 is KeePass 1)