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 24, 2018

7 organizations you should know as a spam victim

Spammers are not just annoying, they sometimes turn into criminal. For example, spammers once get enough personal information, they can impose as the victim, then get more personal information from the friends, relatives, etc. Eventually, they might get some victim to give away credit card number, sending money to strangers etc. If you are reading this post, most likely you won't give away sensitive information at the first place. If you do, you can call 911, otherwise, you can call the local police station for the fraud attempt. Besides that, you can get help from these 7 organizations for telecommunication related crime.


  1. For Consumer Fraud and Identity Theft, contact Federal Trade Commission with phone number 877-3824357,877-4384338, the website: www.ftc.gov
  2. For Disaster-Related Fraud, contact National Center for Disaster Fraud with phone number 866- 7205721, website disaster@leo.gov.
  3. For General Fraud and Other Criminal Matters, contact FBI with phone number 202-3243000, website www.fbi.gov.
  4. For Health Care Fraud, Medicare/Medicaid Fraud, and Related Matters, contact Department of Health and Human Services with phone number 800-4478477, website www.oig.hhs.gov.
  5. For Internet Fraud and Lottery/Sweepstakes Fraud by Internet, contact Internet Crime Complaint Center. www.ic3.gov.
  6. For Mail Fraud and Lottery/Sweepstakes Fraud, contact U.S. Postal Inspection Service at phone number 800-3728347. website: postalinspectors.uspis.gov.
  7. For Securities Fraud, contact Securities and Exchange Commission at 800- 7320330. website: ww.sec.gov/complaint/select.shtml.

7162661793 is a spam caller

(716)266-1793 is a spam caller with bad reputation and many negative reports as a telephone marketer.

Monday, July 16, 2018

7 MAC OS X eclipse short cuts

The eclipse has many keyboard shortcuts that can potentially save you tons of time, so that you can focus on the programing itself instead of navigating the IDE.

If you have to remember one shortcut, remember this one:
Command + Shift + L


It will list all the defined eclipse shortcuts.
From the list, you can pick whatever shortcuts you want to remember. Here is my top 7 list.


  1. Control + Shift + L : list all shortcuts
  2. Control + space bar: content assist. You can type part of a java syntax, then type control + spacebar, the IDE will give you the suggested templates.
  3. Control + shift + space bar: context information, whenever you want hint about a method parameter, put you cursor in the (), then type Control + shift + space.
  4. Control + Shift + H: type search. If you know a class name, you can type Control + shift + H to open a search bar to quickly land on the java file.
  5. Control + option + H: open call Hierarchy. This one do the same as right click and select open call hierarchy, but if you look up lots of code, it adds up.
  6. Command + L: move to line number. This shortcut is handy for trouble-shooting a large file.
  7. Control + E: open editors. This is handy if you have lots of files open.



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.

Monday, July 9, 2018

7187911489 and 7187912630 are phishing numbers

7187911489 (718)791-1489 718-791-1489 (718)-791-1489 and 7187912630 (718)7912630 718-791-2630 (718)-791-2630 are phishing numbers. The robots are trying to call your phone in order to collect feedback. Don't give them any response by pressing key or call them back.

7 unix commands for trouble-shooting memory related issue

Your application has been running fine for months until a recent linux patch are applied and you want to figure out what's going wrong.

These commands will be handy during your adventure of figuring out the root cause.

top


top command will give a general idea of how busy your system is and what resources are depleting. It will also list the top consumers of your computer cpu and memory. 

free -ht

free will list all the RAM usage statistics. -h is human readable, -t will print out total. The Total line is where you should find out the amount of free memory for your program. 

df -h

df -h let you check if you have disk full. -h is human readable.

uname -a

this command allow you to check the OS related information. From the output, you will find the kernel version, which may have bug related to performance issue.

lsof -nP | grep '(deleted)'


sometimes, you deleted a large file but your running application still have a reference to the file descriptor. The disk space won't be freed until the application exits. You can find these invisible files with command lsof -nP | grep '(deleted)'.

sar -r


when you want to find the memory usage in the past, sar command will do the job. The command sar have many flags for different resources like cpu, memory or IO, -r flag list the memory usage for today. 

ps -ef | grep java

find out if your java application is still running. To your surprise, it might just exit without any runtime exception in the log. The reason might be memory related.

When java program is running in VM that is configured to overcommit memory, the JVM will suffer from performance issue. A garbage collection which normally completes in hundreds of milliseconds might take minutes to complete in such an environment and the applications within that JVM are frozen during this time. 

“Java provides a special challenge in virtual environments due to the JVM’s introduction of a third level of memory management. The balloon driver draws memory from the virtual machine without impacting throughput because the guest OS efficiently claims pages that its processes are not using. But in the case of Java, the guest OS is unaware of how the JVM is using memory and is forced to select memory pages as arbitrarily and inefficiently as ESX’s swap routine. Neither ESX nor the guest OS can efficiently take memory from the JVM without significantly degrading performance. Memory in Java is managed inside the JVM and efforts by the host or guest to remove pages will both degrade Java applications’ performance. In these environments it is wise to manually set the JVM’s heap size and specify memory reservations for the virtual machine in ESX to account for the JVM, OS, and heap.“



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.

2125174674 is a phishing number

2125174674 or 212-517-4674 or (212)517-4674 is a phishing number. The robot call is trying to get user response so that they can do more damage in the future. Don't give this robot call any response.

MarketAxess

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