Skip to content

Instantly share code, notes, and snippets.

View Adrian1690's full-sized avatar

Adrian Peña Adrian1690

  • Lima , Perú
View GitHub Profile
@Adrian1690
Adrian1690 / git-deployment.md
Created May 16, 2017 19:48 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your lokal GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like my Deepl.io to act upon a Web-Hook that's triggered that service.

@Adrian1690
Adrian1690 / post-receive
Created September 15, 2017 21:16 — forked from miguelmota/post-receive
Git post-receive hook example. Blog post: http://www.miguelmota.com/blog/deployment-with-git/
#!/bin/bash
SITE_NAME="Foo"
SITE_PATH="/var/www/foo.com"
BRANCH="production"
echo "**** $SITE_NAME [post-receive] hook received."
while read oldrev newrev ref
do
---
name: "milkneko"
hostname: "milknekohost"
ip: "192.168.10.10"
memory: 4096
cpus: 2
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
@Adrian1690
Adrian1690 / gist:c783504099414b04f7133790218cf2cb
Created September 22, 2017 03:51
Connect ssh without password
==============================================================
Step 1: Create public and private keys using ssh-key-gen on local-host
==============================================================
jsmith@local-host$ [Note: You are on local-host here]
jsmith@local-host$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/jsmith/.ssh/id_rsa):[Enter key]
Enter passphrase (empty for no passphrase): [Press enter key]
@Adrian1690
Adrian1690 / launch.json
Created January 25, 2019 22:21
backend debug vscode config
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Van backend",
"type": "php",
"request": "launch",
@Adrian1690
Adrian1690 / launch.json
Created January 25, 2019 22:22
frontend debug vscode
/*{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
@Adrian1690
Adrian1690 / frontend.conf
Last active July 24, 2020 18:36
conf sites and virtual host apache2
cat /etc/apache2/sites-available/van-frontend.conf
#alias /van-frontend /var/www/html/van-frontend/
#<Directory "/home/ubuntu/jenkins-local/workspace/prevanfrontend/build">
# AllowOverride All
# Order allow,deny
# allow from all
# Require all granted
#</Directory>
<VirtualHost *:80>
#DocumentRoot /var/www/html
@Adrian1690
Adrian1690 / gist:8417899010dc98e34bb5fb37edc2573b
Last active March 19, 2019 21:38
Comands intermediate git
// force push
git push --force
//Identify merged branches
git branch --merged
git branch --no-merged
//Delete local Branches
git branch -d branchname
//delete remote branch
@Adrian1690
Adrian1690 / testcfn.yml
Last active January 21, 2020 01:55
CloudFormation
#./create.sh ourinfrastack ourinfra.yml ourinfra-parameters.json
Description: >
Adrian Peña / Udacity Course
Template to deploy a VPC
Resources:
UdacityVPC:
Type: AWS::EC2::VPC
Properties:
CidrBlock: 10.0.0.0/16
EnableDnsHostnames: true