hw-1

“XXX.app can’t be opened. You should move it to trash.” for flash projector applications on mac os sierra

“XXX.app can’t be opened. You should move it to trash.” for flash projector applications on mac os sierra

This is actually a macOS Gatekeeper issue try these steps:

To resolute Gatekeeper issues on macOS Sierra you might have to partially or completely disable Gatekeeper checks.

1 For a certain application run in Terminal:

1
sudo xattr -rd com.apple.quarantine /Applications/[LockedApp].app

2 To disable checks globally run in Terminal:

1
sudo spctl --master-disable

How to Fix mds_stores Consuming High CPU Usage on Mac

How to Fix mds_stores Consuming High CPU Usage on Mac

1
2
3
4
// Stop Spotlight on Mac
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
// Restart Spotlight on Mac
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

ubuntu Advanced Routing network

ubuntu Advanced Routing network

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
1. forward 10.11.11.0/24  10.12.12.0/24 to  RDS

ip route add default via 10.1.1.1 dev eth1 table RDS
ip rule add from 10.11.11.0/24 table RDS
ip rule add from 10.12.12.0/24 table RDS

ip rule show # all the rule list
ip rule show | grep ASTRAL # only for ASRAL
ip rule show | grep RDS # only for RDS

2 , dst port 22 forward to RDS , dst port 80 forward ASTRAL
iptables -A PREROUTING -t mangle -i eth0 -p tcp --dport 22 -j MARK --set-mark 1
iptables -A PREROUTING -t mangle -i eth0 -p tcp --dport 80 -j MARK --set-mark 2

ip route add default via 10.1.1.1 dev eth1 table RDS # the same like in the first example
ip route add default via 10.8.8.1 dev eth2 table ASTRAL # the same like in the first example
ip rule add from all fwmark 1 table RDS
ip rule add from all fwmark 2 table ASTRAL

refrences

wireshark expression usage

wireshark expression usage

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
ip.addr == 192.168.0.1
ip.addr == 129.111.0.0/16
http.host matches "acme\.(org|com|net)"

http.request.uri == "https://www.wireshark.org/"
udp contains 81:60:03
sip.To contains "a1762"

tcp.port in {80 443 8080}
tcp.port in {443 4430..4434}
tcp.port == 80 || tcp.port == 443 || tcp.port == 8080


http.request.method in {"HEAD" "GET"}
ip.addr in {10.0.0.5 .. 10.0.0.9 192.168.1.1..192.168.1.9}
frame.time_delta in {10 .. 10.5}

make ubuntu startup usb

make ubuntu startup usb

1
2
3
4
5
6
7
8
9
10
hdiutil convert -format UDRW ubuntu-18.04.2-live-server-amd64.iso  -o ubuntu-18.04.2-live-server-amd64.img

diskutil list
diskutil unmountDisk /dev/disk3
sudo dd if=/Volumes/downloads/ubuntu-18.04.2-live-server-amd64.img of=/dev/disk3 bs=1m

sudo qemu-system-x86_64 -hda /dev/disk3

diskutil eject /dev/disk3
sudo dd if=/dev/urandom of=/dev/disk3

How to fix “Bus error 10” after update to Xcode 10.2

How to fix “Bus error 10” after update to Xcode 10.2

1
2
3
4
5
6
7
8
9
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if target.name == 'Cache'
config.build_settings['SWIFT_OPTIMIZATION_LEVEL'] = '-Onone'
end
end
end
end

swift MARK 常用 说明

1
2
3
4
5
6
7
8
9
10
//MARK: - Properties
//MARK: - Getting && Setting
//MARK: - Life Cycle
//MARK: - Event Response
//MARK: - Public Methods
//MARK: - Response Methods
//MARK: - UITableViewDataSource & UITableViewDelegate
//MARK: - Layout
//MARK: - Pravite Methods