Skip to content

Instantly share code, notes, and snippets.

View mdoyle13's full-sized avatar

Mike Doyle mdoyle13

View GitHub Profile
@mdoyle13
mdoyle13 / Vagrantfile
Last active October 14, 2021 22:48
Vagrantfile for Ubuntu 18, Rails 6 and Ruby 2.7
# -*- mode: ruby -*-
# vi: set ft=ruby :
$rbenv_script = <<SCRIPT
if [ ! -d ~/.rbenv ]; then
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
fi
if [ ! -d ~/.rbenv/plugins/ruby-build ]; then
@mdoyle13
mdoyle13 / Dockerfile
Created May 4, 2020 18:48
Rails 6, ruby 2.7 Docker for Development
FROM ruby:2.7
RUN apt-get update && apt-get install -y \
curl \
build-essential \
libpq-dev &&\
curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && apt-get install -y nodejs yarn vim
@mdoyle13
mdoyle13 / install_ffmpeg_ubuntu.sh
Created June 1, 2018 14:28 — forked from xdamman/install_ffmpeg_ubuntu.sh
Install latest ffmpeg on ubuntu 12.04 or 14.04
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update
@mdoyle13
mdoyle13 / gist:773bb47791eef2fc7b2e50dfcb7fdb15
Created May 16, 2018 13:55
Get the memory usage of a running process
# see below, change 'process-name' to the name of the process you want to get the memory usage of (in MB)
ps -eo rss,pid,euser,args:100 --sort %mem | grep -v grep | grep -i process-name | awk '{printf $1/1024 "MB"; $1=""; print }'
@mdoyle13
mdoyle13 / Dockerfile
Last active May 2, 2018 22:36 — forked from konklone/Dockerfile
Dockerfile for installing Ruby 2.0 and RVM
FROM ubuntu
MAINTAINER Eric Mill "eric@konklone.com"
# turn on universe packages
RUN echo "deb http://archive.ubuntu.com/ubuntu raring main universe" > /etc/apt/sources.list
RUN apt-get update
# basics
RUN apt-get install -y nginx openssh-server git-core openssh-client curl
RUN apt-get install -y nano
@mdoyle13
mdoyle13 / 01_yarn.config
Created April 25, 2017 00:51
Deploy webpacker on aws
files:
# If this file is edited, it must be removed from EC2 instance prior to deploy.
"/opt/elasticbeanstalk/hooks/appdeploy/pre/09_yarn_install.sh" :
mode: "000775"
owner: root
group: users
content: |
#!/usr/bin/env bash
set -xe
@mdoyle13
mdoyle13 / gist:4088565
Created November 16, 2012 16:10
Rails 3.1 ActionMailer Config for Godaddy Hosted Exchange
#include the ntlm gem in your Gemfile
gem 'ruby-ntlm'
#add this to your environment config.
ActionMailer::Base.smtp_settings = {
:address => "smtp.ex3.secureserver.net",
:domain => "secureserver.net",
:port => 25,