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 / 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 / explode-opvn.sh
Created May 19, 2020 11:46 — forked from dleonard00/explode-opvn.sh
extract the certificate and key from an .ovpn file
#!/bin/bash
# This script will extract the certificate and key from an .ovpn file
# into their own files, which makes it possible to use them to configure
# the VPN using Ubuntu's network manager
# Usage example:
# >> ovpnconvert username.dev.ovpn
# You can keep following these instructions here:
@achintya-kumar
achintya-kumar / kill_port_process.sh
Created May 3, 2018 13:25 — forked from marcosvidolin/kill_port_process.sh
Linux: How to list and kill a process using a port
# to list all ports that are used
sudo netstat -ntlp | grep LISTEN
# you can obtain a specific port using the following command
sudo netstat -ntlp | grep :8080
# when you execute the command above you will see some thing like that
tcp 0 0 0.0.0.0:27370 0.0.0.0:* LISTEN 4394/skype
tcp 0 0 127.0.1.1:53 0.0.0.0:* LISTEN 2216/dnsmasq
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 4912/cupsd