Showing posts with label Mac OS X. Show all posts
Showing posts with label Mac OS X. Show all posts

Thursday, July 16, 2020

How to re-install macos high Sierra

Sometimes, you just want to backup stuff in your old MacOs High Sierra and start over.

You saved all needed files on the google drive and ready for a new start.

Here is the steps to follow.


  1. shut down the laptop
  2. when the laptop start, press CMD + R during power up
  3. Once get into the restore mode, select Disk utilities and click continue 
  4. In the next screen select a disk images under "Disk Images" on the left, then click erase at the top.
  5. Once seeing "Erase process is complete, click Done to continue", just click Done
  6. Continue to do it until all the disk images under "Disk Images" are gone.
  7. Now select "Macintosh HD" under Internal on the left, the blue bar should show mostly free space. 
  8. We are done erasing old MacOS, it is time to start new.
  9. close Disk utilities window, return to restore mode main window.
  10. select "Reinstall MacOS"
  11. In the next window, you will notice the wifi connection is also grey out. Click the wifi icon and put in the wifi id and password.
  12. click continue, the wizard will connect to apple server in the cloud and guide you through exiting process of creating a new macOS, sit back and enjoy. (Don't forget to download the saved files from google drive once finish.)

Tuesday, March 26, 2019

2 shortcuts that saves time

In finder window, the following shortcut will allow you to go to a directory by typing a path
command + shift + g

In eclipse, the following shortcut will allow you to search a class's methods by typing the name
command + o





Thursday, January 24, 2019

svn to git migration

Migrating svn to git needs some plan. There is a period, when the new git repo is created but the developers are continue to commit to the old svn repo.

Bitbucket provided a tool called svn-migration-scripts.jar to make the process easy. Down load the jar file and put under home directory ~/.

5 steps migration.


step 1. create a case-insensitive file-system image. 

If you are using linux such as redhat, ubuntu, your system already case-sensitive. If you are using mac os X, your system is using case-insensitive file-system. Run the following command to tell:

java -jar ~/svn-migration-scripts.jar verify

If the output looks like this, you then need to create a image.
"You appear to be running on a case-insensitive file-system. This is unsupported, and can result in data loss."

java -jar ~/svn-migration-scripts.jar create-disk-image 5 GitMigration

once the directory is created, cd there

cd ~/GitMigration

step 2. Extract author information

java -jar ~/svn-migration-scripts.jar authors https://svn.example.com > authors.txt

modify the emails in authors.txt

step 3. clone the svn to git repo

if your svn don't have a trunk, branch, tag lay out, use the following command.
git svn clone -authors-file=authors.txt https://svn.yoursvnrepo.com/YourSvnProj YourSvnProjAsGit

otherwise, you can specify the location of your trunk, branches, tag, use the following command instead
git svn clone --trunk=/trunk --branches=/branches --branches=/bugfixes --tags=/tags --authors-file=authors.txt https://svn.yoursvnrepo.com/YourSvnProj YourSvnProjAsGit

now clean the created project.
java -Dfile.encoding=utf-8 -jar ~/svn-migration-scripts.jar clean-git --force

step 4. upload to git repo

Once you created a new git repo in bitbucket, you can push your local repo to the remote repo.

git remote add origin https://<user>@bitbucket.org/<user>/<repo>.git
git push -u origin --all
git push --tags

step 5. start to use git repo

now your coworker can start to clone the git repo and work on it.
git clone https://<user>@bitbucket.org/<user>/<project>.git <destination>

for the users that are still committing to the old svn, use the following command to synchronize

git config svn.authorsfile <path-to-authors-file>
git svn fetch
java -Dfile.encoding=utf-8 -jar ~/svn-migration-scripts.jar sync-rebase
java -Dfile.encoding=utf-8 -jar ~/svn-migration-scripts.jar clean-git --force

Thursday, January 3, 2019

slack short cuts and commands

Slack is a useful communication tool. You can have direct chat with a contact, host a group chat, open a channel for topic discussion. It can also be integrated with other tools/apps such as zoom, splunk, jira, ssh, bitbucket, etc, allowing you to host video conference, share screen, share files, run reports etc.

There are magic in slack realm, here are the spell syntax:

Command + / list all the keyboad shortcuts for Slack.


For example:

  • command + [    previous channel or direct message window visited.
  • command + ]    next channel or direct message window visited
  • shift + enter will create a new line in your message
  • command + U will upload a file
  • command + shift + enter will add a new code snippets
  • command + +    will zoom in
  • command + -     will zoom out


/ will list the slack apps you can invoke. 


For example:

  • /zoom                 will send a zoom meeting to your contacts
  • /giphy words      will send a cool image relevant to the word to the chat window
  • /poll "Poll question?" "Option1" "Option2"       will create a poll in your chat window

Thursday, December 6, 2018

command + shift + G

command + shift + G is a handy shortcut.
In eclipse IDE, it means search the reference of a method in workspace, which is similar to Control + Option + H.

In mac os x finder, it means go to directory.

A useful usage scenario is as follows:

You look up a java method's references in workspace by typing command + shift + G, then  find an interesting class. You want to share the file to your coworker. So you right click the file, select properties, find the path in location, copy the path.

You then click finder icon or type command + space to open spotlight then type finder to open the finder.

Next you type command + shift + G to invoke "go to directory" UI, then paste the path and type enter. The finder will land on the file you want to send.

You then hightlight the file then drag it into the slack window to share it.

Tuesday, November 6, 2018

7 useful mac os x command line tools

Mac OS X has Darwin Unix like os. There are command line tools you can use in the console.

1. brew is a command to install other command line tools for mac os x.
To install brew and add the brew binary into the PATH, run the following commands in the console.


mkdir homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew;

echo export PATH=`pwd`/homebrew/bin:'$PATH' >> ~/.bashrc;
source ~/.bashrc;
which brew;

The last command "which brew;" should give the full path to brew binary file.

Now you have brew command available, you can install other command line tools easily.

2. pigz is a tool that is gzip equivalent but runs faster by exploiting parallel computing. pigz is useful when you need to unzip contents with gzip or zlib format. For example, you rabbitmq messages might be zlib compressed, then base64 encoded. Your decoding commands might looks funny:
base64 -D input.txt | pigz -d -z -c

To install pigz, issue the following command:
brew install pigz

3. apache bench (ab) is a command line tool that allows you to bench mark web sites. The most useful flag is -c, which allows you to specify the number of concurrent http requests sent to the host each time.
For example:

ab -n 100000 -c 10 -t 30 http://xyzcode.blogspot.com/

the above commands send total 10000 requests to xyzcode.blogspot.com, each time, 10 concurrent requests are sent.

ab is installed by default on mac os x, type which ab to check out. In case it is missing, you can install it with command:
brew install ab

4. pybot is a command line tool that automate stuff like ssh, web browsing etc. It is equivalent to have a robot to type the keyboard and read the screen then act upon it for you.

To install pybot, issue the following command:
brew install robot-framework

Since brew also installed python's package management tool, you can also use pip to install pybot:
pip install robotframework

5. in case pybot is an overkill for you, you can use expect command to automate ssh chat with remote hosts like a robot. Expect commands expect input, then send the response without any user interaction.
expect script is installed by default, check the installation path with
which expect;

6. zgrep is a better tool than grep.
zgrep allows you to grep content in zip files and normal files. It will be useful to search something in current log and backup logs.
The flexible syntax really compliments your searching strategy. So if you know the log will looks like

2018-11-07 16:42:25-05 HostNameppp Sophos Installer[72881]: [SGCCDFSBroker.m:306] Feedback json file was successfully uploaded (status code: 201).

Your searching strategy could be:
zgrep -i 'Sophos.*json.*successful' /var/log/install.log

each .* separated string became a filter string, so that you can narrow down the search.

You can use or syntax like:
zgrep -i 'Sophos.*json.*successful' /var/log/install.log | grep --color '72881\|72889'

zgrep is installed by default
which zgrep; will give you the installation location.

7. mysql is a command line tool to query mysql database. It allows you scripting mysql queries. You can pipe the result into zgrep to search relevant information.

mysql --host mysql.local -uuser -ppass -e 'select * from ct_prov.Student\G'

to install mysql command line tool
brew install mysql




Wednesday, October 31, 2018

7 tips for text edit efficiency

1. Inside chrome, use option + command + left to move tab by tab from left to right, use option + command + right to move tab by tab from right to left.

2. Inside chrome, right click then click inspect, then click network. Refresh the page to view the page loading process.

3. install chrome tools to handle json, xml etc.
jsonEditer to tidy and modify json string
https://chrome.google.com/webstore/search/jsonEdit?hl=en

ooxml tool to edit and compare xml files
https://chrome.google.com/webstore/detail/ooxml-tools/bjmmjfdegplhkefakjkccocjanekbapn?hl=en

4. install diffmerger to compare files side by side
https://sourcegear.com/diffmerge/downloads.php

5. use --color option to highlight text (good for your eye), use --text option to avoid searching missing in zip files with special characters.
>zgrep KEY --color --text demoClient.key
-----BEGIN RSA PRIVATE KEY-----
-----END RSA PRIVATE KEY-----

6. In xterm2, if you get a huge file which can not be displayed on one screen, click Session -> Edit Session -> Terminal -> then modify scroll back lines to a bigger number.
7. In xterm2, if you want to view several terminals side by side, type command + D to split horizontally, click command + shift + D to split vertically, then type command + shift + i to type in all the terminals. Type command + shift + i again to negate the effect.

Tuesday, October 9, 2018

tools for handling multiple ssh on mac os x

If you ever worked in cooperate environment or be the network administrator, you sometimes need to login many servers and check stuff simultaneously.

On windows, you can use putty or smart putty to handle multiple ssh connections.

Here are some tools for mac os x equivalent.

csshx

installation:

brew install csshx

usage:

csshx --login username host1 host2 host3 host4

xterm

installation:

download the mac version from the xterm website www.iterm2.com 

usage:

add a connection profiles:

click Profiles -> Open Profiles... -> Edit Profiles -> click the + sign to add a list of hostnames and ip addresses you would like to connect to -> when creating a host record, select command radio button then type in ssh command.



open multiple profiles simultaneously in tabs:

click Profiles -> Open Profiles... -> use shift or control key to hightlight a list of hosts you want to connect to -> click New Tab
The highlighted hosts will be connected and open in tabs.

send commands to multiple tabs:

click Shell -> Broadcast Input -> Broadcast Input to All Panels in All Tabs



Sunday, September 2, 2018

how to setup ASUS HOME SERVER with mac os x

This is a small trick but will be handy if you need to access the ASUS HOME SERVER with system other than windows. The menu asked the user to install an windows application in order to access the server. However, notice the ASUS HOME SERVER are actually a reconfigured windows server 2003 with IIS server 6 up running. You can login it from you LAN with microsoft remote desktop.

Download and install microsoft remote desktop, configure the connection. You can find the ASUS HOME SERVER's LAN ip from your gateway router. The server generally don't response to LAN broadcast.

connect to windows server
connect to windows server


Double click the remote desktop icon to login, when ask for the administrator password, put the one you used to setup the server at the first place.

Once logged in, the windows home server console application is right there on the desktop, double click it, then you can configure the server as if you installed a windows access app. You will feel happy because this is actually a IIS server machine with windows server 2003 functionalities.

windows home server console
windows home server console

7 steps to allow you access your mac os x from internet

You can ssh into your home mac computer while traveling. There are a few steps to do:

step 1, go to system preferences, check sharing, check remote login. Only allow the unprivileged user to remote login, remove admin from the allowed list.

remote login enable
remote login enable


step 2. go to system preferences -> users & groups select the user you need to remote access the computer, change the password to be a very strong one.

step 3. if your firewall is blocking port 22, enable it. Go to system preferences -> Security and Privacy -> Firewall Options.

step 4. schedule wake up, if your computer go to sleep you won't be able to ssh into it. Go to system preferences -> Energy saver -> Schedule



schedule wakeup
schedule wakeup


step 5.  test remote login from LAN address, ssh <user>@<localIp>.

step 6. login your gateway router, add a port forwarding rule, forward port 22 to the ip address of your computer.

port forwarding
port forwarding


step 7. test remote login from internet address. The internet address can be found from gateway router.

You can disable password login and only allow certificate based login, but the above 7 steps should be able get your WAN access goal reached.

Sunday, August 26, 2018

7 mac os x shortcuts combo that save your time

Replacing a few clicks with a keyboard shortcuts seems to be trivial, but the time they save adds up. If you are a computer professional, using shortcuts means you are running at a faster cycle. Here are 7 mac os x shortcuts combos that save tons of time.


  1. Browsing shortcuts combo. When you are browsing websites using a browser, you press command + N to open a new window, then you regret, so you press command + W to close it. You press command + T to open a new search tab instead. You suddenly want to look up something in your local file system. You press command + O to open your Finder. You click a file, press command + I to get detailed information about the file, including the url the file is downloaded from. You are happy about the information, so you command + W to close the information window. Then, you press command + T to open a new finder tab. Here you want to open an document, so you type command + shift + O to switch to Document folder, then you click open a pdf file. Now you want to compare something in the pdf with a webpage, so you press command + tab to switch back and forth between your browser and the pdf viewer.
  2. Configuration shortcuts combo. You suddenly feels boring and want to change every mac os x default settings. Good idea, lets start with the browser window. You press command + "," to open the browser configuration no matter it is chrome, safari or firefox. You click advanced, take a look at your certificates -- suddenly wants to check if your firewall is on. So you press command + O followed by command + shift + U to open the utility folder in Finder. Then you click open the System information application, then verified that the firewall was on. So you regain your happiness and decided to turn the display brighter. The brightness adjusting key is at the top of the keyboard, you can just press it. However, you are very picky, you want more control from the system preference. So you press option + F2 to open the build in display panel in system preference and changed a few thing. How about sound? No problem, press option + F11 opened the Sound panel. You feels the power, so you want to go deeper. You press command + space to open spotlight and type "console" then hit enter. In the console window, you saw the log flows like a creek but there is no error and warning. So you are happier and want to open a terminal, you press command + space to open spotlight and type "terminal" then hit enter. In the terminal, you did your check and changes. There is only one problem -- you just opened too many configurations, its time to close them. 
  3. Closing shortcuts combo. You press F3 the mission control to display all the applications, you then press F3 again to restore the view. Too much stuff, so you press command + F3 to take a look at your clear desktop, draw a deep breath then press command + F3 to bring back the mess. Let's start from Finder windows. You press command + H to bring all the finder windows to the front, then press command + option + W to close them all. You press command + tab to navigate through the applications you have opened. Then you close them with command + W. In case you just want to check how many windows are open for a particular application, you can press control + down arrow to view them. Notice command + W only close active windows for an application, to quit an application, press command + Q.
  4. Reopening shortcuts combo. In case an application is minimized with command + M, you can maximize it with the following shortcuts combo: first select the application by pressing command + tab, then press option + command then release option key. The same trick can be used to reopen previously closed but not quit applications. To reopen a quit application, you press command + space to open spotlight, then type the application name.
  5. Navigating shortcuts combo. You have opened many applications, you press command + tab to navigate through them and land on browser app. Your browser opened many tabs, you press control + tab to navigate through them and stop at a page. The page has tons of contents, so you press option + down arrow and option + up arrow to scroll the contents page by page. The contents is long and you loose patient, so you press command + down arrow to scroll to the end of page, nothing there, so you press command + up arrow to scroll back to the top. Eye balling doesn't work, no worry, you can press command + F to open a finder dialog. Then type in the search string then hit enter. The matches are highlighted, you press command + G and command + shift + G to move your cursor to the next and previous match.
  6. Selecting shortcuts combo. Now you find what you are looking for, you want to copy those text. The shift control option command and arrow key combinations will let you look like a selecting pro. Try these out. shift + left selects one character at left, shift + option + left selects one word at left, shift + control + left selects everything at the left. I don't have to mention how right key behave, right? The up and down keys behave a little bit different. shift + up selects one line above, shift + option + up selects to the beginning of the current paragraph, shift + command + shift selects to the beginning of the text. I don't have to mention how down key behave, right?
  7. Zooming shortcuts combo. It will be nice to zoom in when you are trying to show something to your co-workers. Press command + "=" increases the text size, press command + "-" decreases the text size. Press command + shift + "=" zooms in, press command + shift + "-" zooms out.

Tuesday, August 7, 2018

7 eclipse debugging tips you should know

You may already know that you can set a breakpoint in eclipse for your java code, then have the program stop at the breakpoint in debug perspective, so that you can inspect the variable values or step through the code line by line. These are the basic usage of eclipse debugger. The following 7 tips will allow you do eclipse debug like a pro.

1. Change variable value
When a breakpoint is hit, you can right click a variable value then select "Change Value...".

2. Use breakpoint view
click Window -> Show View -> Breakpoint
In this tab, you can select/deselect breakpoints. High light one of the break point, you can set conditional match such as exceeding a certain hit count or matching a particular value.
For multi-threading program, "suspend VM" option allows you to exam the stack of the other threads. You can shift from one thread's stack to another thread's by clicking the thread name.

3. Use display view
click Window -> Show View -> Display
In this tab, you can write a few lines of code, highlight these code you want to run, then click the little triangle at the upper right corner to execute the code in the context of the breakpoint.

4. be able to inspecting code in project and depended jars.
If you are using maven project, install m2e plugin, then configure it to download both the source files and javadoc by going into Window > Preferences > Maven and checking the "Download Artifact Sources" and "Download Artifact JavaDoc" options.


You can search a class in project and depended jars with shortcut Command + Shift + T (mac) or Control + Shift + T (windows).
You can search a string in the workspace with shortcut Control + H.
You can search call hierarchy with shortcut Control + Command + H.

5. Remote debug
When you are trouble-shooting an application running in a remote machine. you need two piece of information: hostname or IP, the debugger port.
If you are not sure what port is the debugger port, you can login the hostname, then issue command
"netstat -nulpt | grep java " and see which ports the java application is listen to, then try these ports one by one.



6. set up tomcat to run local.
If your application produces a war file which can be deployed into tomcat, you can setup eclipse (J2EE) to integrate with tomcat and run your application local, then you can debug the code. To do so, download and unzip tomcat, in eclipse
Preference -> Server -> Runtime Environment
Click Add -> apache -> select the version matching the apache server you downloaded
Click next, browse to the directory of your downloaded apache server.
Click finish


Now you can run your j2EE project local by select Run -> Run As -> Run on Server
Click choose an existing server, then select your apache server from the server list.
Now tomcat will run your project's war file as a web container. Even with apache server configured, you program still need Arguments to be set correctly.

7. Use jrebel for quick deployment. JRebel fast tracks Java application development by skipping the time consuming build and redeploy steps in the development process.

Tuesday, July 10, 2018

7 Mac OS X tools for web application trouble-shooting

Web applications use server-client pair to communicate via open sockets. In order to trouble-shooting them, we sometimes need to trace requests through computer system. We need to post request to web service end-point and analyze the returned xml, json etc. We sometimes need to check the server logs, databases, splunk, etc. Here are some tools to make these job easy.

TextMate


The software TextMate allows you to format text so that they are easy to read. Json, for example, is intended to be compact, so chances are the json string passed in web application request/response have no space or line break. In order to review the content, you need to format the compact string so that space and line break will be inserted for easy reading. You can copy the json string from a log and paste it into textmate then select json format to get an easy to read version. You can do the same for compact xml string, html string etc.

PostMan


Whenever you need to test rest services, you can use curl commands. However, with PostMan, your life will be easier. This tool allows you to easily construct the request body, set headers, credentials, etc. You can group and save various rest service requests for later use. The request and response are formatted too, sweet.

Iterm


Terminal is a basic scripting environment in mac os x, Iterm is a much better alternative. You can do many cool things such as sending commands to multiple tabs, script login session, split windows, highlight text to copy to clipboard, use many shot-cuts, etc.

Mysql Workbench



This tool manages your mysql database connections. You can browse schema, run query, check result, copy results, export results, analyze performance etc.

Oracle SQL Developer


a free tool to mange oracle database connections. UI provides many features such as browsing schema, view single record, syntax highlighting etc.

Slack


A computer system is developed by a team, so trouble-shooting often involves a team of engineers. Slack allows you to chat with partner, host online meetings across the internet. A meeting channel recorded the trouble-shooting history for later reference.

Notes


Last but not least, organize your thoughts before and after communication. Mac OS X notes is the handy tool for you.

Thursday, July 5, 2018

7 mac os x short cuts for trouble-shooting


When your application run into trouble such as no response, you would like to figure out why or want to quickly move on. Here is some Mac OS X short-cuts that makes your life much easier.

  1. Do you want to quickly switch among different programs without clicking around? Command + Tab, Command + Shift + Tab will list all the open programs and allow you select the high-lighted one. 
  2. Have you ever try to open a program by opening the finder, then navigate to the application folder, then click open a program? There is a much faster way. Command + Space, then type the program name.
  3. windows user might wonder what is the Control + Alt + Delete equivalent in mac os x, the shot-cut is Command + Alt + ESC, use this force quit shortcut, if long clicking a program then select Quit don't work.
  4. Do you want to compare files side by side in shell window? Command + D split a terminal window into 2.
  5. Sometimes, you entered a long command line in terminal, then realized you want to modify the first a few characters. Instead of press left for 10 seconds, you can press fn + left to directly move to the front of the command. The fn + right move your cursor to the end of the command.
  6. Command + T will open a new tab in terminal.
  7. screen shot in mac os x: Command + Shift + 3 takes a full screen screenshot and Command + Shift + 4 takes a screenshot for a select area.

Thursday, March 22, 2018

Enable firewall logs on MacOs High Sierra

Mac OS X v10.5.1 and later include an application firewall you can use to control connections on a per-application basis (rather than a per-port basis). This makes it easier to gain the benefits of firewall protection, and helps prevent undesirable apps from taking control of network ports open for legitimate apps.

application firewall
application firewall

To enable it, go to System Preferences -> Security & Privacy -> Firewall
You can choose a few firewall options. The most secure or restricted option is block all incoming connections. With this option selected, hackers on the wild can not connect to your computer, they can not even discover your existance.

However, if you have malware already installed on your computer, such as a keylogger, Adware, backdoor, (in practice, this kind of malware is rare on Mac OS X, but there is no guarantee the landscape won't change in the future), even blocking all incoming connections won't help here. The keylogger/adware/backdoor will initialize an outcoming connection to give away your sensitive data, which the firewall won't block. These out bounding traffic are generally small, easy to hide in normal traffic such as your web browsing traffic.

Installing an expensive IDS/IPS/UTM device in your home network is the ultimate solution. However, if you have some experience with stateful firewall, you can detect the suspicious outbound traffic by reviewing and searching firewall logs on both the end-point and the gateway (some oddness can easily stand out, like mid-night traffic.). IDS/IPS/UTM in essence are collection of searching and matching actions in automation.

By default, the firewall log on Mac Os High Sierra is empty, this is because even after you turns on firewall which enables log, the firewall log option is throttled. You have to change the default settings from throttle to detail or brief.

/usr/libexec/ApplicationFirewall/socketfilterfw --getloggingopt

sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setloggingopt detail

Once the default settings are changed, you can view the firewall logs either from command line

tail -F /var/log/appfirewall.log

application firewall log
application firewall log

or from Finder -> Application -> Utilities -> Console.

Wednesday, March 21, 2018

ifconfig output on MacOs High Sierra

In a typical Mac OS X, type ifconfig in command line will give a long list of interfaces.

network>ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
inet 127.0.0.1 netmask 0xff000000 
inet6 ::1 prefixlen 128 
inet6 xxx prefixlen 64 scopeid 0x1 
nd6 options=201<PERFORMNUD,DAD>
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
EHC29: flags=0<> mtu 0
EHC26: flags=0<> mtu 0
XHC20: flags=0<> mtu 0
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=10b<RXCSUM,TXCSUM,VLAN_HWTAGGING,AV>
ether xxx 
nd6 options=201<PERFORMNUD,DAD>
media: autoselect (none)
status: inactive
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether xxx 
inet6 xxx prefixlen 64 secured scopeid 0x8 
inet xxx netmask 0xffffff00 broadcast 192.168.2.255
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: active
en2: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
options=60<TSO4,TSO6>
ether xxx 
media: autoselect <full-duplex>
status: inactive
fw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 4078
lladdr xxx 
nd6 options=201<PERFORMNUD,DAD>
media: autoselect <full-duplex>
status: inactive
p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304
ether xxx 
media: autoselect
status: inactive
awdl0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1484
ether xxx 
inet6 xxx%awdl0 prefixlen 64 scopeid 0xc 
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: active
bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=63<RXCSUM,TXCSUM,TSO4,TSO6>
ether xxx 
Configuration:
id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
ipfilter disabled flags 0x2
member: en2 flags=3<LEARNING,DISCOVER>
        ifmaxaddr 0 port 9 priority 0 path cost 0
nd6 options=201<PERFORMNUD,DAD>
media: <unknown type>
status: inactive
utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000
inet6 xxx%utun0 prefixlen 64 scopeid 0xe 
nd6 options=201<PERFORMNUD,DAD>
network>


The following are the explanations about these interfaces:


lo0 is the loopback device, which is used for entirely internal communication such as between two applications running on localhost.

gif0 The gif interface is a generic tunnelling device for IPv4 and IPv6. It can tunnel IPv[46] traffic over IPv[46]. Therefore, there can be four possible configurations. The behavior of gif is mainly based on RFC2893 IPv6-over-IPv4 configured tunnel. It is the mac os X default interface, not a security concern.

6to4 interfaces
6to4 interfaces

stf0 is SixToFour interface. 6to4 is an Internet transition mechanism for migrating from Internet Protocol version 4 (IPv4) to version 6 (IPv6), a system that allows IPv6 packets to be transmitted over an IPv4 network (generally the IPv4 Internet) without the need to configure explicit tunnels. Special relay servers are also in place that allow 6to4 networks to communicate with native IPv6 networks. It is a default interface, not a security concern.

EHC29
EHC26
XHC20
With macOS High Sierra you can use Wireshark to capture USB traffic.  The interface needs to be manually brought up/down to enable/disable packet capture for the specific controller via ifconfig. The capture interfaces are named based on the underlying controller type followed by the bus number:

$ ifconfig
EHC26: flags=0<> mtu 0
XHC20: flags=0<> mtu 0
EHC29: flags=0<> mtu 0

$ ioreg -w0 -rc AppleUSBHostController
+-o XHC1@1400
+-o EHC2@1a00
+-o EHC1@1d00

The format above is @ where the most significant byte of the location is the bus number.  For example, if the device your interested in is connected to the XHCI controller XHC1@1400 then you would enable packet capture via "sudo ifconfig XHC20 up” and disable via “sudo ifconfig XHC20
down”.  Once the interface is up then Wireshark will be able to capture/decode/filter USB traffic for that controller.
These interfaces are MacOs High Sierra default, not security concern.

en0

en1
en2
physical network interfaces. Typically, one of them is the Ethernet interface, one of them is the Airport wifi interface, one of them is the bluetooth interface.

Firewire port
Firewire port

fw0 is networking over firewire. You can connect a Firewire cable between two Macs, and OS X can use that cable as a network connection.

Mac thunderbolt port
Mac thunderbolt port

bridge0 is thunderbolt bridge. You can connect two Thunderbolt-equipped Mac computers using a Thunderbolt cable, then use internet protocol to communicate between the computers.

PPP (PPPSerial)
PPP (PPPSerial)

p2p0 peer to peer serial connection interfaces. If your MacOs have been connected to arduino through USB port, you will have this entry.

awdl0 AWDL (Apple Wireless Direct Link) is a low latency/high speed WiFi peer-to peer-connection Apple uses for everywhere you’d expect: AirDrop, GameKit (which also uses Bluetooth), AirPlay, and perhaps elsewhere. It works using its own dedicated network interface, typically “awdl0". By having multiple interfaces, Apple is able to have your standard WiFi connection on en*, while still broadcasting, browsing, and resolving peer to peer connections on awdl0.




oracle VirtualBox
oracle VirtualBox

utun0 it is the tunnel interface. If you have VirtualBox installed, guest operation system in virtualBox will use this interface to communicate with host operation system. TUN (namely network TUNnel) simulates a network layer device and it operates with layer 3 packets like IP packets. TUN is used with routing. Packets sent by an operating system via a TUN device are delivered to a user-space program which attaches itself to the device. A user-space program may also pass packets into a TUN device. In this case the TUN device delivers (or "injects") these packets to the operating-system network stack thus emulating their reception from an external source.

vment* - is used by VMWare Fusion to provide networking to your virtual machines, and there's likely to be one per VM you have set up.

ports and protocols on Mac OS X

mac os x use Darwin unix at the core, which is heavily influenced by BSD. The following is the ports.

network>cat /etc/protocols
#
# Internet protocols
#
# $FreeBSD$
# from: @(#)protocols 5.1 (Berkeley) 4/17/89
#
# See also http://www.iana.org/assignments/protocol-numbers
#
ip 0 IP # internet protocol, pseudo protocol number
#hopopt 0 HOPOPT # hop-by-hop options for ipv6
icmp 1 ICMP # internet control message protocol
igmp 2 IGMP # internet group management protocol
ggp 3 GGP # gateway-gateway protocol
ipencap 4 IP-ENCAP # IP encapsulated in IP (officially ``IP'')
st2 5 ST2 # ST2 datagram mode (RFC 1819) (officially ``ST'')
tcp 6 TCP # transmission control protocol
cbt 7 CBT # CBT, Tony Ballardie <A.Ballardie@cs.ucl.ac.uk>
egp 8 EGP # exterior gateway protocol
igp 9 IGP # any private interior gateway (Cisco: for IGRP)
bbn-rcc 10 BBN-RCC-MON # BBN RCC Monitoring
nvp 11 NVP-II # Network Voice Protocol
pup 12 PUP # PARC universal packet protocol
argus 13 ARGUS # ARGUS
emcon 14 EMCON # EMCON
xnet 15 XNET # Cross Net Debugger
chaos 16 CHAOS # Chaos
udp 17 UDP # user datagram protocol
mux 18 MUX # Multiplexing protocol
dcn 19 DCN-MEAS # DCN Measurement Subsystems
hmp 20 HMP # host monitoring protocol
prm 21 PRM # packet radio measurement protocol
xns-idp 22 XNS-IDP # Xerox NS IDP
trunk-1 23 TRUNK-1 # Trunk-1
trunk-2 24 TRUNK-2 # Trunk-2
leaf-1 25 LEAF-1 # Leaf-1
leaf-2 26 LEAF-2 # Leaf-2
rdp 27 RDP # "reliable datagram" protocol
irtp 28 IRTP # Internet Reliable Transaction Protocol
iso-tp4 29 ISO-TP4 # ISO Transport Protocol Class 4
netblt 30 NETBLT # Bulk Data Transfer Protocol
mfe-nsp 31 MFE-NSP # MFE Network Services Protocol
merit-inp 32 MERIT-INP # MERIT Internodal Protocol
dccp 33 DCCP # Datagram Congestion Control Protocol
3pc 34 3PC # Third Party Connect Protocol
idpr 35 IDPR # Inter-Domain Policy Routing Protocol
xtp 36 XTP # Xpress Tranfer Protocol
ddp 37 DDP # Datagram Delivery Protocol
idpr-cmtp 38 IDPR-CMTP # IDPR Control Message Transport Proto
tp++ 39 TP++ # TP++ Transport Protocol
il 40 IL # IL Transport Protocol
ipv6 41 IPV6 # ipv6
sdrp 42 SDRP # Source Demand Routing Protocol
ipv6-route 43 IPV6-ROUTE # routing header for ipv6
ipv6-frag 44 IPV6-FRAG # fragment header for ipv6
idrp 45 IDRP # Inter-Domain Routing Protocol
rsvp 46 RSVP # Resource ReSerVation Protocol
gre 47 GRE # Generic Routing Encapsulation
dsr 48 DSR # Dynamic Source Routing Protocol
bna 49 BNA # BNA
esp 50 ESP # encapsulating security payload
ah 51 AH # authentication header
i-nlsp 52 I-NLSP # Integrated Net Layer Security TUBA
swipe 53 SWIPE # IP with Encryption
narp 54 NARP # NBMA Address Resolution Protocol
mobile 55 MOBILE # IP Mobility
tlsp 56 TLSP # Transport Layer Security Protocol
skip 57 SKIP # SKIP
ipv6-icmp 58 IPV6-ICMP icmp6 # ICMP for IPv6
ipv6-nonxt 59 IPV6-NONXT # no next header for ipv6
ipv6-opts 60 IPV6-OPTS # destination options for ipv6
# 61 # any host internal protocol
cftp 62 CFTP # CFTP
# 63 # any local network
sat-expak 64 SAT-EXPAK # SATNET and Backroom EXPAK
kryptolan 65 KRYPTOLAN # Kryptolan
rvd 66 RVD # MIT Remote Virtual Disk Protocol
ippc 67 IPPC # Internet Pluribus Packet Core
# 68 # any distributed filesystem
sat-mon 69 SAT-MON # SATNET Monitoring
visa 70 VISA # VISA Protocol
ipcv 71 IPCV # Internet Packet Core Utility
cpnx 72 CPNX # Computer Protocol Network Executive
cphb 73 CPHB # Computer Protocol Heart Beat
wsn 74 WSN # Wang Span Network
pvp 75 PVP # Packet Video Protocol
br-sat-mon 76 BR-SAT-MON # Backroom SATNET Monitoring
sun-nd 77 SUN-ND # SUN ND PROTOCOL-Temporary
wb-mon 78 WB-MON # WIDEBAND Monitoring
wb-expak 79 WB-EXPAK # WIDEBAND EXPAK
iso-ip 80 ISO-IP # ISO Internet Protocol
vmtp 81 VMTP # Versatile Message Transport
secure-vmtp 82 SECURE-VMTP # SECURE-VMTP
vines 83 VINES # VINES
ttp 84 TTP # TTP
#iptm 84 IPTM # Protocol Internet Protocol Traffic
nsfnet-igp 85 NSFNET-IGP # NSFNET-IGP
dgp 86 DGP # Dissimilar Gateway Protocol
tcf 87 TCF # TCF
eigrp 88 EIGRP # Enhanced Interior Routing Protocol (Cisco)
ospf 89 OSPFIGP # Open Shortest Path First IGP
sprite-rpc 90 Sprite-RPC # Sprite RPC Protocol
larp 91 LARP # Locus Address Resolution Protocol
mtp 92 MTP # Multicast Transport Protocol
ax.25 93 AX.25 # AX.25 Frames
ipip 94 IPIP # Yet Another IP encapsulation
micp 95 MICP # Mobile Internetworking Control Pro.
scc-sp 96 SCC-SP # Semaphore Communications Sec. Pro.
etherip 97 ETHERIP # Ethernet-within-IP Encapsulation
encap 98 ENCAP # Yet Another IP encapsulation
# 99 # any private encryption scheme
gmtp 100 GMTP # GMTP
ifmp 101 IFMP # Ipsilon Flow Management Protocol
pnni 102 PNNI # PNNI over IP
pim 103 PIM # Protocol Independent Multicast
aris 104 ARIS # ARIS
scps 105 SCPS # SCPS
qnx 106 QNX # QNX
a/n 107 A/N # Active Networks
ipcomp 108 IPComp # IP Payload Compression Protocol
snp 109 SNP # Sitara Networks Protocol
compaq-peer 110 Compaq-Peer # Compaq Peer Protocol
ipx-in-ip 111 IPX-in-IP # IPX in IP
carp 112 CARP vrrp # Common Address Redundancy Protocol
pgm 113 PGM # PGM Reliable Transport Protocol
# 114 # any 0-hop protocol
l2tp 115 L2TP # Layer Two Tunneling Protocol
ddx 116 DDX # D-II Data Exchange
iatp 117 IATP # Interactive Agent Transfer Protocol
stp 118 STP # Schedule Transfer Protocol
srp 119 SRP # SpectraLink Radio Protocol
uti 120 UTI # UTI
smp 121 SMP # Simple Message Protocol
sm 122 SM # SM
ptp 123 PTP # Performance Transparency Protocol
isis 124 ISIS # ISIS over IPv4
fire 125 FIRE
crtp 126 CRTP # Combat Radio Transport Protocol
crudp 127 CRUDP # Combat Radio User Datagram
sscopmce 128 SSCOPMCE
iplt 129 IPLT
sps 130 SPS # Secure Packet Shield
pipe 131 PIPE # Private IP Encapsulation within IP
sctp 132 SCTP # Stream Control Transmission Protocol
fc 133 FC # Fibre Channel
rsvp-e2e-ignore 134 RSVP-E2E-IGNORE # Aggregation of RSVP for IP reservations
mobility-header 135 Mobility-Header # Mobility Support in IPv6
udplite 136 UDPLite # The UDP-Lite Protocol
mpls-in-ip 137 MPLS-IN-IP # Encapsulating MPLS in IP
manet 138 MANET # MANET Protocols (RFC5498)
hip 139 HIP # Host Identity Protocol (RFC5201)
shim6 140 SHIM6 # Shim6 Protocol (RFC5533)
wesp 141 WESP # Wrapped Encapsulating Security Payload (RFC5840)
rohc 142 ROHC # Robust Header Compression (RFC5858)
# 138-254 # Unassigned
pfsync 240 PFSYNC # PF Synchronization
# 253-254 # Use for experimentation and testing (RFC3692)
# 255 # Reserved
divert 258 DIVERT # Divert pseudo-protocol [non IANA]

network>

MarketAxess

MarketAxess: The Leader in e-Trading for Global Fixed Income MarketAxess Holdings Inc. (MarketAxess) is an international financial technol...