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 java.util.Properties; | |
import java.util.Enumeration; | |
public class PreprocessSystemProperties { | |
public static void main(String[] args) { | |
System.out.println("Before preprocessing"); | |
print_properties(); | |
String[] property_list = {"PARAM1", "PARAM2", "PARAM3", "PARAM4", "PARAM5"}; | |
for (String this_property : property_list) { |
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; | |
use warnings; | |
# tailrate -- read STDIN, showing how many lines per X seconds | |
# Example invocation to tail a log file and print lines per second every 5 seconds: | |
# tail -f /var/log/httpd/access_log | perl tailrate.pl 5 | |
my $interval = shift || 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
require "rubygems" | |
require "sinatra" | |
require "json" | |
# Configure this with the directory path for the Web server's clone of the Git repo | |
git_dir = '/var/www/origin.git' | |
# Configure the mappings between Git branches and Web document roots | |
branch_to_working_directory = { | |
'www' => '/var/www/www.example.com', |
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 | |
# This script acts as a command-line filter to convert a BSON file (such as from mongodump) to an equivalent JSON file | |
# The resulting JSON file will be an array of hashes | |
# Any binary values from the BSON file are converted to base64 (such as Mongo's _id fields) | |
# I originally wrote this script so that Mongo files can be easily used with jsawk for | |
# offline data processing -- https://github.com/micha/jsawk | |
# | |
# To invoke, assuming mycollection.bson is a file from mongodump: | |
# ruby bson2json.rb < mycollection.bson > mycollection.json |