Skip to content

Instantly share code, notes, and snippets.

View kazpsp's full-sized avatar
🎯
Focusing

rodrigo zurek kazpsp

🎯
Focusing
View GitHub Profile
@jcave
jcave / Upgrading_RoR_DigitalOcean.md
Last active October 29, 2019 18:56
Upgrading Ruby using RVM on Digital Ocean's Ruby on Rails on Ubuntu 14.04 (Nginx + Unicorn) Image

Upgrading Ruby using RVM on Digital Ocean's Ruby on Rails on Ubuntu 14.04 (Nginx + Unicorn) Image

For those out there more advanced, this is probably not worth reading. However, if you’re fairly new to system admin on a Digital Ocean Ubuntu/Nginx/Unicorn/MySQL/Ruby on Rails setup, it may help you out. Recently, I needed to upgrade my ruby version from 2.0.0-p353 to version 2.2.0 on my Digital Ocean droplet. I felt like this would be fairly easy to do since RVM comes installed with the ‘Ruby on Rails on 14.04 (Unicorn + Nginx)’ image that Digital Ocean provides under the ‘Applications’ tab when creating a Droplet.

While it is true that installing a new version of ruby using RVM on your system is fairly easy, there’s a few locations that you MUST change in order to use the new ruby version. This is where if you are unfamiliar or new to this, you could spend a decent amount of time digging for these. Hopefully this will save you the time and make your upgrade fairly smooth.

Let’s get started!

Step 1: Tak

@ChuckJHardy
ChuckJHardy / digital_ocean_setup.md
Last active October 27, 2023 17:51
DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3 Setup Instructions

DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3

SSH into Root

$ ssh root@123.123.123.123

Change Root Password

@douglascayers
douglascayers / vCalendarPage.html
Last active July 13, 2023 21:59
Create .ics Calendar Event in Visualforce
<!--
Simple proof-of-concept to create a .ics calendar event with visualforce.
Inspired by Natalie Regier @gnatrae
This example uses url parameters to set the details of event.
You could create a custom button that invokes this page, like:
https://<your-salesforce-domain>/apex/vCalendarPage?start={!TEXT(Obj.StartDate__c)}&end={!TEXT(Obj.EndDate__c)}&subject=Event from Visualforce&description=This .ics event created with visualforce&location=The Cloud
An example with literal values you can copy & paste in your browser:
https://<your-salesforce-domain>/apex/vCalendarPage?start=20140524T140000&end=20140524T153000&subject=Event from Visualforce&description=This .ics event created with visualforce&location=The Cloud
@bhauman
bhauman / screw_you_zerigo.rb
Last active January 2, 2016 00:49
Zerigo's recent rate increase will raise my yearly cost 5000% so I created this lovely little script to help you leave Zerigo behind. It relies on the excellent fog library http://fog.io/dns/ It is currently targeting DNSimple but fog supports many other providers. Using it is very satisfying. After setting the correct connection settings just t…
require 'rubygems'
require 'fog'
require 'zerigo_dns'
# A simple script to help you leave zerigo behind
# it relies on the excellent fog library http://fog.io/dns/
# It copies all of your Zerigo zones to DNSimple
# It is currently targeting DNSimple but fog supports many other
@ronhornbaker
ronhornbaker / twitter-friends.rb
Last active May 25, 2017 00:21
Get list of friends of a Twitter user, using the Twitter gem v5 (https://github.com/sferik/twitter), the Twitter APIv1.1, and Ruby.
require 'rubygems'
require 'twitter'
# see https://github.com/sferik/twitter
def twitter_client
Twitter::REST::Client.new do |config|
config.consumer_key = "XXXXXX"
config.consumer_secret = "XXXXXX"
config.access_token = "XXXXXX"
@fnichol
fnichol / README.md
Created March 12, 2011 20:52
Download a cacert.pem for RailsInstaller

Why?

There is a long standing issue in Ruby where the net/http library by default does not check the validity of an SSL certificate during a TLS handshake. Rather than deal with the underlying problem (a missing certificate authority, a self-signed certificate, etc.) one tends to see bad hacks everywhere. This can lead to problems down the road.

From what I can see the OpenSSL library that Rails Installer delivers has no certificate authorities defined. So, let's go fetch some from the curl website. And since this is for ruby, why don't we download and install the file with a ruby script?

Installation

The Ruby Way! (Fun)