Friday, January 31, 2020

Send HTML email body with an attachment; JAVA

import java.util.Properties;import javax.activation.DataHandler;import javax.activation.DataSource;import javax.activation.FileDataSource;import javax.mail.BodyPart;import javax.mail.Message;import javax.mail.MessagingException;import javax.mail.Multipart;import javax.mail.Session;import javax.mail.Transport;import javax.mail.internet.InternetAddress;import javax.mail.internet.MimeBodyPart;import javax.mail.internet.MimeMessage;import javax.mail.internet.MimeMultipart;


public static void getUtilityWithAttachemnt(String to, String cc, String from, String subject, String text,
String filepath) {

// Get system properties

Properties properties = System.getProperties();

// Setup mail server


String host = "SMTP.HOST.COM";


properties.setProperty("mail.smtp.host", host);

properties.setProperty("mail.smtp.port", "25");
// Get the default Session object.
Session session = Session.getDefaultInstance(properties);

try {

// Create a default MimeMessage object.
MimeMessage message = new MimeMessage(session);

// Set From: header field of the header.

message.setFrom(new InternetAddress(from));


if (to.indexOf(',') > 0)

message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(to));
else
message.setRecipient(Message.RecipientType.TO, new InternetAddress(to));

if (cc.indexOf(',') > 0)

message.setRecipients(Message.RecipientType.CC, InternetAddress.parse(cc));
else
message.setRecipient(Message.RecipientType.CC, new InternetAddress(cc));

// Set Subject: header field

message.setSubject(subject);

// Create the message part




// Create a multipart message

Multipart multipart = new MimeMultipart();

// Set HTML message part


final MimeBodyPart htmlBodyPart = new MimeBodyPart();


htmlBodyPart.setContent(text, "text/html");
multipart.addBodyPart(htmlBodyPart); 

// Part two is attachment

MimeBodyPart messageBodyPart = new MimeBodyPart();

DataSource source = new FileDataSource(filepath);

messageBodyPart.setDataHandler(new DataHandler(source));
String[] filename = filepath.split("//");
System.out.print("filename--->" + filename[filename.length - 1]);

messageBodyPart.setFileName(filename[filename.length - 1]);




message.saveChanges();
multipart.addBodyPart(messageBodyPart);

// Send the complete message parts

message.setContent(multipart);

message.saveChanges();


Transport.send(message);

// System.out.println("Sent message successfully....");
} catch (MessagingException e) {


e.printStackTrace();


}


}

Friday, January 24, 2020

Extract Source files from UiPath Orchestrator nupkg package; RPA

  • Download the required package from the Orchestrator to your local PC
  • The file saves with extension .nupkg

  • Right click on the package to extract the files using 7 Zip
 












  • All the file would be extracted to a folder
  • Navigate to Folder/lib/net45 to see all the source files.  




Wednesday, January 22, 2020

Scroll to the end of the page; UiPath RPA


BottomOfPage.js

window.onscroll = function (ev) {    var docHeight = document.body.offsetHeight;    docHeight = docHeight == undefined ? window.document.documentElement.scrollHeight : docHeight;
    var winheight = window.innerHeight;    winheight = winheight == undefined ? document.documentElement.clientHeight : winheight;
    var scrollpoint = window.scrollY;    scrollpoint = scrollpoint == undefined ? window.document.documentElement.scrollTop : scrollpoint;
    if ((scrollpoint + winheight) >= docHeight) {        return 'True';    }    else    { return 'False';    }









Apply patch or upgrade UiPath Orchestrator; RPA

After downloading UiPath software UiPathPlatformInstaller - https://vijaysadhu.blogspot.com/2020/01/uipath-software-downloads-rpa.html

There would be an option to upgrade or change - when using UiPathPlatformInstaller ;

If using UiPathOrchestrator.msi , default installation would upgrade the orchestrator.

To generate logfile for the installation use -

D:>UiPathOrchestrator.msi   /l*vx     logfile

https://docs.uipath.com/orchestrator/docs/msi-command-line-parameters

SQL sever host :    <server_url>\SQLEXPRESS


Custom account would be : domain/username 





UiPath software downloads; RPA

Download URLs:

https://download.uipath.com/versions/19.10.14/UiPathOrchestrator.msi

https://download.uipath.com/versions/19.10.3/UiPathPlatformInstaller.exe


https://download.uipath.com/versions/<19.10.3>/UiPathPlatformInstaller.exe

<--product version-->

20.10.4

https://download.uipath.com/versions/20.10.4/UiPathOrchestrator.msi

https://download.uipath.com/versions/20.10.4/UiPathPlatformInstaller.exe

Monday, January 6, 2020

Install SVN on linux (Subversion for enterprise)

http://www.collab.net/products/subversion


admin/admin would be the default username/password after you 1st install Subversion edge software

There is an amazing software SubVersionEdge by CollabNet



https://pawan6782.wordpress.com/2015/08/20/collabnet-edge-subversion/

Make sure JAVA_HOME is setup
Python is mandatory to setup SVN.
Download src from https://www.python.org/downloads/ and unzip on UNIX box.
Navigate to unzipped folder /home/app/src/Python-3.8.7/ and run 
$./Configure
$ make
$ python -V 
//check above command to see if it returns python version.
$ sudo make install
$chmod 777 -R   </apps/home(location)>//Give execution privileges 


$ bin/csvn-httpd stop
$ bin/csvn-httpd start



Configure SSL for SVN:


SSL Certificate on Tomcat server creation;




openssl req -new -sha256 -nodes -out \your-new-domain.com.csr -newkey rsa:2048 -keyout \your-new-domain.com.key -config <( cat <<-EOF [req] default_bits = 2048 prompt = no default_md = sha256 req_extensions = req_ext distinguished_name = dn [ dn ] C=US ST=New York L=Rochester O=Organization OU=Department/Domain emailAddress=your-administrative-address@your-awesome-existing-domain.com CN = www.your-new-domain.com [ req_ext ] subjectAltName = @alt_names [ alt_names ] DNS.1 = your-new-domain.com DNS.2 = www.your-new-domain.com EOF )


Submit the request over to some Authority like Entrust Authority for digital identity.



Creating a cst certificate for apache server SSL HTTPS

Just rename crt certificate to cst


Use openssl x509 -inform DER -in [certificate name].cer -out [certificate name].crt command to change encoding from .CER file to .CRT