Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View jerzygangi's full-sized avatar

JJ Gangi jerzygangi

View GitHub Profile
@jerzygangi
jerzygangi / launchd_with_rvm
Created October 29, 2013 16:52
The beginning of a script that will be called by launchd (similar to cron on OS X). Currently, type rvm | head -1 is not returning the expected value. If I try and run a ruby file from here, it is not using the rvm ruby.
# Load RVM into a shell session *as a function*
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
# First try to load from a user install
source "$HOME/.rvm/scripts/rvm"
elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
# Then try to load from a root install
source "/usr/local/rvm/scripts/rvm"
@jerzygangi
jerzygangi / called_by_launchd.sh
Created October 29, 2013 17:32
Launchd calls this file
$rvm_path/wrappers/oftobeeminder/ruby /Users/jerzy/Desktop/oftobeeminder.rb
@jerzygangi
jerzygangi / oftobeeminder.rb
Created October 29, 2013 17:33
This is the ruby file called by called_by_launchd.sh
`touch /Users/jerzy/Desktop/_gottoa` #this does nothing
@jerzygangi
jerzygangi / Vagrantfile
Created May 6, 2014 15:19
Trying to configure multi-machine, where each machine has it's own SSH IP and port
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "hashicorp/precise32"
@jerzygangi
jerzygangi / console.log
Created May 6, 2014 15:26
'vagrant up' console log
PACCPL-334RAGYA:preppervms jgangi001c$ vagrant up
Bringing machine 'servera' up with 'virtualbox' provider...
Bringing machine 'serverb' up with 'virtualbox' provider...
Bringing machine 'serverc' up with 'virtualbox' provider...
==> servera: Importing base box 'hashicorp/precise32'...
==> servera: Matching MAC address for NAT networking...
==> servera: Checking if box 'hashicorp/precise32' is up to date...
==> servera: Setting the name of the VM: preppervms_servera_1399389393651_15907
==> servera: Clearing any previously set network interfaces...
==> servera: Preparing network interfaces based on configuration...
@jerzygangi
jerzygangi / gist:4e329e332c0a1da649e8
Created October 26, 2014 01:34
This is the shell session output from when I ran pip install --upgrade git+https://github.com/nyddle/pystash.git
jerzys-mbp:~ jerzy$ pip install --upgrade git+https://github.com/nyddle/pystash.git
Downloading/unpacking git+https://github.com/nyddle/pystash.git
Cloning https://github.com/nyddle/pystash.git to /var/folders/ds/vq3d_chn7273nfg4gnt1xylh0000gn/T/pip-iA9Uf0-build
Running setup.py (path:/var/folders/ds/vq3d_chn7273nfg4gnt1xylh0000gn/T/pip-iA9Uf0-build/setup.py) egg_info for package from git+https://github.com/nyddle/pystash.git
Requirement already up-to-date: args>=0.1.0 in /Library/Python/2.7/site-packages (from pystash==0.0.14)
Downloading/unpacking clint>=0.3.3 from https://pypi.python.org/packages/source/c/clint/clint-0.4.1.tar.gz#md5=d0a0952bfcc5f4c5e03c36854665b298 (from pystash==0.0.14)
Downloading clint-0.4.1.tar.gz
Running setup.py (path:/private/var/folders/ds/vq3d_chn7273nfg4gnt1xylh0000gn/T/pip_build_jerzy/clint/setup.py) egg_info for package clint
@jerzygangi
jerzygangi / gist:46ea0aa5e4240938e05a
Created October 26, 2014 01:36
This is the pip.log in ~/Library/Logs/pip.log
Downloading/unpacking git+https://github.com/nyddle/pystash.git
Cloning https://github.com/nyddle/pystash.git to /var/folders/ds/vq3d_chn7273nfg4gnt1xylh0000gn/T/pip-iA9Uf0-build
Found command 'git' at '/usr/local/bin/git'
Running command /usr/local/bin/git clone -q https://github.com/nyddle/pystash.git /var/folders/ds/vq3d_chn7273nfg4gnt1xylh0000gn/T/pip-iA9Uf0-build
Running setup.py (path:/var/folders/ds/vq3d_chn7273nfg4gnt1xylh0000gn/T/pip-iA9Uf0-build/setup.py) egg_info for package from git+https://github.com/nyddle/pystash.git
running egg_info
creating pip-egg-info/pystash.egg-info
writing requirements to pip-egg-info/pystash.egg-info/requires.txt
writing pip-egg-info/pystash.egg-info/PKG-INFO
writing top-level names to pip-egg-info/pystash.egg-info/top_level.txt
@jerzygangi
jerzygangi / gist:352736500f45db383142
Created May 31, 2015 23:02
How to get JSON with Ruby
require "rubygems"
require "json"
require "net/http"
response = Net::HTTP.get_response(URI.parse("https://api.bitcoinaverage.com/exchanges/USD"))
puts response.body
puts JSON.parse(response.body)
@jerzygangi
jerzygangi / gist:76714b9ca7e28ea525fc
Created May 31, 2015 23:05
How to get the current Bitcoin price from a JSON API
require "rubygems"
require "json"
require "net/http"
response = Net::HTTP.get_response(URI.parse("https://api.bitcoinaverage.com/exchanges/USD"))
parsed_response = JSON.parse(response.body)
puts parsed_response["bitex"]["rates"]["last"]
@jerzygangi
jerzygangi / install.sh
Last active September 3, 2017 03:41
Install Seashell
sudo yum -y install git && git clone https://github.com/jerzygangi/seashell.git && ./seashell/commands/install_seashell