Skip to content

Instantly share code, notes, and snippets.

View zafergurel's full-sized avatar
🏀
Focusing

Zafer Gürel zafergurel

🏀
Focusing
  • CTO@Perculus / PhDc@Ozyegin Uni.
  • İstanbul
  • X @xaferel
View GitHub Profile
@zafergurel
zafergurel / postgres_queries_and_commands.sql
Last active February 20, 2024 00:46 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- https://www.geekytidbits.com/performance-tuning-postgres/
-- http://www.craigkerstiens.com/2012/10/01/understanding-postgres-performance/
-- http://okigiveup.net/what-postgresql-tells-you-about-its-performance/
-- https://wiki.postgresql.org/wiki/Introduction_to_VACUUM,_ANALYZE,_EXPLAIN,_and_COUNT
-- https://devcenter.heroku.com/articles/postgresql-indexes#b-trees-and-sorting
-- http://www.databasesoup.com/2014/05/new-finding-unused-indexes-query.html
-- performance tools
-- https://www.vividcortex.com/resources/network-analyzer-for-postgresql
-- show running queries (pre 9.2)
@zafergurel
zafergurel / psql_useful_stat_queries.sql
Last active April 5, 2019 12:10 — forked from anvk/psql_useful_stat_queries.sql
List of some useful Stat Queries for PSQL
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB.
------------
-- Basics --
------------
-- Get indexes of tables (postgres tables excluded)
@zafergurel
zafergurel / Howto convert a PFX to a seperate .key & .crt file
Created December 3, 2017 20:17 — forked from jesperronn/Howto convert a PFX to a seperate .key & .crt file
How to convert a .pfx SSL certificate to .crt/key (pem) formats. Useful for NGINX
source: http://www.markbrilman.nl/2011/08/howto-convert-a-pfx-to-a-seperate-key-crt-file/
`openssl pkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key]`
What this command does is extract the private key from the .pfx file. Once entered you need to type in the importpassword of the .pfx file. This is the password that you used to protect your keypair when you created your .pfx file. If you cannot remember it anymore you can just throw your .pfx file away, cause you won’t be able to import it again, anywhere!. Once you entered the import password OpenSSL requests you to type in another password, twice!. This new password will protect your .key file.
Now let’s extract the certificate:
`openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [certificate.crt]`