My First Post      My Facebook Profile      My MeOnShow Profile      W3LC Facebook Page      Learners Consortium Group      Job Portal      Shopping @Yeyhi.com

Pages










Showing posts with label remote. Show all posts
Showing posts with label remote. Show all posts

Wednesday, July 24, 2019

Remote debugging using IntelliJ IDE

Here you'll see how to create and manage a configuration to remotely debug your launched Alfresco project that's waiting for a connection. This assumes you have an IntelliJ IDEA IDE up and running, and have already imported the same project you are going to debug.

For more details on how import an Alfresco project into your IntelliJ IDEA IDE, see Setting up your development environment using Intellij IDEA

Open the IntelliJ IDEA IDE and click on Run Configurations (top right).


Click on the green plus (top left) and select Remote to add a new configuration for a remote app.
Enter a name for your configuration, for example, "My-remote-debug"

Apply some settings eg. Change the port number eg. to 8000.
Check that your settings match the screenshot.
Click OK.



Now when you debug, You will be taken back to the project source code.
To start debugging Click on the bug (debug) icon and select the new configuration My-remote-debug to run it.


The project starts running and generating all the log messages of a regular launch in the terminal window. Open your browser and type http://localhost:8080/hello

Voila!! IntelliJ IDEA will intercept the execution at the breakpoint:

Friday, March 24, 2017

Fatal: bad Object error in Git cherry-pick - Why Exception is thrown during cherry picking in Git ? *

In one of my earlier blog post, I explained how to cherry-pick in Git. To understand more about what does cherry picking a commit in git mean and how to do it, refer:
W3LC: Git Cherry Pick Command Tutorial

This post is to deal a situation when you get a fatal error in your attempt to cherry pick. The error is as follows:
"fatal: bad object"

So here I would like to explain why this occurs. The cause is that there is no information about remote branch on your local system.

Technically, if the branch is not locally present - you don't have the right data. You will errors like " fatal: bad object "

Solution:
To solve this you first need to fetch information on your local system. To do this use fetch command of Git.

1. fetch just the one remote
git fetch
2. or fetch from all remotes
git fetch --all

Here we should take a short break and understand what is Git Fetch command:

W3LC Definition: In the simplest terms, git pull does a git fetch followed by a git merge.
This means that the fetch operation never changes any of your own local branches under refs/heads, and is safe to do without changing your working copy. A git pull is what you would do to bring a local branch up-to-date with its remote version, while also updating your other remote-tracking branches. This updating your other remote-tracking branches is called as fetch.


So, let us assume that you fetched the information about all branches.

Now, make sure you're back on the branch you want to cherry-pick to. And use the git cherry-pick command again. Example:
git cherry-pick 9505ac61c924de0bba404f40f8abdc53af1909d8

Great. Now it should work!


Do also read if you want to change the name of your git branch. The process to do so is explained fully on my earlier blog post:
W3LC: Git Rename a Branch Name

Git : Rename / Change Branch name : How to Change the branch name of a local or a remote branch in git

There are multiple scenarios if you want to change the name of the branch. Sometimes you could have named a branch incorrectly, and sometimes it could be because you didn't follow the naming guidelines as per your team and organisation. Whatever be the cause, you very well need to know the method to do so.


The process is as follows:

1. First, rename your local branch.  (Sometimes you need to only do this. For example if the branch is yet not pushed on stash.)
If you are on the branch you want to rename:
Syntax: git branch -m new-name


2. In case you are on a different branch:
Syntax: git branch -m old-name new-name


3. Now suppose you want o delete the old remote branch and push the new-name local branch.
Syntax: git push origin :old-name new-name


Or, 4. You can also reset the upstream branch with the new branch local branch.
For this you need to switch to your new local branch and then:
Syntax: git push origin -u new-name

Wednesday, September 12, 2012

Color Coding Scheme in Remote Distibuted Systems


I always have to work hard to remember which server is live, which is for production, which is for development, etc. It’s also difficult to tell at a glance which remote server I’m connected to over remote desktop. Typically I change the wallpaper color to red for production servers, green for development servers and yellow for staging servers. But that doesn’t solve the second problem of immediately knowing which server I’m connected to. I needed my other teammates to know that this is a crucial machine and they should not use it.

The typical Color Codes I use:
Red:    Crucial Machine. Presently in Use, no one should Touch it.
Green: Free to go. Idle machine. Anyone can use.
Blue:    Free. But requires permission before last user, in case there are some logs he or she may need to take backup

Method 1: graphical UI method at time of connection
Though this seems to be a good approach, but I still recommend doing the colored background with the wallpaper since not all connecting clients will have desktop wallpaper enabled.  Since if background color enabled, it will be shown to user connecting to machine. Image how to chage….
There is no special need for rdb client to have certain option while making a connection. Also since it slows: Refer this small post:- Disable the remote host desktop wallpaper
http://new-it-discussions.blogspot.in/2012/09/disable-remote-host-desktop-wallpaper.html



Method 2: Setting using Default.rdp file to control parameters and behavior in remote desktop rdp/mstsc connections
When you use the Remote Desktop Protocol (RDP) to connect to a remote computer, the Default.rdp file is created on the client computer. This article discusses the connection settings that are stored in the Default.rdp file. For details view [Anwar Jamal Faiz Web Post] What is default.rdp file in remote desktop


Method 3: Using Group policy editor in Remote Desktop Connections [gpedit.exe]
First off, your RDP client (Remote Desktop Connection client in the case of Windows XP) has to have remote wallpaper enabled. On XP, open the saved Remote Desktop Connection file to the server you are connecting and click the Experience tab. Place a check in the option “Desktop background”. This allows the client to see enabled desktop wallpapers.
Second, connect to the remote Win2k3 server and from a Run box, type “mmc” and go to to open group policy editor
If you don’t know just simply type on run “gpedit.msc”
Start->Run->gpedit.msc [then press Enter]
Now browse to Local Computer Policy -> Computer Configuration -> Administrative Templates -> Windows Components -> Terminal Services. From the list, modify “Always show desktop on connection” to “Enabled” and “Enforce Removal of Remote Desktop Wallpaper” to “Disabled”. Now close the MMC clicking “No” about saving the settings.
Log out of your remote desktop connection and login again, making sure your RDP client has desktop wallpaper enabled. Now you should be able to rt-click the desktop and apply wallpaper normally. I still recommend doing the colored background with the wallpaper since not all connecting clients will have desktop wallpaper enabled.


This policy setting determines whether the desktop is always displayed after a client connects to a remote computer or an initial program can run. It can be used to require that the desktop be displayed after a client connects to a remote computer, even if an initial program is already specified in the default user profile, Remote Desktop Connection, Terminal Services Client, or through Group Policy.

If you enable this policy setting, the desktop is always displayed when a client connects to a remote computer. This policy setting overrides any initial program policy settings. If you disable or do not configure this policy setting, an initial program can be specified that runs on the remote computer after the client connects to the remote computer. If an initial program is not specified, the desktop is always displayed on the remote computer after the client connects to the remote computer.
Note: If this policy setting is enabled, then the "Start a program on connection" policy setting is ignored.

I guess this was my final  post on the topic. I wont write more on the topic. :) There is no need, its complete :)

Related posts:

--Mohd Anwar Jamal Faiz
Toughjamy@yahoo.com

What is default.rdp file in remote desktop


When you use RDP to connect to a remote computer, you can use the Remote Desktop ConnectionOptions dialog box to configure many of the connection settings. To configure these settings, follow these steps:
1. Click Start, click Run, type mstsc.exe, and then click OK.
2. In the Remote Desktop Connection dialog box, click Options.
You can save *.rdp files with different settings if you connect to multiple remote computers. To save a new configuration, click Save As on the General tab in Options.

Default file is Default.rdp in My documents of Target computer (obviously the docs of Username used to login will be scanned, and not The documents folder of Anwar Jamal Faiz!!)

Settings that are stored in the Default.rdp file:

http://support.microsoft.com/kb/885187   refer 
By default, the Default.rdp file is created in your My Documents folder. The following RDP settings are stored in the Desktop.rdp file: 

desktopwidth:i
This setting corresponds to the desktop width that you select on the Display tab in Remote Desktop Connection Options.

Note Microsoft Windows CE-based devices support only full-screen mode.

desktopheight:i
This setting corresponds to the desktop height that you select on the Display tab in Remote Desktop Connection Options.

Note Microsoft Windows CE-based devices support only full-screen mode.

session bpp:i
This setting corresponds to the color depth that you select in Colors on the Display tab in Remote Desktop Connection Options.

Note Microsoft Windows CE-based devices support only full-screen mode.

winposstr:s
This setting corresponds to the window position that you select on the Display tab in Remote Desktop Connection Options.

Note On desktop computers, this setting determines the Remote Desktop Connection dialog box position on the screen. The six numbers represent a string form of the WINDOWPOS structure. For more information about the WINDOWPOS function, visit the following Microsoft Web site:
http://msdn2.microsoft.com/en-us/library/ms632612.aspx
Note Microsoft Windows CE-based devices support only full-screen mode.

auto connect:i
This setting is not used by desktop computers or by Windows CE-based clients.

full address:s
This setting determines the computer that you connect to. The setting corresponds to the entry in theComputer box on the General tab of Remote Desktop Connection Options.

compression:i
This setting determines whether data is compressed when it is transmitted to the client computer. 

Value Setting
0 Compression is off.
1 Compression is on.


keyboardhook:i
This setting determines where Windows key combinations are applied. This setting corresponds to the selection in the Keyboard box on the Local Resources tab of Remote Desktop Connection Options.

Value Setting
0 Applied on the local computer.
1 Applied on the remote computer.
2 Applied in full-screen mode only.


audiomode:i
This setting determines where sounds are played. This setting corresponds to the selection in the Remote computer sound box on the Local Resources tab of Remote Desktop Connection Options.

Value Setting
0 Play sound on the client computer.
1 Play sound on the host computer.
2 Do not play sounds.


redirectdrives:i
This setting determines whether disk drives are automatically connected when you log on to the remote computer. This setting corresponds to the selection in the Disk Drives box on the Local Resources tab of Remote Desktop Connection Options.

Value Setting
0 Drives are not automatically reconnected.
1 Drives are automatically reconnected.


redirectprinters:i
This setting determines whether printers are automatically connected when you log on to the remote computer. This setting corresponds to the selection in the Printers check box on the Local Resources tab of Remote Desktop Connection Options.

Value Setting
0 Printers are not automatically reconnected.
1 Printers are automatically reconnected.


redirectcomports:i
This setting determines whether COM ports are automatically connected when you log on to the remote computer. This setting corresponds to the selection in the Serial Ports box on the Local Resources tab of Remote Desktop Connection Options.

Value Setting
0 COM ports are not automatically reconnected.
1 COM ports are automatically reconnected.


redirectsmartcards:i
This setting determines whether smart cards are automatically connected when you log on to the remote computer. This setting corresponds to the selection in the Smart cards box on the Local Resources tab of Remote Desktop Connection Options.

Value Setting
0 Smart cards are not automatically reconnected.
1 Smart cards are automatically reconnected.


displayconnectionbar:i
This setting determines whether the connection bar is displayed when you log on to the remote computer in full-screen mode. This setting corresponds to the selection in the Display the connection bar when in full screen mode check box on the Display tab of Remote Desktop Connection Options.

Value Setting
0 Connection bar does not appear.
1 Connection bar appears.


username:s
This setting determines the user name that is displayed in RDP. The setting corresponds to the entry in theUser name box on the General tab of Remote Desktop Connection Options.

domain:s
This setting determines the user name that is displayed in the Remote Desktop Connection dialog box. It corresponds to the entry in the Domain box on the General tab of Remote Desktop Connection Options.

alternate shell:s
This setting determines whether a program is started automatically when you connect with RDP. The setting corresponds to the entry in the Program path and file name box on the Programs tab of Remote Desktop Connection Options.

shell working directory:s
This setting is the folder location for the application that is started automatically when you connect with RDP. The setting corresponds to the entry in the Program path and file name box on the Programs tab of Remote Desktop Connection Options.

disable wallpaper:i
This setting determines whether the desktop background appears when you log on to the remote computer. This setting corresponds to the selection in the Desktop background check box on theExperience tab of Remote Desktop Connection Options.

Value Setting
0 Wallpaper appears.
1 Wallpaper does not appear.


disable full window drag:i
This setting determines whether folder contents appear when you drag the folder to a new location. This setting corresponds to the selection in the Show contents of window while dragging check box on theExperience tab of Remote Desktop Connection Options.

Value Setting
0 Folder contents appear while dragging.
1 Folder contents do not appear while dragging.


disable menu anims:i
This setting determines how menus and windows appear when you log on to the remote computer. This setting corresponds to the selection in the Menu and window animation check box on the Experience tab of Remote Desktop Connection Options.

Value Setting
0 Menu and window animations are permitted.
1 Menu and window animations are not permitted.


disable themes:i
This setting determines whether themes are permitted when you log on to the remote computer. This setting corresponds to the selection in the Themes check box on the Experience tab of Remote Desktop Connection Options.

Value Setting
0 Themes are permitted.
1 Themes are not permitted.


bitmapcachepersistenable:i
This setting determines whether bitmaps are cached on the local computer. This setting corresponds to the selection in the Bitmap caching check box on the Experience tab of Remote Desktop ConnectionOptions.

Value Setting
0 Caching is not enabled.
1 Caching is enabled.


autoreconnection enabled:i
This setting determines whether a client computer automatically tries to reconnect after being disconnected. 

Value Setting
0 Client computer does not automatically try to reconnect.
1 Client computer automatically tries to reconnect.