Skip to content

Instantly share code, notes, and snippets.

View Kurukshetran's full-sized avatar

Kurukshetran Kurukshetran

View GitHub Profile
@Kurukshetran
Kurukshetran / Application.java
Created October 8, 2020 09:15 — forked from serac/Application.java
Configuring RestTemplate for Client TLS in a Spring Boot Application
/*
* See LICENSE for licensing and NOTICE for copyright.
*/
package edu.vt.middleware.app;
import java.io.File;
import java.security.*;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Predicate;
@Kurukshetran
Kurukshetran / gist:1f24885b57690a0715fc1248977fb8c7
Created September 19, 2020 10:06 — forked from douglasjarquin/gist:2208690
Amazon RDS Performance Tuning Settings
rds-modify-db-parameter-group {param-group-name} \
--parameters="name=character_set_server, value=utf8, method=pending-reboot" \
--parameters="name=collation_server, value=utf8_general_ci, method=pending-reboot" \
--parameters="name=tmp_table_size, value={DBInstanceClassMemory/16}, method=pending-reboot" \
--parameters="name=max_heap_table_size, value={DBInstanceClassMemory/16}, method=pending-reboot" \
--parameters="name=query_cache_type, value=1, method=pending-reboot" \
--parameters="name=query_cache_size, value=131072, method=pending-reboot" \
--parameters="name=table_open_cache, value=2500, method=pending-reboot" \
--parameters="name=join_buffer_size, value={DBInstanceClassMemory/64}, method=pending-reboot" \
--parameters="name=thread_cache_size, value={DBInstanceClassMemory/12582880}, method=pending-reboot" \
@Kurukshetran
Kurukshetran / dlAttachments.py
Created August 25, 2020 13:06 — forked from baali/dlAttachments.py
Python script to download all gmail attachments.
# Something in lines of http://stackoverflow.com/questions/348630/how-can-i-download-all-emails-with-attachments-from-gmail
# Make sure you have IMAP enabled in your gmail settings.
# Right now it won't download same file name twice even if their contents are different.
import email
import getpass, imaplib
import os
import sys
detach_dir = '.'
@Kurukshetran
Kurukshetran / email_attachments_download.py
Created August 25, 2020 13:06 — forked from kngeno/email_attachments_download.py
A python script to download email attachments from specific email addresses
"""
Python 2.7/3.6 compatible
GMAIL Accounts
A script to download email attachments from specific email addresses
Please edit the following details to work:
YOUR_EMAIL_ADDRESS
YOUR_EMAIL_PASSWORD
LABEL - Inbox, Trash, Archive, ...
RECEIVING_EMAIL_ADDRESS
RECEIVING_SUBJECT - '*' for all OR 'Title of Subject'
@Kurukshetran
Kurukshetran / user.js
Created August 20, 2020 09:43 — forked from EtienneR/user.js
XMLHttpRequest RESTful (GET, POST, PUT, DELETE)
// Get all users
var url = "http://localhost:8080/api/v1/users";
var xhr = new XMLHttpRequest()
xhr.open('GET', url, true)
xhr.onload = function () {
var users = JSON.parse(xhr.responseText);
if (xhr.readyState == 4 && xhr.status == "200") {
console.table(users);
} else {
console.error(users);
@Kurukshetran
Kurukshetran / _ocr2.py
Created July 23, 2020 12:38 — forked from dmgig/_ocr2.py
Multithreaded OCR Process with Tesseract, TEXTCLEANER, and imagemagick
#!/usr/bin/python
import os
import sys
import getopt
import subprocess
import time
import pytesseract
import argparse
import cv2
@Kurukshetran
Kurukshetran / apache-balancer.sh
Created June 25, 2020 07:11 — forked from SeonghoonKim/apache-balancer.sh
Apache HTTPD balancer-manager control script
#! /bin/sh
# Set up a default search path
PATH="/usr/bin:/bin"
CURL=`which curl`
if [ -z "$CURL" ]; then
echo "curl not found"
exit 1
fi
@Kurukshetran
Kurukshetran / AMQMOnitorConf.py
Created January 3, 2020 06:53 — forked from Abhinav2510/AMQMOnitorConf.py
AMQ Monitoring and Email Alerts script
#Replace localhost with your servername
#Change username and password accordingly
#Alert can be applied on JVM Heap and Queue parameters
#Alert format is
# param=Name of parameter on whose value you want to put alert
# thresholdVal= Value againsts which current value of param will be evaluated as per condition
# condition= denotes how to compare thresholdVal and current value of parameter.
# Possible values are as below:
# lt - Alert will be raised if current value is less than thresholdVal
# gt - Alert will be raised if current value is greater than thresholdVal
@Kurukshetran
Kurukshetran / Google Script Cache-Busting IMPORTHTML.md
Created October 22, 2019 15:22 — forked from willinspire/Google Script Cache-Busting IMPORTHTML.md
It is not easy to refresh the IMPORTHTML functions in Google Sheets due to cashe limitations. The resulting limitations are old data instead of new data being pulled into the Sheet upon running a Script to reload the IMPORTHTML function. This Google Script is a "Cache-Busting" function which circumvents this problem.
// Set your variables below
SHEET_NAME="MC-Import-Data"
URL="https://coinmarketcap.com/currencies/views/all/"

// Create a trigger to refresh every 5 minutes
function myFunctionA() {
  ScriptApp.newTrigger("getData")
  .timeBased()
 .everyMinutes(5)

Motivation

Integrate JMH (Java Microbenchmarking Harness) with Spring (Boot) and make developing and running benchmarks as easy and convinent as writing tests.

Idea

Wrap the necessary JMH boilerplate code within JUnit to benefit from all the existing test infrastructure Spring (Boot) provides. It should be as easy and convinent to write benchmarks as it is to write tests.

TL;DR;