Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
br="br0"
tap="tap0"
ifconfig $br down
brctl delbr $br
for t in $tap; do
openvpn --rmtun --dev $t
done
#!/bin/bash
br="br0"
tap="tap0"
eth="eth0"
eth_ip="192.168.0.3"
eth_netmask="255.255.255.0"
eth_broadcast="192.168.0.255"
eth_gw="192.168.0.1"
@takezoh
takezoh / private_access.cpp
Created February 20, 2019 01:27 — forked from dabrahams/private_access.cpp
Accessing Private Data
#include <iostream>
// This is a rewrite and analysis of the technique in this article:
// http://bloglitb.blogspot.com/2010/07/access-to-private-members-thats-easy.html
// ------- Framework -------
// The little library required to work this magic
// Generate a static data member of type Tag::type in which to store
// the address of a private member. It is crucial that Tag does not
Begin Object Class=/Script/BlueprintGraph.K2Node_CallFunction Name="K2Node_CallFunction_4"
FunctionReference=(MemberParent=Class'/Script/Engine.GameUserSettings',MemberName="GetGameUserSettings")
NodePosX=-400
NodePosY=-1296
NodeGuid=4A8C6436461DF7AF4DE3DB900F762C6E
CustomProperties Pin (PinId=D13B28B744E97D83150C1C809802000B,PinName="execute",PinToolTip="\n実行",PinType.PinCategory="exec",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsMap=False,PinType.bIsSet=False,PinType.bIsArray=False,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,LinkedTo=(K2Node_CallFunction_2 00B9388844F5E0F6EF4080895DBEFE57,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
CustomProperties Pin (PinId=DEE3F45D4D814BE9F8C04CA43B1B335F,PinName
#include <iostream>
template <typename TBase, typename TDerived>
struct IsSubclassOf {
private:
using Yes = struct { char x[1]; };
using No = struct { char x[2]; };
static Yes issubclass(const TBase&);
static No issubclass(...);
static TDerived type;
@takezoh
takezoh / exclude.x86.aar
Created September 14, 2017 16:00
aar から x86 ライブラリを削除
#!/bin/bash
aar=`basename $1`
dir=`dirname $1`
work=/tmp/${aar%.*}.work
rm -rf $work
mkdir -p $work
cp $dir/$aar $work
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
internal static extern uint GetCurrentProcessId();
[DllImport("user32.dll", CharSet = CharSet.Auto)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool EnumWindows(EnumWindowsProc lpEnumFunc, ref handle_data lParam);
[return: MarshalAs(UnmanagedType.Bool)]
internal delegate bool EnumWindowsProc(IntPtr hwnd, ref handle_data lparam);
IntPtr CopyToGlobalMemory(string text)
{
var bytes = System.Text.Encoding.Default.GetBytes(text);
var mem = Marshal.AllocHGlobal(bytes.Length + 1);
Marshal.Copy(bytes, 0, mem, bytes.Length);
bytes[0] = 0;
Marshal.Copy(bytes, 0, (IntPtr)((long)mem + bytes.Length), 1);
return mem;
}
@takezoh
takezoh / ios.resign.sh
Last active October 7, 2015 05:36
ipa 署名書き換え
#!/bin/sh
set -x
input=$1
bundle_identifier=$2
provision=$3
codesign="$4"
entitlements=$5
output=`basename ${input%.*}`.ipa
@takezoh
takezoh / xcode.entitlements.format.plist
Last active September 29, 2015 05:48
Xcode entitlements フォーマット
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>application-identifier</key>
<string>$(TEAM_ID).$(BUNDLE_IDENTIFIER)</string>
<key>com.apple.developer.team-identifier</key>
<string>$(TEAM_ID)</string>
<key>get-task-allow</key>
<false/>