First add your twitter username and password. Then server.rb and once it's started open websocket.html in your browser. You should see some tweets appear. If not take a look at the javascript console.
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
require "rubygems" | |
require "redis" | |
puts <<-EOS | |
To play with this example use redis-cli from another terminal, like this: | |
$ redis-cli publish test msg | |
EOS | |
redis = Redis.connect |
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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: redis-server | |
# Required-Start: $syslog | |
# Required-Stop: $syslog | |
# Should-Start: $local_fs | |
# Should-Stop: $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: redis-server - Persistent key-value db |
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
import gtk | |
import nautilus | |
import os | |
#http://seemanta.net/myblog/?p=509 | |
#sudo apt-get install python-nautilus | |
#killall nautilus | |
#see https://bugs.launchpad.net/ubuntu/+source/nautilus-python/+bug/125990 | |
#http://code.google.com/p/giuspen-nautilus-pyextensions | |
def alert(message): | |
"""A function to debug""" |
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
#!/usr/bin/env ruby | |
# This script performs an OAuth authorized POST with multipart encoding to | |
# http://twitter.com/account/update_profile_image.json | |
# | |
# This code is primarily taken from my Grackle library's implementation at | |
# http://github.com/hayesdavis/grackle | |
# | |
# RUNNING THIS WILL CHANGE AN ACCOUNT'S PROFILE IMAGE. BE CAREFUL. | |
# |
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
#! /usr/bin/ruby | |
#author [email protected] | |
require 'rubygems' | |
require "sinatra" | |
require 'oauth' | |
require 'oauth/consumer' | |
require 'yaml' | |
require 'logger' |
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
require 'rubygems' | |
require 'eventmachine' | |
require 'net/ssh' | |
require 'net/scp' | |
require 'ruby-growl' | |
#http://codeforpeople.rubyforge.org/directory_watcher/classes/DirectoryWatcher.html | |
module Handler | |
def file_modified | |
puts "#{path} modified" | |
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
#author [email protected] | |
require 'rubygems' | |
require 'fsevents' | |
require 'net/ssh' | |
require 'net/scp' | |
require 'ruby-growl' | |
host = "10.210.74.63" | |
username = "my name" | |
password = "my password" |
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
import paramiko | |
client = paramiko.SSHClient() | |
client.load_system_host_keys() | |
client.connect('10.210.74.63','username'='my name', 'password'='my passwd') | |
stdin, stdout, stderr = client.exec_command('ls -l') |
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
%w(rubygems sinatra sinatra/base erubis eventmachine em-websocket open3).each{|lib|require lib} | |
class WebServer < Sinatra::Base | |
#enable :sessions | |
use Rack::Static, :urls => ["/images","/css","/js" ], :root => "views" | |
set :run, true | |
use Rack::Auth::Basic do |name, password| |