Skip to content

Instantly share code, notes, and snippets.

View edwinpgm's full-sized avatar
🏡
Remotely

Edwin Gonzales edwinpgm

🏡
Remotely
View GitHub Profile
@edwinpgm
edwinpgm / docker-compose-mongo-replicaset.yml
Created September 29, 2020 13:24 — forked from asoorm/docker-compose-mongo-replicaset.yml
Mongo Replica Set docker compose
version: "3"
services:
mongo1:
hostname: mongo1
container_name: localmongo1
image: mongo:4.0-xenial
expose:
- 27017
ports:
- 27011:27017

Intercom user_hash

Remember that your secret key should never be exposed to the public

  • So Javascript code below should only be used for testing unless modified and used to run on a server
@edwinpgm
edwinpgm / gist:f156c05d6eae67551324d85da56314a2
Created December 3, 2018 20:15
Unset campos en mongodb
db.users.update({email: "[email protected]"}, {$unset: {taskActive: ""}})
Install 3.6
https://www.rosehosting.com/blog/how-to-install-python-3-6-on-ubuntu-16-04/
Deploy django
https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04
Error Createsuper user
@edwinpgm
edwinpgm / steps
Last active June 6, 2018 06:16
Next JS commands steps for init
# commands
npm init -y
npm i --save react react-dom next
mkdir pages
# in package.json
{
"scripts": {
"dev": "next"
}
@edwinpgm
edwinpgm / aws_s3
Created November 6, 2017 21:56
AWS S3 Cache Control && CloudFront
# AWS S3
Properties -> Metadata -> Add -> Cache-Control (max-age=604800) -> Complete
# AWS CloudFront
Cloudfront Distribution -> Invalidations -> Url -> Complete
@edwinpgm
edwinpgm / inviteLike.js
Last active April 7, 2017 00:42
Auto Invite in Facebook Page
var b = document.getElementsByClassName('_42ft _4jy0 _4jy3 _517h _51sy')
var c = document.getElementsByClassName('pam uiBoxLightblue uiMorePagerPrimary')
for(i=0;i<b.length;i++){ if (b[i].innerHTML=="Invitar") {b[i].click()}}
c[0].click()
var m = setInterval(function(){c[0].click()}, 1000)
// Luego que ya esta listo
clearInterval(m)
[program:app]
directory=/opt/app
command = npm run prod
user = root
stdout_logfile = /opt/app/logs/supervisor.log
redirect_stderr = true
environment=LANG=en_US.UTF-8,LC_ALL=en_US.UTF-8
@edwinpgm
edwinpgm / hook post-receive
Last active August 30, 2017 16:20
Git hooks to automate deployment tasks
# https://www.digitalocean.com/community/tutorials/how-to-use-git-hooks-to-automate-development-and-deployment-tasks
#!/bin/bash
while read oldrev newrev ref
do
if [[ $ref =~ .*/master$ ]];
then
echo "Master ref received. Deploying master branch to production..."
git --work-tree=/var/www/html --git-dir=/home/git/repositories/repository.git checkout -f
else
echo "Ref $ref successfully received. Doing nothing: only the master branch may be deployed on this server."
@edwinpgm
edwinpgm / gitolite
Created July 2, 2016 22:49
Configure Gitolite
# Local
# Create key
$(local) ssh-keygen -t rsa -f yourkeylocal
$(local) ssh-add ~/.ssh/yourkeylocal
$(local) scp ~/.ssh/yourkeylocal.pub username@server:/tmp/yourkeylocal.pub
# Sever
$(server) sudo apt-get install git
$(server) sudo adduser --system --group --shell /bin/bash --disabled-password git
$(server) cp /tmp/yourkeylocal.pub /home/git/yourkeylocal.pub