Skip to content

Instantly share code, notes, and snippets.

#!/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"
download_folder="$HOME/Dropbox/Space"
site="http://antwrp.gsfc.nasa.gov/apod/`date "+ap%y%m%d"`.html"
img_path=`curl -s $site | grep -i -e "<a.*jpg\>" | grep -o -e "\"\(.*jpg\)\"" | sed -e 's/"//g'`
dl_url="`dirname $site`/$img_path"
cd $download_folder
if [ ! -f `basename $dl_url` ]
then
require 'java'
# All the files from cassandra/lib
require 'lib/antlr-3.1.3.jar'
require 'lib/apache-cassandra-0.6.1.jar'
require 'lib/avro-1.2.0-dev.jar'
require 'lib/clhm-production.jar'
require 'lib/commons-cli-1.1.jar'
require 'lib/commons-codec-1.2.jar'
require 'lib/commons-collections-3.2.1.jar'
@abhiyerra
abhiyerra / growl-net.pl
Created January 1, 2011 07:05
irssi script to send growl notifications.
#!/usr/bin/env perl -w
#
# This is a simple irssi script to send out Growl notifications ovet the network using
# Net::Growl. Currently, it sends notifications when your name is
# highlighted, and when you receive private messages.
# Based on the original growl script by Nelson Elhage and Toby Peterson.
use strict;
use vars qw($VERSION %IRSSI $growl);
@abhiyerra
abhiyerra / jekyll-new-post.el
Created January 2, 2011 05:02
Create a new jekyll blog post from emacs.
(defun jekyll-new-post (title)
"Create a new Jekyll blog post."
(interactive "sPost Title: ")
(let ((draft-file (concat "~/Dropbox/blog/_posts/"
(format-time-string "%Y-%m-%d-")
(replace-regexp-in-string
" " "-" (downcase
(replace-regexp-in-string
"[^A-Za-z0-9 ]" "" title)))
".markdown")))
@abhiyerra
abhiyerra / .muttrc
Created January 2, 2011 05:05
Mutt for Gmail
# Change the following six lines to match your Gmail account details
set imap_user = "ykabhinav@gmail.com"
# set imap_pass = "PASSWORD"
set smtp_url = "smtp://ykabhinav@gmail.com@smtp.gmail.com:587/"
# set smtp_pass = "PASSWORD"
set realname = "Abhi Yerra"
set from = "ykabhinav@gmail.com"
# ` is an interesting key for a prefix
set-option -g prefix `
# set-option -g prefix C-a
#unbind-key C-b
bind-key C-a last-window
bind-key ` last-window
bind-key a send-prefix
bind-key m save-buffer /tmp/tmux-buffer \; run-shell "exec sh -c pbcopy < /tmp/tmux-buffer"
@abhiyerra
abhiyerra / jruby_cassandra.rb
Created January 2, 2011 05:37
Example of using JRuby from Cassandra
require 'java'
# All the files from cassandra/lib
require 'lib/antlr-3.1.3.jar'
require 'lib/apache-cassandra-0.6.1.jar'
require 'lib/avro-1.2.0-dev.jar'
require 'lib/clhm-production.jar'
require 'lib/commons-cli-1.1.jar'
require 'lib/commons-codec-1.2.jar'
require 'lib/commons-collections-3.2.1.jar'
@abhiyerra
abhiyerra / .mew.el
Created May 2, 2011 02:41
mew.el file.
(add-to-list 'load-path "~/Dropbox/Mew")
(autoload 'mew "mew" nil t)
(autoload 'mew-send "mew" nil t)
;; Optional setup (Read Mail menu for Emacs 21):
(if (boundp 'read-mail-command)
(setq read-mail-command 'mew))
;; Optional setup (e.g. C-xm for sending a message):
(autoload 'mew-user-agent-compose "mew" nil t)
(if (boundp 'mail-user-agent)
@abhiyerra
abhiyerra / disjoint-kill.el
Created November 6, 2013 07:55
Kill and paste disjoint buffers
(setq ay/disjoint-buffer '())
(defun ay/disjoint-kill ()
(interactive)
(add-to-list 'ay/disjoint-buffer
(buffer-substring-no-properties
(region-beginning)
(region-end)))
(delete-region (region-beginning)
(region-end)))