Skip to content

Instantly share code, notes, and snippets.

View arjunKumbakkara's full-sized avatar
💭
Focus

Arjun Kumbakkara arjunKumbakkara

💭
Focus
  • 6d Technologies pvt ltd.
  • Bangalore ,Karnataka , India
View GitHub Profile
@arjunKumbakkara
arjunKumbakkara / pyuac.py
Created March 5, 2020 20:25 — forked from sylvainpelissier/pyuac.py
pyuac - elevate a Python process with UAC on Windows compatible Python 3.
#!/usr/bin/env python
# -*- coding: utf-8; mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vim: fileencoding=utf-8 tabstop=4 expandtab shiftwidth=4
"""User Access Control for Microsoft Windows Vista and higher. This is
only for the Windows platform.
This will relaunch either the current script - with all the same command
line parameters - or else you can provide a different script/program to
run. If the current user doesn't normally have admin rights, he'll be
@arjunKumbakkara
arjunKumbakkara / ubuntu-install-nodejs-npm.sh
Created April 19, 2018 10:38 — forked from kolosek/ubuntu-install-nodejs-npm.sh
Install node.js version 6.x Ubuntu 16.04
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
echo "Installing NodeJS 6.x"
sudo apt-get install nodejs
echo "Install webpack globally"
sudo npm install webpack -g
echo "Install nightwatch globally"
sudo npm install webpack -g
@arjunKumbakkara
arjunKumbakkara / ClientHelper.java
Last active April 28, 2019 08:17 — forked from outbounder/ClientHelper.java
jersey client helper for trusting all certificates in SSL/TLS
import java.security.SecureRandom;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
@arjunKumbakkara
arjunKumbakkara / PaginationDiscoverabilityListener.java
Created December 7, 2017 10:11 — forked from eugenp/PaginationDiscoverabilityListener.java
Pagination with REST - the Discoverability Listener full
package org.baeldung.web.hateoas;
import javax.servlet.http.HttpServletResponse;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
import org.springframework.web.util.UriComponentsBuilder;
import com.google.common.base.Preconditions;
@arjunKumbakkara
arjunKumbakkara / PaginationDiscoverabilityListener.java
Created December 7, 2017 10:11 — forked from eugenp/PaginationDiscoverabilityListener.java
Pagination with REST - the Discoverability Listener full
package org.baeldung.web.hateoas;
import javax.servlet.http.HttpServletResponse;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
import org.springframework.web.util.UriComponentsBuilder;
import com.google.common.base.Preconditions;
@arjunKumbakkara
arjunKumbakkara / CustomErrorController.java
Created February 13, 2017 07:20 — forked from jonikarppinen/CustomErrorController.java
Example of replacing Spring Boot "whitelabel" error page with custom error responses (with JSON response body)
package com.company.project.controllers;
import com.company.project.model.api.ErrorJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.web.ErrorAttributes;
import org.springframework.boot.autoconfigure.web.ErrorController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.RequestAttributes;
@arjunKumbakkara
arjunKumbakkara / Messages.java
Created February 6, 2017 06:39 — forked from jonikarppinen/Messages.java
Example of using message resources in Spring Boot service layer code, in as simple way as possible (hopefully!)
package com.company.project.components;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.context.support.MessageSourceAccessor;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.Locale;