Access to aws EC2 instance using password in linux

rajeshkumar created the topic: Access to aws EC2 instance using password in linux

Access to aws EC2 instance using password in linux

Here’s what I did on a Ubuntu EC2

A) Login as root using the keypairs

B) Setup the necessary users and their passwords with

# adduser
C) Edit /etc/ssh/sshd_config setting

PasswordAuthentication yes
D) Restart the sshd with

# sudo service sshd restart

Credit Illy
Rajesh Kumar
Twitt me @

Tagged :

Revert the files of user access has been disabled

rajeshkumar created the topic: revert the files of user access has been disabled
Long Back I had one questions to perforce support. Now it was in my archived email So sharing in forum, Hope this will help other members.

Problem Area:
There is one clientSpec called “ClientSpec1” and two user has opened a file in same clientspec “user1” and “user2”. Now we want to delete “user2” without deleted workspace. Also we can
not impersonate user2 login e.g p4 -p PORT -u user2 -c ClientSpec1 -H host1 revert //…
and then revert the files as user access has been disabled.

Please suggest what should be done in this case to revert the files and delete the users.

There are a few ways in which you could do this.

Firstly, an admin should be able to log in as another user – so ‘p4 -u admin login user2’ would create the ticket without needing the password for ‘user2’.
Once logged in, you should be able to impersonate this user and run ‘p4 revert -k’ for the files in question.
This is covered in the following KB article.

Alternatively, another user could take ownership of the files. Here’s an example:

Users ‘rajesh’ and ‘kumar’ have each opened a file in workspace ‘temporary’.
>p4 opened -a //depot/test…
//depot/test.js#3 – edit default change (xtext) by rajesh@temporary
//depot/test2.js#2 – edit default change (text) by kumar@temporary

I use the ‘reopen’ command to change the user:
>p4 -u adam -c temporary reopen //depot/test…
//depot/test.js#3 – reopened; user adam
//depot/test2.js#2 – reopened; user adam

As these changes are now ‘mine’, I can revert them (noting the ‘-k’ flag here):
>p4 -u adam -c temporary revert -k //depot/test…
//depot/test.js#3 – was edit, cleared
//depot/test2.js#2 – was edit, cleared
Rajesh Kumar
Twitt me @

Tagged :

Jenkins Remote access API Example | Jenkins Tutorial

Jenkins Remote access API Example
Jenkins provides machine-consumable remote access API to its functionalities. Currently it comes in three flavors:
JSON with JSONP support
Remote access API is offered in a REST-like style. That is, there is no single entry point for all features, and instead they are available under the “…/api/” URL where “…” portion is the data that it acts on.
For example, if your Jenkins installation sits at, visiting will show just the top-level API features available – primarily a listing of the configured jobs for this Jenkins instance.
Or if you want to access information about a particular build, e.g., then go to and you’ll see the list of functionalities for that build.
Remote API can be used to do things like these:
Retrieve information from Jenkins for programmatic consumption.
trigger a new build
create/copy jobs
Jobs with parameters, Also see Parameterized Build.
Simple example – sending “String Parameters”:
curl -X POST JENKINS_URL/job/JOB_NAME/build \
  –data token=TOKEN \
  –data-urlencode json='{“parameter”: [{“name”:”id”, “value”:”123″}, {“name”:”verbosity”, “value”:”high”}]}’
Check Jenkins Job Status via REST API
job_status=`curl https://jenkins/view/job/other-job/lastBuild/api/json | grep “\”result\”:\”SUCCESS\””`
if [ -n "$job_status" ] then     # Run your script commands here else   echo "BUILD FAILURE: Other build is unsuccessful or status could not be obtained."   exit 1 fi
How to restart Jenkins manually?
To restart Jenkins manually, you can use either of the following commands:
(jenkins_url)/safeRestart – Allows all running jobs to complete. New jobs will remain in the queue to run after the restart is complete.
(jenkins_url)/restart – Forces a restart without waiting for builds to complete.
Tagged : / / / / / / /

Access gitlab Password Less in Windows


Step 1- Generate a public/private key using puttygen

  • Download a puttygen from  and generate a public key and private key by following below image.
  • Click on Conversions à Export OpenSSH Key à  and save it to % USERPROFILE %\.ssh with file name “id_rsa”
  • Copy the public key from puttygen window and save into gitlab.


Step 2-  Add .ssh folder to your command line path
By following command..


add into user system variable.

And you are good to go. Comment if you face any issues?

Tagged : / / / / / / / / / / /

How to access all Java system properties directly?


You could access all Java system properties directly via ${name}, e.g.

${}, ${user.dir}, ${user.home}, …

You could read environment properties and use them

  <properties environment=”env”/>



  ${env.USERPROFILE}, ${env.USERNAME}, ${env.PATH}

You could pass properties during Ants start

  ant -Dname=value -Danothername=anothervalue

Also you Ant could ask for input

  <input addproperty=”foo”/>


Tagged : / / / / / / / / / / / / / / / / /

How to Access SVN when client is under proxy ?


The Subversion client can go through a proxy, if you configure it to do so.


First, edit your “servers” configuration file to indicate which proxy to use. The files location depends on your operating system.


On Linux or Unix it is located in the directory “~/.subversion”.


On Windows it is in “%APPDATA%\Subversion”. (Try “echo %APPDATA%”, note this is a hidden directory.)

Tagged : / / / / / / / / / / /

Script to list the clients in descending access date order



Write a script to list the clients in descending access date order (for deleting obsolete clients).


require “P4”
p4 =
clients = p4.run_clients.sort {|a,b| a[ “Access”].to_i <=> b[“Access”].to_i }
clients[0…10].each do
stamp = c[ “Access” ].to_i )
printf( “%-20s %s\n”, c[ “client” ], stamp )


use P4;
my $p4 = new P4;
$p4->Init() or die( “Failed to connect to Perforce” );
my @clients = $p4->Clients();
@clients = sort { $a->{ “Access” } <=> $b->{ “Access” } } @clients;
@clients = @clients[ 0..9 ];
foreach my $client ( @clients )
last unless defined( $client );
my $stamp = localtime( $client->{ “Access” } );
printf( “%-20s %s\n”, $client->{ “client” }, $stamp );

Tagged : / / / / / / / / / / /