This file contains 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
No. Time Source Destination Protocol Length Info | |
1 0.000000 192.168.1.99 192.168.3.12 TCP 54 printer > 43664 [ACK] Seq=1 Ack=1 Win=740 Len=0 | |
Frame 1: 54 bytes on wire (432 bits), 54 bytes captured (432 bits) | |
Ethernet II, Src: Draytek_e6:eb:40 (00:50:7f:e6:eb:40), Dst: IntelCor_dc:6a:d0 (00:27:10:dc:6a:d0) | |
Internet Protocol Version 4, Src: 192.168.1.99 (192.168.1.99), Dst: 192.168.3.12 (192.168.3.12) | |
Transmission Control Protocol, Src Port: printer (515), Dst Port: 43664 (43664), Seq: 1, Ack: 1, Len: 0 | |
No. Time Source Destination Protocol Length Info | |
2 0.000112 192.168.1.99 192.168.3.12 TCP 54 [TCP Window Update] printer > 43664 [ACK] Seq=1 Ack=1 Win=2100 Len=0 |
This file contains 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
desc "Import incoming calls" | |
task :fetch_incomingcalls => :environment do | |
# Logs into manage.phoneprovider.co.uk and retrieved list of incoming calls. | |
require 'rubygems' | |
require 'mechanize' | |
require 'logger' | |
# Create a new mechanize object | |
agent = Mechanize.new { |a| a.log = Logger.new(STDERR) } |
This file contains 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
<tr class='o'> | |
<tr> | |
<td>06 Jan 21:01</td> | |
<td></td> | |
<td>1234567891</td> | |
<td>00:02:21</td> | |
<td></td> | |
<td class='opt recording'></td> | |
</tr> | |
</tr> |
This file contains 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
<?php include('perch/runtime.php'); ?> | |
<!doctype html> | |
<!--[if lt IE 7 ]> <html class="ie ie6 no-js" lang="en"> <![endif]--> | |
<!--[if IE 7 ]> <html class="ie ie7 no-js" lang="en"> <![endif]--> | |
<!--[if IE 8 ]> <html class="ie ie8 no-js" lang="en"> <![endif]--> | |
<!--[if IE 9 ]> <html class="ie ie9 no-js" lang="en"> <![endif]--> | |
<!--[if gt IE 9]><!--><html class="no-js" lang="en"><!--<![endif]--> | |
<!-- the "no-js" class is for Modernizr. --> |
This file contains 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
# Be sure to restart your server when you modify this file. | |
# | |
# This file contains settings for ActionController::ParamsWrapper which | |
# is enabled by default. | |
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. | |
ActiveSupport.on_load(:action_controller) do | |
wrap_parameters format: [:json] | |
end |
This file contains 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
------------ From Rake Task | |
namespace :app do | |
# Checks and ensures task is not run in production. | |
task :ensure_development_environment => :environment do | |
if Rails.env.production? | |
raise "\nI'm sorry, I can't do that.\n(You're asking me to drop your production database.)" | |
end | |
end |
This file contains 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
# Add each row to a new call record | |
page = agent.page.search("table tbody tr").each do |row| | |
next if (!row.at('td')) | |
time, source, destination, duration = row.search('td')[1..5].map{ |td| td.text.strip } | |
call = Call.find_by_time(Time.parse(time)) | |
call = Call.create_by_time(Time.parse(time)) | |
call.update_attributes({:time => time, :source => source, :destination => destination, :duration => duration}) | |
end |
This file contains 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
Add this to the model | |
set_table_name 'old_table_name' | |
set_primary_key 'old_key_column' |
This file contains 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
desc "Import Service Provider Location" | |
task :fetch_serviceproviderlocation => :environment do | |
# Logs into service provider and retrieved latitude and longitude. | |
require 'rubygems' | |
require 'mechanize' | |
require 'logger' | |
require 'nokogiri' | |
# Create a new mechanize object |
This file contains 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<!-- saved from url=(0028)http://www.serviceprovider.co.uk/ --> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<title>serviceprovider</title> | |
<link href="css/screen.css" media="screen" rel="stylesheet" type="text/css" /> | |
<!--[if lte IE 6]> | |
<link href="http://www.serviceprovider.co.uk/styles/default/screen_ie6.css" media="screen" rel="stylesheet" type="text/css" /> |