Skip to content

Instantly share code, notes, and snippets.

View shortthirdman's full-sized avatar
🎯
Focusing

Swetank Mohanty shortthirdman

🎯
Focusing
View GitHub Profile
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.web.filter.OncePerRequestFilter;
import org.springframework.web.util.ContentCachingRequestWrapper;
import org.springframework.web.util.ContentCachingResponseWrapper;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
@Rhyssmcm
Rhyssmcm / LanekeepingQ1part2.py
Last active October 28, 2020 14:51
(Q1.1) Plot the trajectory of the vehicle on the X-Y plane
import numpy as np
from scipy.integrate import solve_ivp
import matplotlib.pyplot as plt
class PidController:
"""PidController
Documentation goes here
"""
@drmalex07
drmalex07 / README-fail2ban-keycloak.md
Last active July 29, 2024 21:25
Use fail2ban to block brute-force attacks to keycloak server. #keycloak #fail2ban #brute-force-attack

Add regular-expression filter under /etc/fail2ban/filter.d/keycloak.conf:

[INCLUDES]

before = common.conf

[Definition]

_threadName = [a-z][-_0-9a-z]*(\s[a-z][-_0-9a-z]*)*
_userId = (null|[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active May 22, 2025 11:37
crack activate Office on mac with license file
@drmalex07
drmalex07 / README-tomcat-as-systemd-service.md
Last active February 26, 2025 15:22
An example configuration for Tomcat as systemd service. #tomcat #systemd #systemd.service

README

Let Tomcat is download and installed under /opt/tomcat. Also, let tomcat be a non-provileged user under which the server will be running.

We assume that we keep server's binaries under /opt/tomcat and we will create a server instance named foo under /var/tomcat/ (carrying its own conf, logs, webapps, work, lib directories). See also https://dzone.com/articles/running-multiple-tomcat.

Create a template service unit file at /etc/systemd/system/[email protected]:

@aVolpe
aVolpe / package.json
Last active July 20, 2022 12:32
Build a angular-cli project with maven
{...
"scripts": {
"ng": "ng",
"start": "ng serve --proxy-config proxy.conf.json",
"clean": "rm -rf dist",
"build-prod": "yarn install && ng build -prod",
"build-dev": "yarn install && ng build -dev",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
@martinhynar
martinhynar / zookeeper.service
Created June 2, 2017 10:56
ZooKeeper SystemD Service Unit File
[Unit]
Description=ZooKeeper Service
Documentation=http://zookeeper.apache.org
Requires=network.target
After=network.target
[Service]
Type=forking
User=zookeeper
Group=zookeeper
@wy193777
wy193777 / download.py
Last active November 7, 2024 13:23
Download file through HTTP using requests.py and tqdm
"""
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
@bluekvirus
bluekvirus / jersey-hibernate-mariadb-tomcat.md
Created January 23, 2017 22:53
Develop a Jersey (Restful Web) Application using Hibernate and MariaDB

Develop a Jersey Application using Hibernate and MariaDB

@credit Yan Zhu (https://github.com/nina-zhu)

Introduction

Jersey is the most popular amongst Restful web service development. Latest Jersey 2.x version has been developed by Oracle/Glassfish team in accordance with JAX-RS 2.0 specification. Earlier Jersey 1.x version was developed and supported by Oracle/Sun team.

Latest Jersey release version is 2.25 see here and look documentation and API for details. We will implement a Jersey example in this article based on latest 2.x version.

In this article, we will use Hibernate's rich API to interact with MariaDB database or in general any ORM compliant database. We will create a