Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
XCODE_DEVELOPER_PATH="/Applications/Xcode.app/Contents/Developer"
thin()
{
file=$1
archs=`file $file`
if [[ $archs == *"x86_64"* ]]; then
@DianQK
DianQK / ld_response_file_path
Created May 7, 2021 02:15
使用 @response_file_path 减少命令行传递链接参数数量
// response_file
-demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch arm64 -platform_version macos 11.3.0 11.3 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk -o /Users/yahaha/Desktop/lto-example/foo/build/foo/Build/Products/Release/foo -L/Users/yahaha/Desktop/lto-example/foo/build/foo/Build/Products/Release -filelist /Users/yahaha/Desktop/lto-example/foo/build/foo/Build/Intermediates.noindex/foo.build/Release/foo.build/Objects-normal/arm64/foo.LinkFileList -object_path_lto /Users/yahaha/Desktop/lto-example/foo/build/foo/Build/Intermediates.noindex/foo.build/Release/foo.build/Objects-normal/arm64/foo_lto.o -print_statistics -save-temps -lbar -no_adhoc_codesign -dependency_info /Users/yahaha/Desktop/lto-example/foo/build/foo/Build/Intermediates.noindex/foo.build/Release/foo.build/Objects-normal/arm64/foo_dependency_info.dat -lSystem /Applications/Xcode.app/Content
-------------
1547
===-------------------------------------------------------------------------===
Pass execution timing report
===-------------------------------------------------------------------------===
Total Execution Time: 23.9270 seconds (23.9281 wall clock)
---User Time--- --System Time-- --User+System-- ---Wall Time--- --- Name ---
7.4577 ( 31.5%) 0.0000 ( 0.0%) 7.4577 ( 31.2%) 7.4587 ( 31.2%) Control Flow Optimizer
6.0207 ( 25.4%) 0.0000 ( 0.0%) 6.0207 ( 25.2%) 6.0207 ( 25.2%) Eliminate PHI nodes for register allocation
@DianQK
DianQK / iptables_1.sh
Last active April 17, 2024 15:34
使用基于 tproxy 的 clash 处理外网流量(同时解决在外面访问家里内网问题)
#!/usr/bin/env bash
iptables -t mangle -N DIVERT
iptables -t mangle -A DIVERT -d 100.64.0.0/10 -j RETURN
iptables -t mangle -A DIVERT -d 127.0.0.0/8 -j RETURN
iptables -t mangle -A DIVERT -d 169.254.0.0/16 -j RETURN
iptables -t mangle -A DIVERT -d 192.0.0.0/24 -j RETURN
iptables -t mangle -A DIVERT -d 224.0.0.0/4 -j RETURN
iptables -t mangle -A DIVERT -d 240.0.0.0/4 -j RETURN
iptables -t mangle -A DIVERT -d 255.255.255.255/32 -j RETURN