SSH into Root
$ ssh [email protected]
Change Root Password
SSH into Root
$ ssh [email protected]
Change Root Password
# A module which is an instance of the Script class encapsulates in its scope | |
# the top-level methods, top-level constants, and instance variables defined in | |
# a ruby script file (and its subfiles) loaded by a ruby program. This allows | |
# use of script files to define objects that can be loaded into a program in | |
# much the same way that objects can be loaded from YAML or Marshal files. | |
# | |
# See intro.txt[link:files/intro_txt.html] for an overview. | |
class Script < Module | |
# The file with which the Script was instantiated. |
set :aws_private_key_path, "~/.ec2/mrkey.pem" | |
namespace :setup_server do | |
desc "adds a user and uploads his id_rsa.pub to the EC2 instance's deploy users authorized_keys2 file" | |
task :create_deploy_user do | |
# \\n becomes \n | |
commands = <<-SH.split("\n").map(&:strip).join(";") | |
sudo echo hi | |
sudo groupadd admin |
if ENV['MY_RUBY_HOME'] && ENV['MY_RUBY_HOME'].include?('rvm') | |
begin | |
rvm_path = File.dirname(File.dirname(ENV['MY_RUBY_HOME'])) | |
rvm_lib_path = File.join(rvm_path, 'lib') | |
$LOAD_PATH.unshift rvm_lib_path | |
require 'rvm' | |
RVM.use_from_path! File.dirname(File.dirname(__FILE__)) | |
rescue LoadError | |
# RVM is unavailable at this point. | |
raise "RVM ruby lib is currently unavailable." |
#!/bin/sh | |
# | |
# init.d script for single or multiple unicorn installations. Expects at least one .conf | |
# file in /etc/unicorn | |
# | |
# Modified by [email protected] http://github.com/jaygooby | |
# based on http://gist.github.com/308216 by http://github.com/mguterl | |
# Updated by glebm for newer unicorn and to use with bundle exec | |
# | |
## A sample /etc/unicorn/my_app.conf |
# -*- encoding : utf-8 -*- | |
module UrlSubdomain | |
def subdomain!(sub = 'account') | |
# Some day this hack won't be necessary | |
# (when Capybara, Rspec, and Rails learn to work together) | |
# For now it only works if we run it twice | |
# I do not know why, and it would be a waste of time to find out | |
2.times do | |
sub = 'account' if sub.blank? | |
host = "#{sub}.#{DOMAIN}" |
#!/usr/bin/env ruby | |
# coding: utf-8 | |
require 'net/http' | |
require 'json' | |
# a simple wrapper to do an HTTPS GET | |
def fetch_uri(url) | |
STDERR.puts "GET #{url}" if ENV['VERBOSE'] | |
uri = URI(url) |
#!/usr/bin/env ruby | |
require 'base64' | |
require 'open-uri' | |
# file or url | |
def get_css(src) | |
if src.start_with? 'http' | |
src = src.gsub('|', '%7C') | |
STDERR.puts "# GET #{src}" | |
# simulate modern browser to get woff |
This lets you load application JavaScript asynchronously from <head>
. Compatible with Turbolink v2, v5.0, v5.1, jquery-turbolinks, and no Turbolinks. Compatible with all browsers and IE9+ (only IE10+ will actually benefit from this though).
How to use this:
Add the HTML snippet just before the closing </body>
tag.
Add the on_page_load.js script to the beginning of your application.js
, and use window.App.onPageLoad(...)
instead of document.addEventListener('DOMContentLoaded', ...)
and jQuery(($) -> ...)
everywhere.
Include your JavaScript like so:
<head>
from jira import JIRA | |
import pandas as pd | |
import pdb | |
from collections import defaultdict | |
import datetime | |
import pprint | |
class ImportJiraAnalyticsData: |