Last updated: 12/31/2013
- Edit
/etc/default/locale
as sudo. - Append
LC_ALL="en_US.UTF-8"
at the end of the file, save and quit. sudo locale-gen en_US en_US.UTF-8
sudo dpkg-reconfigure locales
require "json" | |
# option 1 | |
require "typhoeus" | |
#option 2 | |
require "httparty" | |
$url1 = "https://api.twitter.com/1/statuses/user_timeline.json?screen_name=dchelimsky&count=2" |
download open ssl for windows: http://www.openssl.org/source/ | |
Reference : | |
http://www.neilstuff.com/apache/apache2-ssl-windows.htm (for installation) | |
http://www.napcsweb.com/howto/rails/deployment/RailsWithApacheAndMongrel.pdf (for httpd.conf and ssl.conf & proxy fix) | |
Sample openssl confi (required to create key file) |
# for more info: https://gist.github.com/1120938 |
require 'rho/rhocontroller' | |
require 'lib/flow/login_flow' | |
require 'lib/flow/new_trip_flow' | |
require 'lib/flow/transfer_detail_flow' | |
module UHS | |
# Base controller providing commonly used functionality | |
class BaseController < Rho::RhoController | |
end | |
class UhsController < BaseController |
#!/usr/bin/env ruby | |
# Mails a file using GMail's SMTP Server. | |
# For illustrative purposes; error checking and testing intentionally omitted for brevity. | |
# | |
# Requirements: | |
# 1) the 'mail' gem must be installed | |
# 2) a file named 'pw.txt' containing the Google password must be present | |
# in the current directory. | |
# | |
# Ruby versions: tested on 1.9.3, 1.8.7, JRuby |
Last updated: 12/31/2013
/etc/default/locale
as sudo.LC_ALL="en_US.UTF-8"
at the end of the file, save and quit.sudo locale-gen en_US en_US.UTF-8
sudo dpkg-reconfigure locales
echo "Site Down" | mail -r from@foo.com -s "Site Down" to@foo.com |
netstat -na | grep LISTEN | grep MYSQL_PORT | |
if [ $? != 0 ]; then | |
sudo service mysql start | |
#send email | |
fi | |
#Make the script executable | |
# $ chmod +x isalive.sh | |
#Add it to crontab (say every 10 minutes) |
undef: 2312 times | |
user [preauth]: 76 times | |
ftpuser [preauth]: 74 times | |
guest [preauth]: 73 times | |
webmaster [preauth]: 68 times | |
admin [preauth]: 67 times | |
oracle [preauth]: 65 times | |
test [preauth]: 54 times | |
master [preauth]: 52 times | |
ftp [preauth]: 51 times |
process='sidekiq' # process name, you can use this to monitor any process | |
project_path="/home/ubuntu/apps/demo/" # This is the one you got to change on your side for your server. | |
#change it based on your configs. | |
start_service="bundle exec sidekiq -d -C /home/ubuntu/apps/demo/config/sidekiq.yml -i 0 -P /home/ubuntu/apps/demo/tmp/pids/sidekiq.pid -L /home/ubuntu/apps/demo/log/sidekiq.log" | |
# Method to simply store last run time in monitor.log file. | |
function update_last_run() { | |
current_time=$(date +'%d/%m/%Y %H:%M:%S') |