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
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

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.

Solution:
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.
kb.perforce.com/article/38/reverting-another-users-files

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
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

Jenkins Remote access API Example | Jenkins Tutorial

jenkins-remote-access-api-example
Jenkins Remote access API Example
Jenkins provides machine-consumable remote access API to its functionalities. Currently it comes in three flavors:
XML
JSON with JSONP support
Python
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 http://ci.jruby.org/, visiting http://ci.jruby.org/api/ 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. http://ci.jruby.org/job/jruby-base/lastSuccessfulBuild/, then go to http://ci.jruby.org/job/jruby-base/lastSuccessfulBuild/api/ 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.
Reference
Tagged : / / / / / / /

Access gitlab Password Less in Windows

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..

     set HOME=%USERPROFILE%

or
add into user system variable.
HOME=%USERPROFILE%

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

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

How to access all Java system properties directly?

java-system-properties

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

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

You could read environment properties and use them

  <properties environment=”env”/>

  ${env.ENVIRONMENT_VARIABLE}

e.g.

  ${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”/>

  ${foo}

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

How to Access SVN when client is under proxy ?

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

 

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).

 

#!/usr/bin/ruby
require “P4”
p4 = P4.new
p4.tagged
p4.connect
clients = p4.run_clients.sort {|a,b| a[ “Access”].to_i <=> b[“Access”].to_i }
clients[0…10].each do
|c|
stamp = Time.at( c[ “Access” ].to_i )
printf( “%-20s %s\n”, c[ “client” ], stamp )
end

OR

#!/usr/bin/perl
use P4;
my $p4 = new P4;
$p4->Tag();
$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 : / / / / / / / / / / /