Tuesday, March 8, 2016

12 IntelliJ IDEA Keyboard Shortcuts, mandatory to know!

intellij-idea-shortcuts-small

1. (Un)Comment line: Cmd + L

Transforming the current line into comment is essential in bug tracking. Instead of going to the beginning of line and manually typing //, Cmd+L will do that for us. Even cooler, the editor will know how to uncomment lines, even when commented out manually. A good thing to know is that caret will move to the next line automatically, allowing multiple lines to be commented out at once.
Line comment

2. (Un)Comment selection: Shift + Control + /

Similar to line commenting, this shortcut will surround the current selection. While line commenting is quicker, here you can be much more precise and more creative with comments. Refer to the figure below for comparison.
Selection comment

3. Documentation comment block: /** + Enter

Not quite a keyboard shortcut, this one is more of a code completion helper. After you create a member, go one line above it and type /** followed by a press on the Enter key. Voila, IDEA will automagically create a documentation block for you. If you place it above a method, the block will be populated with argument params, which can be tremendously useful.
EDIT: Denis Zhdanov of JetBrains pointed out a great new feature shipped as of v12, “Fix Doc Comment”. Read more about it here on his blog post.
I don’t think I can stress the importance of documentation in code. Please use line comments and documentation blocks as much as possible. They will help you more than you can imagine, others even more.
Documentation block

4. Delete line: Cmd + Y

Another no-brainer very useful. No need to get your hands off of keyboard to reach for the mouse, or use extra shortcuts to select a line + Backspace. Simply place caret at the line you want out of your project and push Cmd + Y.
Here’s how I remember that it’s Y and not another key, D for example. You know how deletions are frequently followed by a confirmation dialog? “Are you sure you want to delete this item?” and similar. Most of us have trained our eyes to find a short little word that begins with an Y – Yes. Here we’re skipping the dialog and agreeing immediately. Yes, delete the sucker!

5. Argument documentation for method calls: Cmd + P

Useful when you need to remember argument options when calling a method, this shortcut will pull up a callout with the information you need. It is even capable of learning from your documentation blocks.
Parameter callout

6. Incremental selection: Cmd + W

Although Cmd + W defaults to close tab/window in most applications (and so it did in IDEA < 11), IDEA 11 and up assigned to to a whole new purpose.  When you need to select a word, reference, statement, line, or entire block of code without lifting your hands from keyboard, this shortcut comes to the rescue. Press it once to select the word closes to the caret. Repeat to incrementally select larger chunks.
Incremental selection

7. Reformat code: Option + Cmd + L

Whether you are a fan of JSLint or you follow another JavaScript code style, you can configure IDEA to learn it and reformat your code accordingly. First, make sure you’re satisfied with settings found at Preferences -> Code Style – > Your Language. Walk through the tabs offered and set the style that best match your desired behavior. Once completed, go to your code.
Pressing Option + Cmd + L will politely ask you which section you want to reformat. It can be a selection, file, or even entire project.
In some situations, you may need to omit parts of code (e.g. when concatenating arrays of html strings). In such case, selecting a code area and hitting the shortcut will automatically offer to reformat selection. So hit shortcut and press enter for a quick and smart code reformat.

8. Cycle through the history of most recent changes: Cmd + Shift + Backspace

When editing huge files, and I mean many at the same time, it can get difficult to navigate through the maze of code. The effect is stronger when editing someone else’s code. In such situations, I find this shortcut very useful. It doesn’t delete anything, as Backspace may imply, it just shifts the caret over to the position of last change. It goes like that long ways through history, and even switches open files for you. If you haven’t already, try it out, it’s a gem.

9. Paste from five previous copies – Cmd + Shift + V

Does the OS default one slot in memory for copy-paste satisfy you? IDEA tracks your last five copies and allows you to chose from them when pasting. Instead of the accustomed Cmd + V for paste, add Shift to the combination and a dialog pops up, offering the options.
Paste history

10. Find members in current file: Cmd + F12

Easily on of my top three favorite shortcuts, this one emulates Cmd + Shift + O in Chrome Inspector. Basically, it shows a popup with all objects and respective members associated with a file. Moreover, if you start typing, it will perform a search and select the line you were looking for. Amazingly useful in big files.
As an added bonus, press the shortcut twice to show the inherited members.
Find members
If you can’t reproduce this on a Mac, make sure F12 (Fn + F12) is not registered to Mission Control. Simply go to OS X’s Settings -> Mission Control and remove any existing bindings. Now you can retry in IDEA.
Disable F12 in Mission Control

11. Find members in current project: Cmd + Alt + Shift + N

Finding members in a file is quick and easy. Alternatively, if you want to find members throughout the project, sacrificing just a tiny bit of speed, then this shortcut is meant for you.
Find members in a project

12. Show recently changed files: Cmd + Shift + E

IDEA will automatically manage your tabs so that you don’t have too many to clutter your workspace. In many workspaces, you might also want to close the project browser window in order to save some horizontal space. Getting to see the most recently edited files is a speed boost that will help any developer working in a similar environment. Just press Cmd + Shift + E and chose from the list, sorted in ascending order relative to the time of last edit. Guess what – it even works after you restart the editor!
Recent Edits
Note on automatic tab management: IDEA will auto close tabs to keep the workspace tidy. This action will not result in losses such as file state, undo/redo stack, or even scroll position. If, for any reason, you may want to keep a tab constantly visible, right click on it and select ‘Pin active tab’. I’m afraid here isn’t a default shortcut for pinning tabs.


Monday, March 7, 2016

List of admin services in WSO2-IS-5.0.0

Here is the list of admin wsdl services defined in wso2 is 5.0.0:

osgi> listAdminServices
Admin services deployed on this server:
1. ProvisioningAdminService, ProvisioningAdminService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/ProvisioningAdminService/
2. IdentitySAMLSSOConfigService, IdentitySAMLSSOConfigService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/IdentitySAMLSSOConfigService/
3. CarbonAppUploader, CarbonAppUploader, https://is-is-test9-int.devint.trimblepaas.com:9443/services/CarbonAppUploader/
4. JaggeryAppAdmin, JaggeryAppAdmin, https://is-is-test9-int.devint.trimblepaas.com:9443/services/JaggeryAppAdmin/
5. JaxwsWebappAdmin, JaxwsWebappAdmin, https://is-is-test9-int.devint.trimblepaas.com:9443/services/JaxwsWebappAdmin/
6. RemoteUserStoreManagerService, RemoteUserStoreManagerService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/RemoteUserStoreManagerService/
7. UserProfileMgtService, UserProfileMgtService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/UserProfileMgtService/
8. StatisticsAdmin, StatisticsAdmin, https://is-is-test9-int.devint.trimblepaas.com:9443/services/StatisticsAdmin/
9. LoggedUserInfoAdmin, LoggedUserInfoAdmin, https://is-is-test9-int.devint.trimblepaas.com:9443/services/LoggedUserInfoAdmin/
10. WebappAdmin, WebappAdmin, https://is-is-test9-int.devint.trimblepaas.com:9443/services/WebappAdmin/
11. ws-xacml, ws-xacml, https://is-is-test9-int.devint.trimblepaas.com:9443/services/ws-xacml/
12. RemoteUserRealmService, RemoteUserRealmService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/RemoteUserRealmService/
13. TopicManagerAdminService, TopicManagerAdminService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/TopicManagerAdminService/
14. ClaimManagementService, ClaimManagementService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/ClaimManagementService/
15. IdentitySTSAdminService, IdentitySTSAdminService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/IdentitySTSAdminService/
16. NDataSourceAdmin, NDataSourceAdmin, https://is-is-test9-int.devint.trimblepaas.com:9443/services/NDataSourceAdmin/
17. ServiceGroupAdmin, ServiceGroupAdmin, https://is-is-test9-int.devint.trimblepaas.com:9443/services/ServiceGroupAdmin/
18. IdentityApplicationManagementService, IdentityApplicationManagementService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/IdentityApplicationManagementService/
19. CustomMeteringService, CustomMeteringService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/CustomMeteringService/
20. STSAdminService, STSAdminService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/STSAdminService/
21. DirectoryServerManager, DirectoryServerManager, https://is-is-test9-int.devint.trimblepaas.com:9443/services/DirectoryServerManager/
22. OAuthAdminService, OAuthAdminService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/OAuthAdminService/
23. RegistryAdminService, RegistryAdminService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/RegistryAdminService/
24. FileDownloadService, FileDownloadService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/FileDownloadService/
25. ContentSearchAdminService, ContentSearchAdminService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/ContentSearchAdminService/
26. LoginStatisticsAdmin, LoginStatisticsAdmin, https://is-is-test9-int.devint.trimblepaas.com:9443/services/LoginStatisticsAdmin/
27. CustomUIAdminService, CustomUIAdminService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/CustomUIAdminService/
28. SearchAdminService, SearchAdminService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/SearchAdminService/
29. RemoteAuthorizationManagerService, RemoteAuthorizationManagerService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/RemoteAuthorizationManagerService/
30. RemoteProfileConfigurationManagerService, RemoteProfileConfigurationManagerService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/RemoteProfileConfigurationManagerService/
31. SCIMConfigAdminService, SCIMConfigAdminService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/SCIMConfigAdminService/
32. IdentityProviderAdminService, IdentityProviderAdminService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/IdentityProviderAdminService/
33. IWAAuthenticator, IWAAuthenticator, https://is-is-test9-int.devint.trimblepaas.com:9443/services/IWAAuthenticator/
34. LoggingAdmin, LoggingAdmin, https://is-is-test9-int.devint.trimblepaas.com:9443/services/LoggingAdmin/
35. SampleDeployer, SampleDeployer, https://is-is-test9-int.devint.trimblepaas.com:9443/services/SampleDeployer/
36. XMPPConfigurationService, XMPPConfigurationService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/XMPPConfigurationService/
37. SecurityAdminService, SecurityAdminService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/SecurityAdminService/
38. KeyStoreAdminService, KeyStoreAdminService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/KeyStoreAdminService/
39. ServerRolesManager, ServerRolesManager, https://is-is-test9-int.devint.trimblepaas.com:9443/services/ServerRolesManager/
40. IdentityProviderMgtService, IdentityProviderMgtService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/IdentityProviderMgtService/
41. ResourceAdminService, ResourceAdminService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/ResourceAdminService/
42. ThemeMgtService, ThemeMgtService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/ThemeMgtService/
43. FileUploadService, FileUploadService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/FileUploadService/
44. RemoteTenantManagerService, RemoteTenantManagerService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/RemoteTenantManagerService/
45. EventBrokerService, EventBrokerService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/EventBrokerService/
46. TracerAdmin, TracerAdmin, https://is-is-test9-int.devint.trimblepaas.com:9443/services/TracerAdmin/
47. MultipleCredentialsUserAdmin, MultipleCredentialsUserAdmin, https://is-is-test9-int.devint.trimblepaas.com:9443/services/MultipleCredentialsUserAdmin/
48. UserStoreConfigAdminService, UserStoreConfigAdminService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/UserStoreConfigAdminService/
49. RepositoryAdminService, RepositoryAdminService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/RepositoryAdminService/
50. TenantMgtAdminService, TenantMgtAdminService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/TenantMgtAdminService/
51. DeploymentSynchronizerAdmin, DeploymentSynchronizerAdmin, https://is-is-test9-int.devint.trimblepaas.com:9443/services/DeploymentSynchronizerAdmin/
52. EntitlementPolicyAdminService, EntitlementPolicyAdminService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/EntitlementPolicyAdminService/
53. ServerAdmin, ServerAdmin, https://is-is-test9-int.devint.trimblepaas.com:9443/services/ServerAdmin/
54. ServiceAdmin, ServiceAdmin, https://is-is-test9-int.devint.trimblepaas.com:9443/services/ServiceAdmin/
55. UserIdentityManagementAdminService, UserIdentityManagementAdminService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/UserIdentityManagementAdminService/
56. EntitlementAdminService, EntitlementAdminService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/EntitlementAdminService/
57. UserAdmin, UserAdmin, https://is-is-test9-int.devint.trimblepaas.com:9443/services/UserAdmin/
58. AccountCredentialMgtConfigService, AccountCredentialMgtConfigService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/AccountCredentialMgtConfigService/
59. UserInformationRecoveryService, UserInformationRecoveryService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/UserInformationRecoveryService/
60. PropertiesAdminService, PropertiesAdminService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/PropertiesAdminService/
61. LogViewer, LogViewer, https://is-is-test9-int.devint.trimblepaas.com:9443/services/LogViewer/
62. RemoteClaimManagerService, RemoteClaimManagerService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/RemoteClaimManagerService/
63. EntitlementService, EntitlementService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/EntitlementService/
64. OAuth2TokenValidationService, OAuth2TokenValidationService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/OAuth2TokenValidationService/
65. ProfilesAdminService, ProfilesAdminService, https://is-is-test9-int.devint.trimblepaas.com:9443/services/ProfilesAdminService/
 

Monday, February 22, 2016

How to add an attribute to wso2 product's LDAP

1. In the directory repository/data/org.wso2.carbon.directory/schema/ou=schema/cn=inetorgperson/ou=attributetypes add the attached ldif file

2. In repository/data/org.wso2.carbon.directory/schema/ou=schema/cn=inetorgperson/ou=objectclasses edit the m-oid=2.16.840.1.113730.3.2.2.ldif and add m-may: passwordPolicy

3. Add a claim entry in claim-config.xml

4. Add a claim mapping in the UI

Sunday, February 14, 2016

How to open a specific folder in Mac Finder

How to open a specific folder in Mac OS X:
Using Finder:
  1. Open Finder, you can type in universal search by hitting "Command + Space"
  2. Press "Command + Shift + G" in finder.

Using Terminal:
  1. Open Terminal, you can type in universal search by hitting "Command + Space"
  2. Use the following command to open the folder: eg:
    "open {folder_name}"

How to show hidden files in MAC

Easiest way to show hidden Mac OS X files in Finder:
  1. Open Terminal, you can type in universal search by hitting "Command + Space".
  2. In Terminal, paste the following: 
    defaults write com.apple.finder AppleShowAllFiles YES
    .
  3. Press Enter/Return.
  4. Hold the 'Option/alt' key, then right click on the Finder icon in the dock and click Relaunch.

Have fun!

Tuesday, November 24, 2015

Ho can we map service provider (SP) in identity to Application in API Manager

1. Create app in api manager
2. Generate the keys
3. Come to identity and login as admin@trimble.com<mailto:admin@trimble.com>
4. Create a sp with the same name as above but dont do anything else.
5. Hit the url below (replace the appname and consumer key)
6. Click update / submit
https://identity-dev.trimble.com/i/t/trimble.com/carbon/application/configure-service-provider.jsp?action=update&display=oauthapp&spName=KrishnaPlayground&oauthapp=G_mBPM2E1CJhACJ0ZxikHZY4udQa

Sunday, October 18, 2015

Deleting a line or word in iTerm2

In OSX, ⌥+⌫ and ⌘+⌫ are the shortcuts for deleting a word and deleting a line respectively. ⌘+ ← and ⌘+ → are for going to the beginning and end of lines. By default, iTerm2 isn't configured this way, and there are a lot of misleading guides online. The following is what I've found to work on my machine.

1. Open the preferences (⌘+,) and go to the Keys tab.
2. Add a global shortcut key, and just type in your shortcut
3. In the Action dropdown, select Send Hex Code

The hex codes for...

* Deleting a word: 0x17.
* Deleting a line: 0x15.
* Moving to the beginning of the line: 0x01.
* Moving to the end of the line: 0x05.

Just open a new tab, and it should work!

Here is a screenshot, for clarity. [Picture]

Shortcuts to go to line starting and end in iTerm2

Here are the shortcuts that will work in Terminal app.

Home: control + A

End: control + E

Next Word: esc, then f

Previous word: esc, then b

How to rename the tab name in iTerm2

I like this one:

#setup terminal tab title
function title {
if [ "$1" ]
then
unset PROMPT_COMMAND
echo -ne "\033]0;${*}\007"
else
export PROMPT_COMMAND='echo -ne "\033]0;${PWD/#$HOME/~}\007"'
fi
}
title


It will let you toggle the name of a tab between a custom name and a default of your CWD.

title -> your tab title will be ~/YOUR_CWD/

title hey there -> your tab title will be hey there

How to a command to multiple tabs in Iterm2

iTerm 2 is a replacement application for the default terminal on OSX. It's highly popular due to allowing advanced features such as tabs, split panes, simpler theming and custom keyboard bindings.

[iTerm 2 split panes]

If you find the need to enter the same commands into multiple panes at the same time, simply hit "⌘Command + ⇧Shift + I". You will recieve a small notification about sending input to all panes, the next text you type will physically begin typing into all open panes for your current tab and is executed once you hit "⏎ Return".

Pretty neat!.

Thanks & Regards,
RK