Skip to content

Instantly share code, notes, and snippets.

@Fabricio20
Fabricio20 / JPA-FULL-TEXT-SEARCH.md
Created November 22, 2022 16:19
Spring Boot JPA Full Text Search

This is a small guide on how to get database-specific full text search working on Spring JPA. Before you proceed, make sure you actually need full text search. Full text search is about matching words against words, not partial words against words, so depending on your use case, a simple like %data% operator can be a better user experience.

As an example, if your dataset looks like this:

id | name
------------------
0  | reimu hakurei
1  | suwako moriya
@Fabricio20
Fabricio20 / DiscordInterceptor.java
Created November 5, 2021 12:44
JDA Inteceptor for Twilight
import okhttp3.HttpUrl;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;
import org.jetbrains.annotations.NotNull;
import java.io.IOException;
public class DiscordInterceptor implements Interceptor {
@Fabricio20
Fabricio20 / US_INTL_BR_KEYBOARD
Last active July 12, 2020 20:12
Fix International Input on US Keyboards
### Original
https://forum.manjaro.org/t/setting-up-windows-macos-style-us-international-layout-in-manjaro-cedilla-accents-etc/133431/8
### Xcompose
https://github.com/raelgc/win_us_intl
@Fabricio20
Fabricio20 / Iptables.md
Last active December 4, 2020 11:36
Iptables cheatsheet.

Iptables cheatseet

Good to know: Iptables reads rules from top to bottom, stopping at the first rule that matches.

Terms

chain: group of rules (Default ones are INPUT, OUTPUT and FORWARD).

target: What to do with a packet (Often used are ACCEPT, DROP (No echo/"offline"), REJECT (Echoes back 'not authorized icmp')).

Targets

@Fabricio20
Fabricio20 / docker-compose.yml
Created July 9, 2018 18:38
Dockerized Sentry
version: '2'
volumes:
pgdb:
services:
sentry_redis:
image: redis
sentry_postgres:
image: postgres
environment:
POSTGRES_USER: sentry
@Fabricio20
Fabricio20 / docker-compose.yml
Created July 9, 2018 18:36
Dockerized Grafana + Prometheus + GrayLog
version: '2'
services:
mongo:
image: "mongo:3"
volumes:
- ./mongo:/data/db
graylog:
image: graylog2/server:2.1.1-1
environment:
GRAYLOG_PASSWORD_SECRET: GRAYLOG_PASSWORD
Windows Registry Editor Version 5.00
; Created by: Shawn Brink
; Created on: January 14th 2016
; Tutorial: https://www.tenforums.com/tutorials/37432-add-lock-drive-context-menu-bitlocker-drives-windows-10-a.html
; Needs the file below (VB file) on System32
[HKEY_CLASSES_ROOT\Drive\shell\lock-bde]
"AppliesTo"="System.Volume.BitLockerProtection:=1 OR System.Volume.BitLockerProtection:=3 OR System.Volume.BitLockerProtection:=5 NOT C:"
@Fabricio20
Fabricio20 / ReadMe.md
Last active November 7, 2023 04:37
Docker - Nginx + PHP FPM + MariaDB + PhpMyAdmin

Docker

This is a docker-compose template for a lemp stack.

Make sure to change both the root password under the mysql service, and the absolute URI on the phpmyadmin container.
You can also expose phpMyAdmin locally instead of remotely by properly configuring the ports.

Default locations:
(Original) -> (Your server)
/var/www/html -> ./webroot
/etc/nginx -> ./nginx

>scheduling jitter
total measurement interval: 735.587 milliseconds
measurement latency: 0.25424 milliseconds
average above measurement: 0.477161 milliseconds
worst case (this is what matters): 50.3514 milliseconds
@Fabricio20
Fabricio20 / Users-Service.md
Last active June 21, 2017 22:51
DiscordBans RESTful Responses

PATH: /users/{id}
METHOD: GET
Description: Returns a user profile (with all info).

{
    "heat": 10,
    "names": [
        {
            "name": "LewdBot",
            "time": {