Skip to content

Instantly share code, notes, and snippets.

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

Guilherme Caraciolo gcaraciolo

🏠
Working from home
View GitHub Profile
@gcaraciolo
gcaraciolo / nginx.conf
Created February 20, 2017 18:49
Nginx, simple secure server, http and rtmp only local network
worker_processes 1;
error_log logs/rtmp_error.log debug;
pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
@gcaraciolo
gcaraciolo / postgres_queries_and_commands.sql
Created September 8, 2016 18:54 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), 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(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@gcaraciolo
gcaraciolo / deployUser.md
Created January 12, 2016 17:51 — forked from learncodeacademy/deployUser.md
Adding a deploy user in Linux

(wherever it says url.com, use your server's domain or IP)

Login to new server as root, then add a deploy user

sudo useradd --create-home -s /bin/bash deploy
sudo adduser deploy sudo
sudo passwd deploy

And Update the new password

@gcaraciolo
gcaraciolo / debuglog_macro.h
Last active September 18, 2015 02:01 — forked from alanthonyc/debuglog_macro.h
Debug Log Macro for iOS (pulled from zonque's code)
#ifdef ENABLE_DEBUG
#define DebugLog(format, args...) \
NSLog(@"%s, line %d: " format "\n", \
__func__, __LINE__, ## args);
#else
#define DebugLog(format, args...) do {} while(0)
#endif
// sample use
DebugLog("number: %d ; class %p", count, className);