Skip to content

Instantly share code, notes, and snippets.

View Laxman-SM's full-sized avatar

Laxman Singh Laxman-SM

  • Ex-Phenome, Ex-Intertrust, Ex-Wipro
  • US, Hyderabad (india)
View GitHub Profile
#!/bin/bash
export uuid=$(uuidgen)
echo "$uuid" >> outfile.txt
#sed -i "s/node.id=$uuid/node.id=$uuid/g" hello.txt
sed -i "s/#node.id=__uuidgen__/node.id=$uuid/g" node.properties
cat ./node.properties
@Laxman-SM
Laxman-SM / HadoopHiveSparkHBase
Created February 11, 2020 07:42 — forked from thanoojgithub/HadoopHiveSparkHBase
Hadoop Hive Spark configuration on Ubuntu 16.04
sudo apt-get install ssh
sudo apt-get install rsync
sudo apt install openssh-client
sudo apt install openssh-server
ssh localhost
ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
@Laxman-SM
Laxman-SM / mysql-docker.sh
Created February 4, 2020 10:40 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@Laxman-SM
Laxman-SM / Dockerfile
Created February 4, 2020 09:36 — forked from bbachi/Dockerfile
docker multi build example
FROM node:10 AS ui-build
WORKDIR /usr/src/app
COPY WebApp/ ./WebApp/
RUN cd WebApp && npm install @angular/cli && npm install && npm run build
FROM node:10 AS server-build
WORKDIR /root/
COPY --from=ui-build /usr/src/app/WebApp/dist ./WebApp/dist
COPY package*.json ./
RUN npm install
@Laxman-SM
Laxman-SM / Dockerfile
Created February 4, 2020 09:36 — forked from bbachi/Dockerfile
docker multi build example
FROM node:10
# set the work directory
WORKDIR /usr/src/app
# copy package.json
COPY package*.json ./
# copy webapp folder
COPY WebApp/package*.json ./WebApp/
@Laxman-SM
Laxman-SM / createvm.sh
Created February 3, 2020 09:31 — forked from agrawalreetika/createvm.sh
Vm creation for setting up presto coordinator and worker
#Create resource group in azure to keep all the resources.
ResourceGroupName="PrestoResourceGroup"
Location="eastus"
Subscription="Azure-Subscription-Name"
az group create --name $ResourceGroupName --location $Location --subscription $Subscription
#Create vnet and 2 VMs one for Presto coordinator and one for Presto worker
CoordinatorName="presto-coordinator-vm"
WorkerName="presto-worker-vm"
@Laxman-SM
Laxman-SM / coordinator_setup.sh
Created February 3, 2020 09:31 — forked from agrawalreetika/coordinator_setup.sh
This has all the steps to setup presto coordinator on VM.
# Install wget
sudo yum install -y wget
# Setup Presto
sudo mkdir -m757 -p /var/presto/data
cd /usr/lib/
sudo wget https://repo1.maven.org/maven2/io/prestosql/presto-server/325/presto-server-325.tar.gz
sudo tar xvzf presto-server-325.tar.gz
sudo mv presto-server-325 presto
sudo rm presto-server-325.tar.gz
@Laxman-SM
Laxman-SM / worker_imager_create.sh
Created February 3, 2020 09:31 — forked from agrawalreetika/worker_imager_create.sh
This includes steps to create presto worker image.
# De-allocate and generalize the VMs in order to create an image.
# A VM that has been generalized can no longer be restarted.
ResourceGroupName="PrestoResourceGroup"
WorkerName="presto-worker-vm"
ImageName="presto-worker-image"
Subscription="Azure-Subscription-Name"
az vm deallocate \
--subscription $Subscription \
@Laxman-SM
Laxman-SM / azure-site.xml
Created February 3, 2020 09:28 — forked from agrawalreetika/azure-site.xml
This file contains configuration for Azure app that will be required to access azure Gen1 and Gen2 storage
<configuration>
<!-- Configuration for accessing Gen1 storage adl -->
<property>
<name>dfs.adls.oauth2.access.token.provider.type</name>
<value>ClientCredential</value>
</property>
<property>
<name>dfs.adls.oauth2.refresh.url</name>
<value>{Oauth2.0-endpoint}</value>
</property>
@Laxman-SM
Laxman-SM / create-jobs.groovy
Created February 3, 2020 09:23 — forked from ealebed/create-jobs.groovy
Groovy script for creating Jenkins job from .yaml file
@Grab(group='org.yaml', module='snakeyaml', version='1.18')
import jenkins.model.*
import hudson.model.*
import hudson.tasks.LogRotator
import hudson.plugins.git.*
import hudson.plugins.git.extensions.*
import hudson.plugins.git.extensions.impl.*
import org.jenkinsci.plugins.workflow.job.WorkflowJob
import org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition
import org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty