Skip to content

Instantly share code, notes, and snippets.

View madgrk's full-sized avatar

Ioannis Angelis madgrk

View GitHub Profile
@madgrk
madgrk / vscode-java.prefs
Created February 2, 2024 11:39
VSCode Java Serial Number Warning
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
@madgrk
madgrk / vscode_extensions.txt
Created February 2, 2024 11:34
VSCode backup - restore extensions
1. Backup extensions
code --list-extensions >> vs_code_extensions_list.txt
2. Restore extensions
cat vs_code_extensions_list.txt | xargs -n 1 code --install-extension
3. Uninstall extensions
code --list-extensions | xargs -n 1 code --uninstall-extension
@madgrk
madgrk / unbound_root_key_fix.txt
Last active February 2, 2024 11:35
unbound rasbian root.key
Could you post content of above file here first pls?
cat /var/lib/unbound/root.key
To try and fix that file, stop unbound with below:
sudo systemctl stop unbound
Remove the broken file with below:
@madgrk
madgrk / PoolingHttpClient
Created January 17, 2024 10:39 — forked from arganzheng/PoolingHttpClient
An HttpClient with PoolingHttpClientConnectionManager
package org.opentsdb.client;
import static com.google.common.base.Preconditions.checkArgument;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import org.apache.commons.lang.StringUtils;
import org.apache.http.HeaderElement;
import org.apache.http.HeaderElementIterator;
@madgrk
madgrk / install_postaman.sh
Created January 11, 2024 04:01 — forked from lucasalvessouza/install_postaman.sh
Install postman fedora
#!/bin/bash
wget https://dl.pstmn.io/download/latest/linux64 -O postman-linux-x64.tar.gz
sudo tar xvzf postman-linux-x64.tar.gz -C /opt
sudo ln -s /opt/Postman/Postman /usr/bin/postman
cat << EOF > ~/.local/share/applications/postman2.desktop
[Desktop Entry]
Name=Postman
GenericName=API Client
@madgrk
madgrk / ora_create_user.sql
Created June 2, 2022 10:44
Oracle 10g Create User
CREATE USER "NEWUSER" PROFILE "DEFAULT" IDENTIFIED BY "newpassword" PASSWORD EXPIRE DEFAULT TABLESPACE "USERS" TEMPORARY TABLESPACE "TEMP" QUOTA UNLIMITED ON "USERS";
ALTER USER "NEWUSER" ACCOUNT UNLOCK;
-- ROLES
GRANT "CONNECT" TO "NEWUSER";
GRANT "RESOURCE" TO "NEWUSER";
-- SYSTEM PRIVILEGES
GRANT CREATE ROLE TO "NEWUSER";
@madgrk
madgrk / allEntities.java
Created September 30, 2021 07:41
Selecting all jpa entities as selection query
@PersistenceContext
EntityManager em;
protected Class<T> type;
public List<T> allEntries() {
CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<T> cq = cb.createQuery(type);
Root<T> rootEntry = cq.from(type);
@madgrk
madgrk / criteria.java
Created September 30, 2021 07:37
JPA SingularAttribute on Criteria Query
public abstract class GenericDAOImpl<T extends DomainObject, T2 extends DomainObject> implements GenericDAO<T, T2> {
private Class<T> type;
@PersistenceContext
protected EntityManager entityManager;
public GenericDAOImpl(Class<T> type) {
super();
this.type = type;
@madgrk
madgrk / settings.xml
Created September 29, 2021 18:23
Maven settings.xml for JBoss EAP
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>${user.home}/.m2/repository</localRepository>
<profiles>
<profile>
<id>securecentral</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<!--Override the repository (and pluginRepository) "central" from the
@madgrk
madgrk / settings.xml
Last active September 29, 2021 18:24
Maven Eclipse maven settings
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 http://maven.apache.org/xsd/settings-1.2.0.xsd">
<profiles>
<profile>
<id>redhat-ga-repository</id>
<repositories>
<repository>
<id>redhat-ga-repository</id>
<name>Red Hat GA repository</name>
<url>http://maven.repository.redhat.com/ga/</url>