##In Brief
You may need to configure a proxy server if you're having trouble cloning
or fetching from a remote repository or getting an error
like unable to access '...' Couldn't resolve host '...'
.
Consider something like:
<?php | |
/** | |
* System Log using monolog | |
*/ | |
$di->set('log', function ($file = 'debug') use ($config, $di) { | |
// Create the logger | |
$logger = new MonoLogger('GEWAER.API'); | |
$client = new Raven_Client('https://' . getenv('SENTRY_RPOJECT_SECRET') . '@sentry.io/' . getenv('SENTRY_PROJECT_ID')); |
-- Firstly, remove PRIMARY KEY attribute of former PRIMARY KEY
ALTER TABLE <table_name> DROP CONSTRAINT <table_name>_pkey;
-- Then change column name of your PRIMARY KEY and PRIMARY KEY candidates properly.
ALTER TABLE <table_name> RENAME COLUMN <primary_key_candidate> TO id;
-- Create a group | |
CREATE ROLE readaccess; | |
-- Grant access to existing tables | |
GRANT USAGE ON SCHEMA public TO readaccess; | |
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess; | |
-- Grant access to future tables | |
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess; |
##connec to the server from this ip to mysql
iptables -A INPUT -i eth0 -p tcp -d xx.xx.xx.xx --dport 3306 -m state --state NEW,ESTABLISHED -j ACCEPT
##connect to the server from this ip
/sbin/iptables -A INPUT -p tcp -s XXX.XXX.XXX.XXX -j ACCEPT
;################################################### | |
; NOTE | |
;#################################################### | |
; change your curl.ini on /etc/php.d/curl.ini | |
; | |
;This config was only tested on amazon AMI | |
;Please check if /etc/ssl/certs/ca-bundle.crt exists | |
; | |
;If you don't have the ca-bundle root certificate you | |
; can get this in |
-- 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%' |
Elastic Load Balancer, CloudFront and Let's Encrypt |
// By default the memory limit in Node.js is 512MB. | |
// This will cause FATAL ERROR- JS Allocation failed – process out of memory when processing large data files. | |
// It can be avoided by increasing the memory limit. | |
node --max_old_space_size=1024 server.js // increase to 1gb | |
node --max_old_space_size=2048 server.js // increase to 2gb | |
node --max_old_space_size=3072 server.js // increase to 3gb | |
node --max_old_space_size=4096 server.js // increase to 4gb | |
node --max_old_space_size=5120 server.js // increase to 5gb | |
node --max_old_space_size=6144 server.js // increase to 6gb |