This file contains hidden or 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
class TimeZone | |
def initialize(default) | |
@default = default | |
end | |
def call(env) | |
env['rack.timezone'] = find_timezone(env) || @default | |
end | |
end |
This file contains hidden or 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
# encoding: utf-8 | |
module NiceBytes | |
K = 2.0**10 | |
M = 2.0**20 | |
G = 2.0**30 | |
T = 2.0**40 | |
def nice_bytes( bytes, max_digits=3 ) | |
value, suffix, precision = case bytes | |
when 0...K | |
[ bytes, 'B', 0 ] |
This file contains hidden or 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
class Hash | |
def dig(*path) | |
path.inject(self) do |location, key| | |
location.respond_to?(:keys) ? location[key] : nil | |
end | |
end | |
end |
This file contains hidden or 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
<Location "/app_path"> | |
AuthType shibboleth | |
ShibRequireSession On/Off | |
ShibExportAssertion On | |
require valid-user | |
</Location> |
This file contains hidden or 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 | |
require File.dirname(__FILE__) + '/../config/boot' | |
require 'environment' | |
require 'application' | |
articles = Article.find(:all) | |
xml = Builder::XmlMarkup.new(:target => STDOUT, :indent => 2) | |
xml.instruct! :xml, :version=>"1.0", :encoding=>"UTF-8" | |
xml.rss 'version' => "2.0", |
This file contains hidden or 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
http://www.tiltshiftphotography.net/photoshop-tutorial.php |
This file contains hidden or 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
http://snaggled.github.com/2010/10/29/Fun-with-MapReduce-Hadoop.html |
This file contains hidden or 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
http://thinkst.com/tools/cr-gpg/ |
This file contains hidden or 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 javax.crypto.*; | |
import javax.crypto.spec.*; | |
import java.security.*; | |
/** | |
* Decrypt passwords stored in Oracle SQL Developer. | |
* This is intended for password recovery. | |
* | |
* Passwords are stored in ~/.sqldeveloper/system2.1.1.64.39/o.jdeveloper.db.connection.11.1.1.2.36.55.30/connections.xml | |
*/ |
This file contains hidden or 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
Splitting the File | |
The two extra command line options you need to use over and above the standard syntax are -M (--multi-volume) which tells Tar you want to split the file over multiple media disks. You then need to tell Tar how big that media is, so that it can create files of the correct size. To do this you use the --tape-length option, where the value you pass is number x 1024 bytes. | |
The example below shows the syntax used. Lets say the largefile.tgz is 150 Meg and we need to fit the file on two 100 Meg Zip drives. | |
tar -c -M --tape-length=102400 --file=disk1.tar largefile.tgz | |
The value 102400 is 1024 x 100, which will create a 100 Meg file called disk1.tar and then Tar will prompt for volume 2 like below :- | |
Prepare volume #2 for disk1.tar and hit return: |