Skip to content

Instantly share code, notes, and snippets.

View okanmenevseoglu's full-sized avatar
🏠
Working from home

Okan Menevşeoğlu okanmenevseoglu

🏠
Working from home
View GitHub Profile
@okanmenevseoglu
okanmenevseoglu / generate-ssh-key.sh
Last active March 31, 2020 13:40 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
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 January 29, 2018 11:31 — forked from ufuk/JpaEntityQueryBuilder.java
Easy to use query builder for JPA Criteria API (including example usages)
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 January 29, 2018 11:29 — forked from ufuk/postgresql-cryptography-functions.sql
Enable cryptography functions (pgcrypto extension) in PostgreSQL.
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');