Skip to content

Instantly share code, notes, and snippets.

@RajRoR
RajRoR / rainforest_api.rb
Created July 29, 2023 19:57
Rainforest Recursive API
# frozen_string_literal: true
require 'json'
require 'net/http'
require 'uri'
# This class is used to make a recursive call to the API, following the follow URL,
# until there is no follow URL.
# The response body is printed to the console.
class RainforestApi
function main() {
return 'Hello World! We are tracking doc changes for you.';
};
$(document).on("docchanged", function() {
alert("Document has been Updated!");
});
@RajRoR
RajRoR / Git: A monster to centralized VCSs
Created August 10, 2015 11:38
Summary and supporting material of the training session
# All Doc Content Here
@RajRoR
RajRoR / tickets_response
Created May 4, 2015 09:28
TicketsResponse
[
{
"id": 1,
"project_ticket_list_id": 1,
"assignee_id": 1,
"status": "in_progress",
"status_cd": 5,
"resolution_id": null,
"project_id": 4,
"social_message_id": 14793,
@RajRoR
RajRoR / fc_response
Created February 13, 2015 09:35
FullContact Person API Response
{
"status": 200,
"likelihood": 0.9,
"requestId": "773e6782-62bb-4fc6-9f38-28ea0b5db261",
"contactInfo": {
"familyName": "Lorang",
"givenName": "Bart",
"fullName": "Bart Lorang",
"websites":
[
@RajRoR
RajRoR / Prod-java-app03
Last active August 29, 2015 14:14
Prod-java-app03 (Analytics)
nano /home/deploy/.ssh/config # Add gitlab host config, port etc
chmod 600 /home/deploy/.ssh/config
# http://tecadmin.net/install-ruby-1-9-3-or-multiple-ruby-verson-on-centos-6-3-using-rvm/
sudo su
yum -y update
yum install -y curl-devel nano sqlite-devel libyaml-devel
# http://tecadmin.net/install-ruby-1-9-3-or-multiple-ruby-verson-on-centos-6-3-using-rvm/
@RajRoR
RajRoR / Prod-ruby-app01
Last active August 29, 2015 14:14
Prod-ruby-app01 (App/Listen)
nano /home/deploy/.ssh/config # Add gitlab host config, port etc
chmod 600 /home/deploy/.ssh/config
# https://www.digitalocean.com/community/tutorials/how-to-deploy-rails-apps-using-passenger-with-nginx-on-centos-6-5
sudo su
yum -y update
yum groupinstall -y 'development tools'
# Enable EPEL Repository
sudo su -c 'rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm'
@RajRoR
RajRoR / Prod-java-app01
Last active August 29, 2015 14:14
Prod-java-app01 (API)
nano /home/deploy/.ssh/config # Add gitlab host config, port etc
chmod 600 /home/deploy/.ssh/config
# http://tecadmin.net/install-ruby-1-9-3-or-multiple-ruby-verson-on-centos-6-3-using-rvm/
sudo su
yum -y update
yum install -y curl-devel nano sqlite-devel libyaml-devel
curl -L get.rvm.io | bash -s stable
@RajRoR
RajRoR / google_image_scraper
Last active August 29, 2015 14:10
Google Image Scraper - Get URLs of images that we see after clicking on thumbnail image
require 'headless'
require 'selenium-webdriver'
require 'watir-webdriver'
require 'nokogiri'
require 'csv'
require 'set'
require 'open-uri'
require 'fileutils'
# require 'ruby-debug'
@RajRoR
RajRoR / Apps_using_port_80
Created October 13, 2014 05:46
Apps using port 80
$~: sudo lsof -i:80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
chrome 3008 raj 183u IPv4 53373 0t0 TCP 192.168.175.105:56480->stackoverflow.com:http (CLOSE_WAIT)
chrome 3008 raj 190u IPv4 49987 0t0 TCP 192.168.175.105:47379->103.31.7.184:http (ESTABLISHED)
chrome 3008 raj 196u IPv4 52217 0t0 TCP 192.168.175.105:43087->stackoverflow.com:http (CLOSE_WAIT)
chrome 3008 raj 199u IPv4 49990 0t0 TCP 192.168.175.105:49739->ec2-174-129-25-157.compute-1.amazonaws.com:http (ESTABLISHED)
chrome 3008 raj 200u IPv4 53391 0t0 TCP 192.168.175.105:43120->stackoverflow.com:http (CLOSE_WAIT)
chrome 3008 raj 205u IPv4 53422 0t0 TCP 192.168.175.105:56680->eos.apache.org:http (CLOSE_WAIT)
chrome 3008 raj 207u IPv4 52220 0t0 TCP 192.168.175.105:47479->cf-190-93-247-58.cloudflare.com:http (ESTABLISHED)