Skip to content

Instantly share code, notes, and snippets.

View nissshh's full-sized avatar
💭
I may be slow to respond.

Nishant Sonar nissshh

💭
I may be slow to respond.
View GitHub Profile
i wanted to recollct what in the Toolibng support for Gradle as compared oto Maven tooling support in Mule Studio . Mulesoft doesnt provide an efective
support for Gradle but few things could be noted
gradel build file - build.gradle
1. Register the plugin in the build
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
follow below step after ou have an host machien at your end be it Cloud or on premise or a dev box, you cant use ubuntu trysty on vagrant+virtualbox
Step 1.
ubuntu@ip-xxx-xx-x-xxx:~$ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.jNZLKNnKte --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
gpg: requesting key 2C52609D from hkp server p80.pool.sks-keyservers.net
gpg: key 2C52609D: public key "Docker Release Tool (releasedocker) <docker@docker.com>" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
@nissshh
nissshh / Hibernat Data Modal
Created January 13, 2017 09:03
A typical data model for sales
Hibernate Sample
Customer
Name
Address
PaymentId
Payment
PaymentId
PaymentType
Order
OrderNumber
At times you may be gated to not checking some files due to dependency on reviewer or functiolnality not completely. Simply say , tha you have to share your changes
and at the same time you cannot chcking. ut you still want to share the change with the team . e.g. change in the bottomose layer like entties and and persistanc layes
One way is to create a new branch and ask other to switch , but this leads to nested merges later on. I found a simply way is to use a patch
I used it via Eclispse PATCH Team>Crat PAtch ... . This will ask you to create multiple patch files depending on your project and then thei patch file can be sahted wiuth the team to appy
locally. Voilla !!
So when thigs are checked in the patch can be removed. This is helpfull when you are mergin and you got issue, You can simply refert the patched files and lonce merge issue areresolved path again.
A very important command that i learnt was a git cherry-pick , that is usefulll in cases wher you want to move only a perticular commit from other branch
to your branch. In regular cases if you merge 2 branches all teh changes (from head) are merged to target.
e.g. git cherry-pick -n <commit>
-n option is important , as the command keeps the changes in your working files, if not given checkes in the change.
Below are the validators
On Terminal 0 I started Validato 0,Rest API 0, settings-tp 0 and identity tp0
1.sudo sawtooth-validator -vv --bind network:tcp://10.34.14.1:8800 --bind component:tcp://10.34.14.1:4004 --peering dynamic --endpoint tcp://10.34.14.1:8800 --scheduler serial --network-auth challenge
2.settings-tp -C tcp://10.34.14.1:4004
3.identity-tp -C tcp://10.34.14.1:4004
4.sawtooth-rest-api -C tcp://10.34.14.1:4004 -B 10.34.14.1:8008
I also registered a valida user for settings as below for user dev.
$sawset proposal create sawtooth.identity.allowed_keys=02a8d5d019a596e979e073dedd559ab23e4982f35d79292e50b94e2aa8e2f5d626 --url http://10.34.14.1:8008
@nissshh
nissshh / MyList.java
Last active June 25, 2018 13:11
Reverse Linked list using recursion without any DS
package com.mc.examples;
import java.util.LinkedList;
import java.util.ListIterator;
public class MyList {
public static void main(String[] args) {
LinkedList<Integer> l = new LinkedList<>();
for (int i = 0; i < 100; i++) {
l.add(i);
I am including some commands for GIT related tasks that can come handy
1. git pull upstream develop ==== pull from base/fork branch original from where we have forked to.
git pull origin develop ===== pull from same org (or forked) repo.
cherry-pick == pick specific checking in a branch. There is a dry run mode and a commit mode.
@nissshh
nissshh / pr.md
Created September 21, 2020 07:15 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@nissshh
nissshh / postgres_queries_and_commands.sql
Created March 26, 2021 16:47 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'