#Set up monit
sudo apt-get install monit
###Config File
/etc/monit/monitrc //Monit runs as sudo- changing permissions cause monit not to start, so sticking with this now
#####reference Permissions
| module MyApp | |
| module Database | |
| def connect(pool_size = nil, reap_time = nil) | |
| return unless defined? ActiveRecord::Base | |
| config = Rails.application.config.database_configuration[Rails.env] | |
| config['reaping_frequency'] = reap_time || ENV['AR_DB_REAP_FREQ'] || 10 # seconds | |
| config['pool'] = pool_size || ENV['AR_DB_POOL'] || 5 | |
| ActiveRecord::Base.establish_connection(config) | |
| end |
#Set up monit
sudo apt-get install monit
###Config File
/etc/monit/monitrc //Monit runs as sudo- changing permissions cause monit not to start, so sticking with this now
#####reference Permissions
| #!/bin/sh | |
| # | |
| # init.d script for single or multiple unicorn installations. Expects at least one .conf | |
| # file in /etc/unicorn | |
| # | |
| # Modified by jay@gooby.org http://github.com/jaygooby | |
| # based on http://gist.github.com/308216 by http://github.com/mguterl | |
| # | |
| ## A sample /etc/unicorn/my_app.conf | |
| ## |
| console.info("Socket.io chat test client"); | |
| io = require('socket.io-client'); | |
| var args = process.argv.slice(2); | |
| Test = {}; | |
| Test.connections = parseInt(args[0]) || 100; | |
| Test.completedProcesses = 0; | |
| Test.failures = 0; | |
| Test.pingServer = function(socket_n) { | |
| var j = socket_n; |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Observer Pattern</title> | |
| </head> | |
| <body> | |
| <button id="addNewObserver">Add New Observer checkbox</button> | |
| <input id="mainCheckbox" type="checkbox"/> | |
| <div id="observersContainer"></div> |
| set mailserver smtp.gmail.com port 587 username "user@domain.com" password "password" using tlsv1 with timeout 30 seconds |
| ############################################################################### | |
| ## Monit control file | |
| ############################################################################### | |
| ## | |
| ## Comments begin with a '#' and extend through the end of the line. Keywords | |
| ## are case insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'. | |
| ## | |
| ## Below you will find examples of some frequently used statements. For | |
| ## information about the control file, a complete list of statements and | |
| ## options please have a look in the monit manual. |
#create package.json { "name": "my-project-name", "version": "0.1.0", "devDependencies": { "grunt": "~0.4.2", "grunt-contrib-jshint": "~0.6.3", "grunt-contrib-nodeunit": "~0.2.0", "grunt-contrib-uglify": "~0.2.2", "grunt-aws-s3": "~0.8.0"
#Prerequisite wvdial installed
##Create a rule for your net card lsusb
output may look like Bus 001 Device 023: ID 12d1:ffe9 Random Technologies Co., Ltd.
vendor - 12d1
product - ffe9
In the controller action
image_file = change_img_params(params[:avatar]) #params[:avatar] - base64 string
def change_img_params(img)
begin
Base64.decode64(img) #To check if thats a base64 string
if img
img = file_decode(img.split(',')[1],"some file name") #getting only the string leaving out the data/<format>
end