If your project have more and more modules and source code, the build will be the nightmare, it will take more than 10 mins to build, for release build, it will take even more time, so we can use the …
DigitalOcean nameserver doesn’t work
cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details
… Issues on M1 Max MacBook Pro
Install Rosetta
This tool will help to run the Intel based Application on M1, and help to do some transformation.
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
Reference
- https://support.apple.com/en-us/HT211861
- https://en.wikipedia.org/wiki/Rosetta_(software)
- https://machow2.com/rosetta-mac/
VMware Fusion for M1
VMware has the preview version
- https://customerconnect.vmware.com/downloads/get-download?downloadGroup=FUS-PUBTP-22H2
- https://communities.vmware.com/t5/Fusion-Tech-Preview-22H2/ct-p/3022
Install Linux on MacBook Pro 2011
Can’t create symlink on fat32
Failed to create symlink to vmlinuz-5.4.0-42-generic: Operation not permitted at /usr/bin/linux-update-symlinks line 64
Disable do_symlinks in /etc/kernel-img.conf
cat /etc/kernel-img.conf
# Kernel Image management overrides
# See kernel-img.conf(5) for details
do_symlinks = no
do_bootloader = no
… Install Mac OS X On legacy MacBook Pro 2011
After I click the “Upgrade” in the old MacBook Pro 2011, High Sierra, after upgrade for a while, then I saw the blue screen, waiting for a long time, it’s still show the blue screen.
Try force reboot, with “Option” …
Build the fancy iTerm2
Install iTerm2
Before to build the fancy Terminal, it need to install the iTerm first.
- https://iterm2.com/index.html
The config file will be ~/.zshrc, so for the themes and plugins, need to update this config file accordingly.
Install oh my zsh
- https://github.com/ohmyzsh/ohmyzsh
Time Machine备份
知道苹果有这个东西,但一直没用过。最近要换新电脑,想到了Time Machine,想着应该能够无缝迁移吧。
在NAS上开了一个共享空间,打开了afp设置,同一个网络下,自动就搜到了,然后就开始了漫长的备份过程。,
发现了一些问题,体验并不那么好
- 第一是慢,是真的慢,备份了好几次都没有一次成功
- 因为上班有时要连VPN,有时要切有线/无线,断了之后,又重新开始计算,体验太糟糕
- 一次到了98%, 时间显示7分钟,但是等了好长时间还是显示7分钟,时间估算太差
- 每次断了,重新计算都需要等很的时间,进度也是莫名其妙
- 空间已经占了1T+,但依旧还没有备份完成
网上搜到几个密令
1. sudo sysctl debug.lowpri_throttle_enabled=0
2. sudo fs_usage backupd
[1]说是可以解除CPU/IO限制,可以全速备份
[2]可以看到当前的备份状态
如果需要恢复限制,只需要把0->1
sudo sysctl debug.lowpri_throttle_enabled=1
早点没有看到这个命令,要不可以省很多时间吧。
当然除了用Time Machine备份,我也使用了传统的备份方式
- 1. 单独压缩需要备份的目录
- 2. NFS/SMB挂载远程目录
- 3. cp file.zip /remote/path
实际使用发现
- 启用压缩能够节省很多时间,可能是小文件比较多,压缩需要一点时间,但cp速度可以快太多,比直接cp快很多
- 使用Mac Find
Script for clean the duplicate files for DSM
2020年已经过去大半了,更新一下博客,刷一下存在感。
去年收了一个暴风影音播客云二期,安装了破解版的黑群晖。每三个月更新一次Let’s Encrypt证书。
但它的Android客户端很奇怪,每次更新证书之后就无法再登录了,需要把App缓存清掉,重新登录,导致的后果就是需要重新设置备份文件目录。然后就每次重新开始备份手机上的视频照片,关键不是增量的,需要全部重新备份。
ssh进入系统后就可以看到重复的文件,文件名加了后缀_1, 例如 VID_20200913_170932_1.mp4, 文件太多超过2W个, 不能手动去删除,于是顺手就写了一个脚本去自动删除。
原理很简单,先找到那些不含_1后缀的文件,然后查看是否存在_1后缀的文件,文件存在的话就直接删掉,310G变到202G了,清理了100G+的空间。
#!/bin/sh
count=0
remove=0
for file in `ls|grep -v "_1\." `
do
((count++))
#echo -n "${count} "
name=`echo ${file}|cut -d "." -f1`
ext=`echo ${file}|cut -d "." -f2`
dup_file=${name}_1.${ext}
echo -n "total:${count},
… Auto Sync Branch Bash Script
Don’t want to wast time to repeat the branch merge actions, like [A][B][C], so I create the bash script to run it automatically.
Script for auto sync/merge the code from branch [A] to [B] with just one …
Android bypass SSL Pinning
很多Android App现在出于安全考虑都会加上SSL Pinning,有时在Charles Debug过程中会不是太方便,当然可以加一个设置一键关掉这个功能。
最近刚好看了一些关于Frida的资料,发现这个东西用来做代码注入很方便,而且平台通吃,Android/iOS/Linux/Mac。
找到下面这个JavaScript脚本,可以在不侵入原Apk的情况下,去掉SSL Pinning, 通过Charles启用SSL Proxy,在手机设置好Charle代理,直接明文抓到所有请求。
Java.perform(function() {
var array_list = Java.use("java.util.ArrayList");
var ApiClient = Java.use('com.android.org.conscrypt.TrustManagerImpl');
ApiClient.checkTrustedRecursive.implementation = function(a1, a2, a3, a4, a5, a6) {
// console.log('Bypassing SSL Pinning');
var k = array_list.$new();
return k;
}
},
…