This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to Install and Configure Monit on Ubuntu | |
Monit is a powerful tool for monitoring and managing Unix systems. This guide will walk you through the steps to install and configure Monit on an Ubuntu machine. | |
## Step 1: Update Your System | |
Before installing Monit, update your package list and upgrade existing packages: | |
bash | |
sudo apt update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveRecord cheat sheet / EXAMPLES | |
INSTALL | |
======= | |
$ gem install activerecord | |
in GEMFILE: gem ‘activerecord’ | |
REQUIRE | |
======= | |
require ‘active_record’ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
img_paths = ["/Users/workspace/ARVIND/2.jpeg", "/Users/workspace/ARVIND/2.jpeg", "/Users/workspace/ARVIND/REDCAPTIN/2.jpeg"] | |
Prawn::Document.generate("/Users/workspace/ARVIND/red_captain/my-file.pdf") do |pdf| | |
img_paths.each do |img_path| | |
# PDF regions involve bounding boxes. | |
# The default bounding box is simply the page itself. | |
# The :fit option tells Prawn to scale the image to the current | |
# bounding box (in other words, the current page) | |
pdf.image img_path, :fit => [pdf.bounds.right, pdf.bounds.top] | |
# Insert a page break, unless this is the last page |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There are few things to remember | |
1) Before upgrading datbase for safer side create backup or current database. | |
2) Start manatance on so that in middle there should not save any other record which may loss due to databse upgradation | |
3) Look into the heroku plans according to your need you can find it here https://devcenter.heroku.com/articles/heroku-postgres-plans | |
I am sharing example to upgrade my database from Hobby-basic to Standard0 | |
heroku maintenance:on | |
heroku addons:create heroku-postgresql:standard-0 | |
heroku pg:copy DATABASE_URL HEROKU_POSTGRESQL_RED_URL --app sushi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You can kill it using: | |
sudo fuser -k 80/tcp | |
service nginx start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/Users/Topform/.rvm/gems/ruby-2.2.1@bodyboss/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `initialize': could not connect to server: No such file or directory (PG::ConnectionBad) | |
Is the server running locally and accepting | |
connections on Unix domain socket "/tmp/.s.PGSQL.5432"? | |
solve by | |
rm /usr/local/var/postgres/postmaster.pid | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Updates and add user | |
sudo apt-get update && sudo apt-get upgrade -y | |
adduser passenger | |
sudo usermod -aG sudo passenger | |
sudo apt-get install curl nano git libmysqlclient-dev coffeescript gawk g++ gcc make libreadline6-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 autoconf libgmp-dev libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev -y | |
login as passenger user, install application | |
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 | |
\curl -sSL https://get.rvm.io | bash -s stable | |
source /home/passenger/.rvm/scripts/rvm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :elasticsearch do | |
desc "Install elasticsearch" | |
task :install do | |
on roles(:app) do | |
execute "sudo apt-get update" | |
execute "sudo apt-get install openjdk-7-jre-headless -y" | |
execute "cd /tmp" | |
execute "wget https://download.elasticsearch.org/elasticsearch\ | |
/elasticsearch/elasticsearch-2.3.2.deb" | |
execute "sudo dpkg -i elasticsearch-2.3.2.deb" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rake refinery:override view=refinery/pages/* | |
$ rake refinery:override view=layouts/* | |
$ rake refinery:override view=refinery/blog/shared/* | |
$ rake refinery:override view=refinery/blog/posts/* | |
$ rake refinery:override view=refinery/* | |
$ rake refinery:override controller=refinery/blog/* | |
$ rake refinery:override controller=refinery/* | |
$ rake refinery:override view=refinery/pages/show |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
What is the class of Object ? | |
2.1.0 :013 > Object.class | |
=> Class | |
What is superclass of Module? | |
2.1.0 :014 > Module.superclass | |
=> Object |