Monthly Archives: May 2018

Tableau Server Self signed certificate process for both web page and Tableau Desktop

Step1:

C:\Program Files\Tableau\Tableau Server\2018.1\apache\bin>openssl.exe genrsa -out celcom.key 4096
Generating RSA private key, 4096 bit long modulus
……………………………..++
………………………………………………………………………………………………………………………………++
e is 65537 (0x10001)

C:\Program Files\Tableau\Tableau Server\2018.1\apache\bin>openssl.exe req -new -key celcom.key -out celcom.csr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.’, the field will be left blank.
—–
Country Name (2 letter code) [AU]:MY
State or Province Name (full name) [Some-State]:Selangor
Locality Name (eg, city) []:city
Organization Name (eg, company) [Internet Widgits Pty Ltd]:XYZ Technologies (Malaysia) Sdn. Bhd
Organizational Unit Name (eg, section) []:IT
Common Name (e.g. server FQDN or YOUR name) []:10.0.0.1
Email Address []:abc@xyz.com

Please enter the following ‘extra’ attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:

C:\Program Files\Tableau\Tableau Server\2018.1\apache\bin>openssl.exe x509 -in celcom.csr -out celcom.crt -req -signkey celcom.key -days 365
Signature ok
subject=/C=MY/ST=Selangor/L=city/O=XYZTechnologies (Malaysia) Sdn. Bhd/OU=IT/CN=10.0.0.1/emailAddress=abc@xyz.com
Getting Private key

Step2:

stop tableau admin service

Image 107

 

Click from windows start menu

Image 105

 

Image 106

NOTE: Place the .crt files in C:\Program Files\Tableau\Tableau Server\SSL   Directory

start tableau admin service

Image 107

 

manually right click celcom.crt certificate in the client and server pcs and install certificate as  below.

 

Image 108

FTP incremental upload recursively in java

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.xxxx.xxxx.ftp;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.io.IOUtils;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPReply;

/**
*
* @author Nanaji
*/

public class ftprecursion {
static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(ftprecursion.class);
FileWriter filelist = null;
List<String> lines=null;
public ftprecursion() {
try {
filelist = null;
lines=null;
String remoteDirPath = Configuration.getString(“ftp.path.remote”);
String localDirPath = Configuration.getString(“ftp.path.local”);
saveFilesToServer(remoteDirPath,new File(localDirPath));
} catch (IOException ex) {
Logger.getLogger(ftprecursion.class.getName()).log(Level.SEVERE, null, ex);
}
}
public void saveFilesToServer(String remoteDest, File localSrc) throws IOException {
String server = Configuration.getString(“ftp.site.host”);
int port = Configuration.getInt(“ftp.site.port”);
String user = Configuration.getString(“ftp.site.username”);
String pass = Configuration.getString(“ftp.site.password”);
lines = Files.readAllLines(Paths.get(localSrc.getAbsolutePath()+”/list.txt”));
if(!new File(localSrc.getAbsolutePath()+”/list.txt”).exists()){
new File(localSrc.getAbsolutePath()+”/list.txt”).createNewFile();
}
filelist = new FileWriter(localSrc.getAbsolutePath()+”/list.txt”,true);
FTPClient ftp = new FTPClient();
ftp.connect(server,port);
if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) {
ftp.disconnect();
log.fatal(“FTP not disconnected”);
}

ftp.login(user, pass);
log.info(“Connected to server .”);
log.info(ftp.getReplyString());

ftp.changeWorkingDirectory(remoteDest);
ftp.setFileType(FTPClient.BINARY_FILE_TYPE);

try {
upload(localSrc, ftp);
}
finally {
ftp.disconnect();
log.info(“FTP disconnected”);
filelist.flush();
filelist.close();
}
}

public void upload(File src, FTPClient ftp) throws IOException {
if (src.isDirectory()) {
ftp.makeDirectory(src.getName());
ftp.changeWorkingDirectory(src.getName());
for (File file : src.listFiles()) {
upload(file, ftp);
}
ftp.changeToParentDirectory();
}
else {
InputStream srcStream = null;
try {
if(!lines.contains(src.getAbsolutePath())) {
log.info(” uploading “+src.getName());
srcStream = src.toURI().toURL().openStream();
ftp.storeFile(src.getName(), srcStream);
log.info(” uploaded “+src.getName());
filelist.write(src.getAbsolutePath()+”\n”);
}
else{
log.info(” File already uploaded “+src.getAbsolutePath());
}
}
finally {
IOUtils.closeQuietly(srcStream);
}
}
}
public static void main(String[] args) {
new ftprecursion();
}
}

unique arraylist

list = (ArrayList) list.stream().distinct().collect(Collectors.toList());

increase redhat 7 display resolution

xrandr -s 1920×1080

epel release add

## RHEL/CentOS 7 64-Bit ##
# wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# rpm -ivh epel-release-latest-7.noarch.rpm

Yum install through proxy

vi /etc/yum.conf

 

proxy=http://proxy.xxxx.com:8080
# The account details for yum connections
proxy_username=nanaji
proxy_password=nanaji

wget with proxy authentication

 

vi ~/.wgetrc

 

http_proxy = proxy.xxxx.com:8080
https_proxy = proxy.xxx.com:8080
ftp_proxy = proxy.xxx.com:8080
proxy_user = nanaji
proxy_passwd = nanaji

wget http://www.python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz –no-check-certificate