Skip to content

Instantly share code, notes, and snippets.

View dgoguerra's full-sized avatar

Diego Guerra dgoguerra

View GitHub Profile
@dgoguerra
dgoguerra / auto-deploying.md
Created February 14, 2018 14:16 — forked from nickbclifford/auto-deploying.md
How to automatically deploy code to a server using Travis CI

Auto-Deploying via Travis CI

Because Travis CI can automatically execute scripts after successfully (or unsuccessfully!) executing tests, it is an obvious choice for a deployment tool. In order to deploy to a Git repository on a remote server, the process generally is as follows:

  • Set up SSH keys
  • Add the server's copy of the repository as a Git remote
  • Push to the remote
  • SSH into the server and execute any installation/compilation/miscellaneous commands

Before even touching .travis.yml...

Users

@dgoguerra
dgoguerra / stringifyIntoArray.js
Created January 18, 2018 15:01
Stringify an object stream into an array
var through = require('through2');
function stringifyIntoArray() {
var isFirstElem = true;
return through.obj(function(data, enc, next) {
if (isFirstElem) {
this.push('[');
isFirstElem = false;
} else {
@dgoguerra
dgoguerra / gist:836b325da56890bafb467a710ba509f3
Last active March 2, 2018 10:54
revoke letsencrypt certificate with certbot
sudo certbot-auto revoke --cert-path /etc/letsencrypt/live/DOMAIN/cert.pem [--staging]
@dgoguerra
dgoguerra / setup-ubuntu-16.md
Created September 5, 2017 11:38
Let's Encrypt Certbot

Install Let's Encrypt client (Certbot):

wget https://dl.eff.org/certbot-auto
sudo chmod a+x certbot-auto
sudo mv certbot-auto /usr/local/bin/

On first run it will install its dependencies:

@dgoguerra
dgoguerra / opengl-ubuntu-ec2-install.md
Last active September 11, 2020 13:27
Set up OpenGL on a Ubuntu 16.04 g2.2xlarge EC2 machine (following https://stackoverflow.com/q/19856192)

Steps from https://stackoverflow.com/q/19856192 with minor changes to work on Ubuntu 16.04.

# Install the Nvidia driver
sudo apt-add-repository ppa:ubuntu-x-swat/updates
sudo apt-get update
sudo apt-get install nvidia-current

# Driver installation needs reboot
sudo reboot now
@dgoguerra
dgoguerra / setup-npm-gulp-sass.sh
Last active August 31, 2021 09:33
Install node, npm, bower, gulp, compass in Ubuntu 16.04
sudo apt-get install -y git-core
sudo apt-get install -y curl
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm install -g bower
sudo npm install -g gulp
sudo apt-get install -y ruby ruby-dev
@dgoguerra
dgoguerra / dnsmasq-config-osx.md
Last active June 27, 2019 20:42
Setup automatic forwarding of .app and .test domains to Homestead through dnsmasq in OSX

Configure DNSmasq on OSX

Steps extracted from this guide. To see how to set up DNSmasq on Ubuntu, see this guide.

First update brew and install dnsmasq:

brew update
brew install dnsmasq
@dgoguerra
dgoguerra / Vagrantfile.diff
Last active January 8, 2019 22:20
Homestead v2.0.0 configuration
diff --git a/Vagrantfile b/Vagrantfile
index 12b8f52..7b77ab2 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -17,6 +17,11 @@ require File.expand_path(File.dirname(__FILE__) + '/scripts/homestead.rb')
Vagrant.require_version '>= 1.9.0'
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
+
+ config.vm.provider 'virtualbox' do |vb|
@dgoguerra
dgoguerra / gist:ececd01d7cd651b5a4ce2c6502da6088
Created February 23, 2017 17:45
reload ubuntu server timestamp
sudo service ntp stop
sudo ntpdate -s time.nist.gov
sudo service ntp start
@dgoguerra
dgoguerra / nginx.overrides
Created February 22, 2017 19:30 — forked from sheharyarn/nginx.overrides
Restart / Reload Nginx without Entering Sudo Password
# Enter this command to create a sudoers override/include file:
# sudo visudo -f /etc/sudoers.d/nginx.overrides
# (Make sure you actually have this in your /etc/sudoers - Run `sudo visudo` to check)
# #includedir /etc/sudoers.d
# This file assumes your deployment user is `deploy`
# Nginx Commands
Cmnd_Alias NGINX_RESTART = /usr/sbin/service nginx restart