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 python | |
import boto | |
s3 = boto.connect_s3() | |
bucket = s3.get_bucket("bucket") | |
rs = bucket.list(prefix="key/prefix/here") | |
result = bucket.delete_keys([key.name for key in rs]) |
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
# taken from http://snippets.dzone.com/posts/show/2265 | |
require 'fileutils' | |
module Daemon | |
WorkingDirectory = File.expand_path(File.dirname(__FILE__)) | |
class Base | |
def self.pid_fn | |
File.join(WorkingDirectory, "#{name}.pid") | |
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/perl | |
use strict qw(subs vars); | |
my $counter; | |
while(<>) { | |
if(/^Dialogue: /) { | |
my ($start, $end, $text) = unpack("x12A10xA10x22A*", $_); | |
my ($hr, $min, $sec) = split(/:/, $start); |
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 | |
require 'rubygems' | |
require 'nokogiri' | |
text="<html><body><div class='body'><p class='main'>some text here</p></div></body></html>" | |
doc = Nokogiri::HTML(text) | |
root = doc.root | |
node = doc.xpath('//p[@class="main"]').first | |
path = [node] |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#define NoOfFILES 16384 | |
int main() | |
{ | |
char filename[10]; | |
FILE *fds[NoOfFILES]; | |
int i; |
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/perl -w | |
# | |
# nicstat - print network traffic, Kbyte/s read and written. | |
# Solaris 8+, Perl (Sun::Solaris::Kstat). | |
# | |
# "netstat -i" only gives a packet count, this program gives Kbytes. | |
# | |
# 30-Sep-2006, ver 1.00 (check for new versions, http://www.brendangregg.com) | |
# | |
# USAGE: nicstat [-hsz] [-i int[,int...]] | [interval [count]] |
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/bash -ex | |
aws route53 change-resource-record-sets \ | |
--hosted-zone-id /hostedzone/$RECORD_SET --change-batch " | |
{ | |
\"Changes\": [ | |
{ |
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/perl | |
use IO::Socket; | |
sub usage | |
{ | |
$0 =~ /([\.\w]+)$/; | |
die "$_[0]\n\nUsage: $1 IP</Bits| Mask> [start] [count]\n"; | |
} | |
sub addr2word |
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/perl | |
$INQ = "/net/ironchef/var/tmp/pkgs/linux/inq.linux"; | |
#$INQ = "/net/goober/scratch/inq/inq"; | |
$HEAD = 1; | |
while (@ARGV) | |
{ | |
$arg = shift @ARGV; | |
if ($arg eq "-emc") { $EMC = 1; } |
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/perl -w | |
use Getopt::Std; | |
getopt('dig', \%opts); | |
die("\nUsage: $0 -d <file with disks to add> -i <file with inq output> -g <diskgroup name>\n\n") | |
unless (defined $opts{d} && $opts{i} && $opts{g}); | |
OlderNewer