iOS MapBox v10(四)HttpServiceInterface/HttpServiceInterceptorInterface拦截修改网络请求
环境 Mapbox v10.5.0 Xcode 14.3.1 HttpServiceInterface自定义网络请求设置网络请求类MapboxCommon.HttpServiceFactory.setUserDefinedForCustom(HttpServiceInterface) 实现网络请求类MapboxCommon.HttpServiceFactory.getInstance()返回的是自定义请求类,所以不能直接返回网络请求 class CustomHttpServiceInterface:HttpServiceInterface{ public func setInterceptorForInterceptor(_ interceptor: HttpServiceInterceptorInterface?) { } public func setMaxRequestsPerHostForMax(_ max: UInt8) { } ...
iOS MapBox v10(三)iconOffset/iconTranslate/textOffset/textTranslate的区别
环境 Mapbox v10.5.0 Xcode 14.3.1 SymbolLayer参数说明iconOffset 图标和锚点都会偏移,而已还会根据iconSize改变大小,例如iconOffset为[10,20],iconSize为0.5,则实际偏移显示为[5,10] iconTranslate 根据标点位置偏移,锚点不偏移,而且不受iconSize影响 textOffset 图标和锚点都会偏移,偏移单位为em,em即n倍字体高度,如果字体高度为16px,则1em=16px,具体请搜索css em 单位 textTranslate 根据标点位置偏移,锚点不偏移 参考链接 SymbolLayer
iOS MapBox v10(二)修改矢量图形的几种方法
环境 Mapbox v10.5.0 Xcode 14.3.1 基础的图形显示标准的geojson矢量文件 在线生成展示geojson地址 https://geojson.io shape{ "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": {}, "geometry": { "coordinates": [ [ [ 116.4578773269638, 61.068686560065515 ], [ 115.78931543914507, ...
iOS MapBox v10(一) 本地化/无网使用
环境 Mapbox v10.5.0 Xcode 14.3.1 自定义配置文件启动mapbox的默认初始化会调用mapbox://styles/mapbox/streets-v11类似的链接,实际启动后,会通过网络获取在线的json格式的配置文件,我们需要在本地自定义一份配置文件用于初始化,具体参数可以参考Style Specification 这里删除了sprite是定义在线图片,我们不需要在线图片;删除glyphs是定义在线字体,当glyphs在线数据没有加载出来的时候。会导致SymbolLayer图层不会刷新数据。 mapbox.json{ "version": 8, "name":"local-mapbox", "sources": { "raster-tiles-source": { "type": "raster", ...
Nat-VPS动态IP搭建Zerotier-Moon
通过定时任务,不断轮训ip,对比ip是否变更,然后通过脚本更新moon节点文件,实现动态ip搭建moon节点 环境 Debian 11 网络测试 使用前建议使用iperf3测试服务器端口映射是否有问题 服务器iperf3 -s -p 端口 客户端# 测试tcp链接iperf3-darwin -c 服务器ip -b 7M -p 端口# 客户端发udp包,服务器端接收iperf3-darwin -u -c 服务器ip -b 7M -p 端口# 客户端接收,服务器端发udp包iperf3-darwin -u -c 服务器ip -b 7M -p 端口 -R 自定义端口 便于后面脚本截取ip做对比 Zerotier自定义端口 服务器端编辑脚本 通过dns查询获取公网ip(或者curl获取),对比本地配置文件,发现ip变更就更新moon节点文件 #!/bin/bash# 通过dig获取公网ip,先检查截取的是否为ipip=$(dig +short 域名 114.114.114.114 | tail -n 1)#...
Nat VPS自定义端口搭建Zerotier Moon
环境 NAT VPS Ubuntu 22.04 安装安装Zerotiercurl -s https://install.zerotier.com | sudo bash 自定义端口,编辑/var/lib/zerotier-one/local.conf NAT映射的时候,内网和公网的端口需要一样 { "settings": { "primaryPort": 10109 }} 搭建Moon 创建节点文件cd /var/lib/zerotier-one/zerotier-idtool initmoon identity.public >> moon.json 修改文件信息moon.json的"stableEndpoints"信息"stableEndpoints": ["公网IP/端口"] 生成节点文件zerotier-idtool genmoon moon.json 启动mkdir moons.dmv...
Cloudflare设置DDNS
Caddy自建ip查询 配置DNS的A和AAAA的解析 编辑/etc/caddy/Caddyfile ipv4.xxx.com, ipv6.xxx.com { templates respond "{{.RemoteIP}}"} DDNS脚本编辑/root/.cf/cf-ddns.sh #!/bin/bash# CHANGE THESEauth_token="xxx" # found in cloudflare account settingszone_name="xxx.com"record_name="xxx.xxx.com"# MAYBE CHANGE THESEip=$(curl -s...
部署/cppla/ServerStatus探针
开源项目地址 ServerStatus 部署服务器端 安装服务 docker run -d --restart=always --name=serverstatus -v /root/.docker/serverstatus/serverstatus-config.json:/ServerStatus/server/config.json -v /root/.docker/serverstatus/serverstatus-monthtraffic:/usr/share/nginx/html/json -p 127.0.0.1:8080:80 -p 35601:35601 cppla/serverstatus 配置服务器文件,/root/.docker/serverstatus/serverstatus-config.json { "servers": [ { "username": "自定义用户名", ...
shell命令行管理vps
脚本 sshmgr.sh#!/bin/bashconf=/Users/h/Tool/sshmgr.confset sshname=set sshhost=menu() { while read line do if [ "${line:0:1}" == "#" ];then continue fi if [ "${line}z" == "z" ];then continue fi if [ "${line:0:2}" == "--" ];then echo '' continue fi # # 序号 | 显示名称 | IP | 端口 | 用户名 | 密码 | key ...
Scascaleway 自动开机脚本
环境 MACOS 安装brew install scw 创建虚拟机# 登录scw init# 创建服务器scw instance server create type=STARDUST1-S zone=fr-par-1 image=debian_bullseye root-volume=l:10G name=Denian ip=none ipv6=true project-id=你的账号UUID# 查看服务器scw instance server list# 开机scw instance server start 你的机器UUID 开机脚本#!/bin/zshMACHINE_UUID="你的机器UUID"STAR_MACHINE() { scw instance server start "${MACHINE_UUID}"}SEND_NOTIFY(){ echo "成功" }while true; do STATUS=$(scw instance...