Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Okan Menevşeoğlu okanmenevseoglu

🏠
Working from home
View GitHub Profile
@okanmenevseoglu
okanmenevseoglu / generate-ssh-key.sh
Last active Mar 31, 2020 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
View generate-ssh-key.sh
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa
@okanmenevseoglu
okanmenevseoglu / EntityQuery.java
Created Jan 29, 2018 — forked from ufuk/JpaEntityQueryBuilder.java
Easy to use query builder for JPA Criteria API (including example usages)
View EntityQuery.java
package ...;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import javax.persistence.EntityManager;
import javax.persistence.TypedQuery;
import javax.persistence.criteria.*;
import java.util.*;
import java.util.stream.Collectors;
@okanmenevseoglu
okanmenevseoglu / postgresql-cryptography-functions.sql
Created Jan 29, 2018 — forked from ufuk/postgresql-cryptography-functions.sql
Enable cryptography functions (pgcrypto extension) in PostgreSQL.
View postgresql-cryptography-functions.sql
CREATE EXTENSION pgcrypto;
-- Examples
SELECT ENCODE(DIGEST('password', 'md5'), 'hex');
SELECT ENCODE(DIGEST('password', 'sha1'), 'hex');
SELECT ENCODE(DIGEST('password', 'sha224'), 'hex');
SELECT ENCODE(DIGEST('password', 'sha256'), 'hex');
SELECT ENCODE(DIGEST('password', 'sha384'), 'hex');
SELECT ENCODE(DIGEST('password', 'sha512'), 'base64');