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 | |
myip_url="http://www.ocf.berkeley.edu/~abhi/myip/" | |
myip=`curl -s $myip_url` | |
linode_api_key="<API_KEY_HERE>" | |
domain_id='<DomainID>' | |
resource_id='<ResourceID>' | |
url="https://api.linode.com/?api_key=$linode_api_key&api_action=domain.resource.update&DomainID=$domain_id&ResourceID=$resource_id&Target=$myip" |
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 | |
# sudo gem install rick-linode | |
require 'rubygems' | |
require 'open-uri' | |
require 'linode' | |
LinodeAPIKey = '<LINODE_API_KEY_HERE>' | |
DomainID = '<DOMAIN_ID>' | |
ResourceID = '<RESOURCE_ID>' |
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
python << EOF | |
# Post to Blog | |
import vim | |
import urllib2, urllib | |
import base64 | |
import markdown2 | |
blog_email = 'my@email.com' | |
blog_password = 'mYpA$$W0RD' | |
site_id = "123456" |
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
set :application, "abooklog" | |
set :repository, "ssh://abhi@path.to.repo/repo_location" | |
set :user, 'deployer' | |
# If you have previously been relying upon the code to start, stop | |
# and restart your mongrel application, or if you rely on the database | |
# migration code, please uncomment the lines you require below | |
# If you are deploying a rails app you probably need these: |
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
/* | |
* <events> | |
* <event> | |
* <name>My name</name> | |
* </event> | |
* </events> | |
*/ | |
#import <libxml/xmlmemory.h> | |
#import <libxml/parser.h> |
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
def post_multipart url, params | |
req = params.collect do |k,v| | |
"-F #{k}=#{v.kind_of?(File) ? '@' : ''}'#{v.kind_of?(File) ? v.path : v}'" | |
end.join(' ') | |
`curl -s #{req} #{url}` | |
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
#!/usr/bin/env ruby | |
# flickrup.rb - A utility to upload photos to Flickr. | |
# | |
# This work is put in public domain by Kesava Abhinav Yerra. | |
# | |
# Create a config file ~/.flickrup and add your Flickr API Key and secret key | |
# For example: | |
# | |
# secret: SECRET_KEY |
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 'open-uri' | |
require 'xmlrpc/client' | |
WordPressSite = "http://SITE.wordpress.com" | |
WordPressUsername = 'username' | |
WordPressPassword = 'password' | |
PosterousApi = 'http://posterous.com/api' | |
PosterousEmail = 'email' |
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
Hello from Gist! |
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
/* fib.js */ | |
i = 2; | |
while(true) { | |
postMessage(i + " " + fib(i)); | |
i++; | |
} | |
function fib(n){ | |
return n < 2 ? n : fib(n-1) +fib(n-2); | |
} |