Skip to content

Instantly share code, notes, and snippets.

View achintya-kumar's full-sized avatar
🎯
LOYO

Achintya Kumar achintya-kumar

🎯
LOYO
View GitHub Profile
@achintya-kumar
achintya-kumar / new-hbase-table.scala
Created June 19, 2022 02:49
New HBase table in Scala using TableDescriptorBuilder
val tableDescriptorBuilder = TableDescriptorBuilder
.newBuilder(TableName.valueOf(HBASE_TABLE_NAME))
.setColumnFamily(ColumnFamilyDescriptorBuilder.newBuilder(HBASE_COLUMN_FAMILY.getBytes).build())
.build()
logger.info("Adding column family to the HBase Table")
hBaseAdmin.createTable(tableDescriptorBuilder)
logger.info("HBase Table Successfully Created")
@achintya-kumar
achintya-kumar / install-xfce-gui-and-rdp-on-centos-7.md
Last active May 24, 2024 10:06
Install XFCE GUI and RDP on CentOS 7 #GUI #RDP #CentOS7

Update the system

yum -y install epel-release
yum -y update
yum clean all

Install minimal X Windows system and XFCE Desktop

yum -y groupinstall 'X Window System'
@achintya-kumar
achintya-kumar / docker-compose.yml
Created June 6, 2022 19:16
docker-compose file for Kafka, HBase and Zookeeper together #zk #hbase #kafka
---
version: '3'
services:
zookeeper:
image: confluentinc/cp-zookeeper:7.0.1
container_name: zookeeper
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
@achintya-kumar
achintya-kumar / example-pom-snippet-for-shaded-jar-with-main-class.md
Last active April 28, 2021 14:13
Shaded jar with main-class in jar's manifest
<profiles>
        <profile>
            <id>shade</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                	<!-- In case your 'mvn dependency:analyze' is failing. It may be skipped -->
@achintya-kumar
achintya-kumar / X509 certificate based authentication in OPC UA.md
Last active April 13, 2021 11:16
How to set up X509 certificate based user authentication in Prosys OPC-UA Simulation Server

1. Generate certificate and private key pair

openssl req  -nodes -new -x509  -keyout kumar_key.pem -out kumar_cert.pem

2. Convert the certificate kumar_cert.pem to der format

openssl x509 -inform PEM -outform DER -in kumar_cert.pem -out kumar_cert.der

@achintya-kumar
achintya-kumar / custom-accumulator-v2.scala
Created March 31, 2021 08:55 — forked from girisandeep/custom-accumulator-v2.scala
Create custom accumulator using Scala for Spark 2.x
class MyComplex(var x: Int, var y: Int) extends Serializable{
def reset(): Unit = {
x = 0
y = 0
}
def add(p:MyComplex): MyComplex = {
x = x + p.x
y = y + p.y
return this
@achintya-kumar
achintya-kumar / ScalaHBaseExample.scala
Created November 25, 2020 17:03 — forked from ishassan/ScalaHBaseExample.scala
A hello world example about connecting Scala to HBase
//CHECK ishassan/build.sbt as well
import org.apache.hadoop.hbase.client._
import org.apache.hadoop.hbase.util.Bytes
import org.apache.hadoop.hbase.{CellUtil, HBaseConfiguration, TableName}
import org.apache.hadoop.conf.Configuration
import scala.collection.JavaConverters._
object ScalaHBaseExample extends App{
def printRow(result : Result) = {
@achintya-kumar
achintya-kumar / ValidatorException-fix.md
Last active January 22, 2022 18:27
Fixing ValidatorException for Nexus servers using self-signed certificate #ValidatorException #Nexus #ssl #cert #keytool #cacerts #java #SunCertPathBuilderException

To fix sun.security.validator.ValidatorException: PKIX path building failed…

OR PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Download the SSL certificate of the server:

echo -n | openssl s_client -connect nexus-devportal.de.dmz.tuhuk.de:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /tmp/kumar-pem.cert

Add it to the Java truststore:

@achintya-kumar
achintya-kumar / teamviewer-on-ubuntu.md
Created July 29, 2020 16:02
Installing TeamViewer in Ubuntu #teamviewer #ubuntu #18.04 #20.04

Installing TeamViewer in Ubuntu

sudo apt update -y  && sudo apt upgrade -y
sudo wget https://download.teamviewer.com/download/linux/teamviewer_amd64.deb
sudo apt install ./teamviewer_amd64.deb

# start Teamviewer from terminal
teamviewer
@achintya-kumar
achintya-kumar / gnome-tweaks-on-ubuntu-20.04.md
Last active July 28, 2020 21:08
Installing Tweak Tool on Ubuntu 20.04 LTS Focal Fossa step by step instructions #gnome #tweaks #ubuntu #20.04 #focalfossa

Installing Tweak Tool on Ubuntu 20.04 LTS Focal Fossa step by step instructions

The first step is to make sure that we have the universe repository enabled on our Ubuntu system:

sudo add-apt-repository universe

Once ready, execute the following command to install Tweak Tool on your Ubuntu 20.04 system:

sudo apt install gnome-tweak-tool