2017-11-10

How to use different gateways by IP address on Linux and Mac

on Linux
$ sudo route add -net 192.168.0.0 netmask 255.255.0.0 gw 192.168.0.1
$ sudo route add -net 192.168.1.0 netmask 255.255.0.0 gw 192.168.0.254
$ sudo route add -net 192.168.0.0 netmask 255.255.0.0 dev eth0
$ sudo route add -net 192.168.1.0 netmask 255.255.0.0 dev eth1
$ sudo route add -net 192.168.0.0/16 gw 192.168.0.1
$ sudo route add -net 192.168.1.0/16 gw 192.168.0.254
$ sudo route add -net 192.168.0.0/16 dev eth0
$ sudo route add -net 192.168.1.0/16 dev eth1
on Mac
$ sudo route -n add -net 192.168.0.0 -netmask 255.255.0.0 192.168.0.1
$ sudo route -n add -net 192.168.1.0 -netmask 255.255.0.0 192.168.0.254
$ sudo route -n add -net 192.168.0.0/16 192.168.0.1
$ sudo route -n add -net 192.168.1.0/16 192.168.0.254

2017-11-09

[MAC] convert png to icns with terminal

Use sips to convert png to icns
$ sips
sips 10.4.4 - scriptable image processing system.

This tool is used to query or modify raster image files and ColorSync ICC profiles.
Its functionality can also be used through the "Image Events" AppleScript suite.
Try 'sips --help' or 'sips --helpProperties' for help using this tool

Command
$ sips -s format icns input.png --out output.icns

[MAC] SOMETHING ON DEVICES can't be opened because the original item can't be found

"Cloud" can't be opened because the original item can't be found. Cloud is not an external device.



Follow 3 steps to resolve.
1. Relaunch Finder

  • Option+Right click -> Select Relaunch
  • or open terminal then run "killall Finder"


2. Force quit Finder

  • Apple menu -> Force Quit Finder -> Select Finder -> Click Relaunch
  • or Option+Command+Escape -> Select Finder -> Click Relaunch

3. Logout then Login again. Now no more Cloud.