Skip to content

Instantly share code, notes, and snippets.

View smcabrera's full-sized avatar
🐶

Stephen Mariano Cabrera smcabrera

🐶
View GitHub Profile
#!/usr/bin/ruby
#
# Download lecture videos of courses from Coursera (http://www.coursera.org).
#
# Install requirements:
#
# $ gem install curb trollop nokogiri capybara ruby-progressbar
#
# Example -- Download all video lectures of courses "Calculus: Single Variable"
# and "Introduction to Astronomy":
# Ways to execute a shell script in Ruby
# Example Script - Joseph Pecoraro
cmd = "echo 'hi'" # Sample string that can be used
# 1. Kernel#` - commonly called backticks - `cmd`
# This is like many other languages, including bash, PHP, and Perl
# Returns the result of the shell command
# Docs: http://ruby-doc.org/core/classes/Kernel.html#M001111
@smcabrera
smcabrera / gist:ca27971cfb16988ed3a7
Created October 21, 2014 16:52
nitrous-laravel-setup.sh
echo "###### Installing software using nitrous' parts package manager ######"
parts install apr
parts install libmcrypt
parts install heroku_toolbelt
parts install apr_util
echo ""
echo "###### Installing php dependency manager composer"
parts install composer
@smcabrera
smcabrera / .laptop.local
Last active August 29, 2015 14:07
.laptop.local
#!/bin/sh
fancy_echo "Installing homesick, an alternative for managing dotfiles ..."
gem install homesick
fancy_echo "Installing Dropbox ..."
cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
fancy_echo "Save local configuration files from being overwritten by my symlinked dotfiles"
if [ ! -f "$HOME/.zshrc" ]; then
mv $HOME/.zshrc $HOME/.zshrc.local
@smcabrera
smcabrera / gist:4dd275f83e261cb2a4cc
Last active August 29, 2015 14:07
install_everything.sh
#!/bin/sh
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties
echo "##########################################"
echo "Installing ruby"
echo "##########################################"
echo "Instructions courtesy: gorails.com https://gorails.com/setup/ubuntu/14.04"
if [ ! -f "$HOME/.rbenv" ]; then
@smcabrera
smcabrera / laravel_setup_local.sh
Created October 29, 2014 15:02
laravel_setup_local.sh
#!/usr/bin/env bash
# Modified version of Jeffrey Way's Vagrant Laravel setup script
echo "--- Good morning, master. Let's get to work. Installing now. ---"
echo "--- Updating packages list ---"
sudo apt-get update
echo "--- MySQL time ---"
#sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
#sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
@smcabrera
smcabrera / ElfinderController.php
Last active August 29, 2015 14:08
cambiar-el-finder.sh
<?php
namespace Barryvdh\Elfinder;
use Illuminate\Support\Facades\View;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Response;
class ElfinderController extends \Controller
{
protected $package = 'laravel-elfinder';
@smcabrera
smcabrera / gist:49df2e19b6c25b63e848
Last active August 29, 2015 14:08
My full dev setup: ruby, nodejs (php coming soon)
#!/bin/sh
# Making my dev setup portable with a script that can set it up on any new server (running ubuntu) I come across
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties
echo "##########################################"
echo "Get vim"
echo "##########################################"
sudo apt-get install vim -y
echo "##########################################"
echo "Installing ruby"
echo "##########################################"
echo "Instructions courtesy: gorails.com https://gorails.com/setup/ubuntu/14.04"
if [ ! -f "$HOME/.rbenv" ]; then
git clone git://github.com/sstephenson/rbenv.git .rbenv
fi
#echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
#!/bin/bash -ex
# Paste this into ssh
# curl https://gist.githubusercontent.com/smcabrera/143a72e9ef8729e97a67/raw/bd3089511fa43fc73c6943bc59685918e19a040b/bootstrap_homeshick.sh | sh
# When forking, you can get the URL from the raw (<>) button.
### Set some command variables depending on whether we are root or not ###
# This assumes you use a debian derivate, replace with yum, pacman etc.
aptget='sudo apt-get'
chsh='sudo chsh'