Showing posts with label how-tos. Show all posts
Showing posts with label how-tos. Show all posts

How to solve GitHub permission denied to the user in Windows

If you have ever experienced permission denied for your GitHub user on windows 10 while pushing your code to your repository then, please follow below steps to remove the existing GitHub keys and enter new one:



  1. Go to Control panel
  2. After that go to User accounts
  3. From User accounts, go to Credential manager.
  4. Inside credential Manager go to Windows credentials
  5. After that go to Generic credentials
  6. Now remove existing GitHub keys.
That's it now you can retry pushing your code to your repository.

WordPress Redirect HTTP to HTTPS in Apache

If you have WordPress on Apache server and you want to redirect all your http URL to https URL, you can do this via editing .htaccess file. This is a recommend method for WordPress.



Follow below steps:

1. Open .htaccess file

2. Add below lines of code and save it.

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


That's it now you can see your website redirected to https.

How to delete all previous Jenkins build and reset it from GUI

This post is regarding the situation I was currently in. The situation was that in Jenkins I ran a job every hour. After that I had a lot of builds shown in my GUI.




So if you want to delete all previous Jenkins build, let's follow these steps:

1. Go to Jenkins home page 

2. Manage Jenkins

3. Click script console

4. A text box will open enter below script after replacing your project name with project_name

def jobName = "project_name"  
def job = Jenkins.instance.getItem(jobName)  
job.getBuilds().each { it.delete() }  
job.nextBuildNumber = 1   
job.save()

How to revert or recall the message sent in Outlook

Ever been in a situation where you sent the wrong email to the wrong person?

OR

You sent the mail but forgot to include the important information?

OR

You wanted to send a private message but you replied all.




I have been there. So in this post I am going to tell you how to recall the sent mail in Outlook.

Follow below steps:

- Go to sent items
- Double click the mail you want to recall
- Select the message tab of the email message window.
- Click drop down beside 'Actions' and select 'Recall This message'.
- Now select 'Delete unread Copies of this Message'.
- If you want information regarding success or failure of message recall, select 'Tell me If Recall Succeeds or Fails for Each Recipient' checkbox.
- Finally click OK

Now, you really unsent your sent email to the users who didn't read the email in Outlook.

Set JAVA_HOME path in ubuntu

Many a times after installing Java, JRE works fine as to run Java applications. But when it comes for Java development, JDK is required.

We get issues like 

- "The JAVA_HOME environment variable is not defined correctly. 
This environment variable is needed to run this program.
JAVA_HOME should point to a JDK not jre."

- "No compiler is provided in this environment. Perhaps you are running on a JRE rather than JDK"

- Maven unable to find JAVA_HOME.


To solve these issues on Ubuntu 18.04.

- Update apt : Advanced Package Tool

sudo apt update

- Install JDK: Skip if JDK already installed

sudo apt install openjdk-8-jdk

- Set JAVA_HOME

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

- Check if JAVA_HOME is set

echo $JAVA_HOME

- Add Java bin to path variable

export PATH=$PATH:$JAVA_HOME/bin

- verify PATH

echo $PATH

- Verify Java setup

java -version

- Verify maven

mvn -v


If everything goes right your issue is solved and you are ready to dive into java development.

How to add Java and Maven in alpine

In this post I am going to tell you how to add Java and Maven in alpine.




Example:
For java we will be adding openjdk 8

Run below commands:

apk add --no-cache openjdk

To add Maven just run below command:

apk add maven