Skip to content

Instantly share code, notes, and snippets.

View jgregorio0's full-sized avatar

jgregorio jgregorio0

View GitHub Profile
@jgregorio0
jgregorio0 / oracle-plan.md
Last active July 17, 2025 06:49
Analyze queries in Oracle
  1. Run explain execution plan on DBeaver instead of execute SQL query

  2. Otherwise, get the execution plan when executing a specified SQL statement:

EXPLAIN PLAN FOR
SELECT * FROM TRAINERS;

SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL, NULL, 'ALLSTATS LAST'));
  1. name a stash:
git stash push -m "named-stash"
  1. retrieve a stash by name:
git stash apply stash^{/named-stash}
@jgregorio0
jgregorio0 / eclipse-language-server-background-job.md
Created March 4, 2024 08:46
Language server background job loading slow down eclipse performance

Language server background job loading slow down eclipse performance

Ref: https://stackoverflow.com/questions/74764368/how-to-get-rid-from-language-server-background-job-its-irritating-too-much-as-we

  1. When we click Window Menu > Preferences > Langauge Server > Spring Langauge Server > Spring Boot Langauge Server > Checkbox : True Start Language Server at startuo when Spring Boot is a dependency preference setting. Spring Boot Langauge Server

  2. When we click Window Menu > Preferences > Langauge Server > Spring Langauge Server > Spring Boot Langauge Server > Open Rewrite > Checkbox : False Uncheck all Items Open Rewrite

  3. Click on Apply and Close button

  1. For an HTML like this:
<td style="
    display: flex;
    justify-content: center;
    align-items: center;">
    
    <span >texto</span>
    <button type="button" title="Link to inventory user detail" class="p-element p-button-link p-button p-component">
 <i class="pi pi-external-link"></i>
  1. Generate keystore
keytool -genkeypair -alias test -keyalg RSA -keysize 2048 -storetype JKS -keystore test.jks -validity 365 -storepass password
  1. Verify keystore
keytool -list -v -storetype JKS -keystore test.jks 
  1. Show max connections configured
SHOW max_connections;
  1. Count how many connections are active currently
SELECT count(*) FROM pg_stat_activity;

Add logger DEBUG for file /src/main/resources/logback-spring.xml

<logger name="org.hibernate.SQL" level="DEBUG"/>
<logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="DEBUG"/>
  1. Get all keys from Redis
@Test
	public void testRedis() {
		//awsAccountIds
		//euigs-shared-base-access-control-onelogin-update-idp-stackset
		RedisStandaloneConfiguration redisConfig = new RedisStandaloneConfiguration("localhost", 6379);
		LettuceConnectionFactory connectionFactory = new LettuceConnectionFactory(redisConfig);
		connectionFactory.afterPropertiesSet();
		Set<byte[]> keys = connectionFactory.getConnection().keys("*".getBytes());
  1. Create dockerfile
#Install python
FROM python:3.10
#Declaring working directory in our container
WORKDIR /src
# Add OPENAI_API_KEY variable
ARG openai
ENV OPENAI_API_KEY $openai
#Copy and install requirements