Skip to content

Instantly share code, notes, and snippets.

@jgcasta
jgcasta / install_python_3.6.sh
Created December 26, 2016 15:12
Python 3.6 install
wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz
tar xvf Python-3.6.0.tgz
cd Python-3.6.0
./configure --enable-optimizations
make -j8
sudo make altinstall
python3.6
@jgcasta
jgcasta / sec_tutorial.md
Created March 17, 2017 20:34 — forked from tgrall/sec_tutorial.md
MongoDB Security Tutorial

#Simple MongoDB Security Tutorial

###1 - Start mongod without any "security option"

$ mongod --port 27017

@jgcasta
jgcasta / postgres-cheatsheet.md
Last active January 28, 2018 19:08 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@jgcasta
jgcasta / systemd_config.md
Last active April 23, 2019 06:19
Systemd configuration

Configuration

sudo nano /etc/systemd/system/app.service

Edit file content

[Unit]
Description=APP name service
@jgcasta
jgcasta / git-tags.md
Created June 10, 2019 10:32
Tag releases in git
git add .
git commit -m "commit messge"
git push origin master


git tag -a 0.1.0 -m "tag message"
git push --tags

# delete local tag
@jgcasta
jgcasta / postgres_queries_and_commands.sql
Created December 8, 2019 16:23 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'