Have you ever wished you could access your Amazon Simple Queue Service from the command line ? Now you can:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
$ AWS_ACCESS_KEY_ID=<your access key>
$ AWS_SECRET_ACCESS_KEY="<the secret access key>"

$ clisqs create my-queue
Queue my-queue was created.

$ clisqs list
my-queue

$ clisqs push --data "this is the message" my-queue
Pushed 19 bytes to queue my-queue

$ cat README.txt | clisqs push my-queue
Pushed 2687 bytes to queue my-queue

$ clisqs push my-queue README.txt
Pushed 2687 bytes to queue my-queue

$ clisqs size my-queue
3

$ clisqs pop my-queue
this is the message

$ clisqs delete --force my-queue
Queue my-queue was deleted.

Installation

1
$ sudo gem install cliaws

Direct-code access

1
2
3
4
5
6
require "rubygems"
require "cliaws"

Cliaws.sqs.push("my-queue", "the data")
the_size = Cliaws.sqs.size("my-queue")
the_message = Cliaws.sqs.pop("my-queue")

S3 ?

This gem also works with S3. See my prior release announcement: Cliaws: command-line access to S3

I just released a new gem on RubyForge: cliaws. Using it, you have access to nice command line shortcuts:

1
2
3
4
5
6
$ AWS_ACCESS_KEY_ID=<your access key>
$ AWS_SECRET_ACCESS_KEY="<the secret access key>"
$ clis3 list BUCKET/PATH-PREFIX
$ clis3 put BUCKET/FULL/PATH/NAME /path/to/local/file
$ clis3 get BUCKET/FULL/PATH/NAME /path/to/local/file
$ clis3 cat BUCKET/FULL/PATH/NAME

This is not rocket science, but with the kind of work I’m doing at the moment, having quick command-line access to S3 is a boon.

Installation

1
$ gem install cliaws

Direct-code access

1
2
3
4
5
6
7
8
9
10
11
12
13
require "rubygems"
require "cliaws"

# Retrieve and store in a variable
value = Cliaws.s3.get("BUCKET/FULL/PATH/NAME")

# Retrieve and stream to specified file
File.open("/path/to/local/file", "w") do |f|
  Cliaws.s3.get("BUCKET/FULL/PATH/NAME", f)
end

# Returns an Array of full names
contents = Cliaws.s3.list("BUCKET")

Repository

The repository is hosted on GitHub, with a mirror on RubyForge.

The repository’s URLs are:

Go forth and fork !

 

Search

A picture of me

I am François Beausoleil, a Ruby on Rails coder. During the day, I work on XLsuite. At night, I am interested many things. Read my biography

Tags

(3) (1) (0) (2) (1) (1) (2) (2) (1) (2) (1) (2) (1) (2) (1) (1) (1) (1) (2) (14) (1) (1) (1) (1) (2) (1) (1) (2) (0) (1) (2) (1) (3) (1) (1) (1) (1) (1) (1) (0) (3) (2) (1) (2) (2) (1) (3) (2) (8) (8) (9) (12) (1) (1) (3) (1) (1) (1) (1) (1) (1) (2) (2) (2) (1) (1) (3) (1) (3) (1) (0) (21) (1) (1) (0) (1) (1) (1) (21) (23) (1) (1) (13) (1) (1) (2) (3) (1) (1) (4) (1) (2) (3) (0) (1) (7) (3) (1) (5) (5) (2) (2) (2) (4) (6) (7) (1) (0) (1) (1) (2) (2) (1) (4) (12) (2) (1) (2) (4) (1) (1) (1) (2) (8) (2) (3) (2) (2) (1) (3) (1) (1)

Links

Projects I work on

Categories

Archives