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 | |
# | |
# Undelete a document from a CouchDB database. | |
# | |
# Recovers a previously deleted document by looking at the _changes | |
# feed, putting a new empty document preserving the revisions chain, | |
# retrieves the revs_info for the document, asks the user which one | |
# to recover, and puts back the old revision into place. | |
# | |
# For this to work, GETting the document must return error: "not_found", |
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
#!/bin/sh | |
# | |
# Poor man's defncopy implementation in Bourne Shell. | |
# | |
# Usage: ./extract_sproc.sh <sproc> <sqsh_options> | |
# | |
# Example: ./extract_sproc.sh foobar -S SERVER -U USER -P PASS -D DATABASE | |
# | |
# Description: Uses sqsh to invoke Sybase's sp_helptext that fetch a sproc | |
# definition from the system tables. Uses the "csv" output, that preserves |
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
[user] | |
email = [email protected] | |
name = Marcello Barnaba | |
[core] | |
whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol | |
excludesfile=~/.gitignore | |
[apply] | |
ignorewhitespace=change | |
whitespace=fix | |
[color] |
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
# Performs a cleanup of WSUS and writes to a custom "WSUS Cleanup" log | |
# You must create the Event Log using | |
# | |
# New-EventLog -LogName "WSUS Cleanup" -Source "Script" | |
# | |
# the first time you run this script. | |
# PowerShell 2.0 required. | |
# | |
# - [email protected] (feeling dirty) | |
# |
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
#!/bin/bash | |
# | |
# Copy data from a Time Machine volume mounted on a Linux box. | |
# | |
# Usage: copy-from-time-machine.sh <source> <target> | |
# | |
# source: the source directory inside a time machine backup | |
# target: the target directory in which to copy the reconstructed | |
# directory trees. Created if it does not exists. | |
# |
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 File.expand_path(File.dirname(__FILE__) + '/schema_format.rb') | |
namespace :db do | |
# Define PG environment utility methods | |
task :pg_env => :environment do | |
def pg_get_config | |
ActiveRecord::Base.configurations.fetch(Rails.env).tap do |config| | |
ENV['PGHOST'] = config['host'].to_s if config.key?('host') | |
ENV['PGPORT'] = config['port'].to_s if config.key?('port') | |
ENV['PGPASSWORD'] = config['password'].to_s if config.key?('password') |
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 | |
# CouchDB compaction script - fetches the list of all databases from | |
# a running couchdb instance and issues the compaction command for each | |
# one of them, and for each design view into them. | |
# Read more about compaction here: | |
# http://wiki.apache.org/couchdb/Compaction | |
# - [email protected] Wed Nov 30 18:19:27 CET 2011 |
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
#!/bin/sh | |
# | |
# Startup Script for the LibreOffice server. Save it into /etc/init.d/libreoffice | |
# and install it using `insserv /etc/init.d/libreoffice`. | |
# | |
# Copyright (C) 2012 Marcello Barnaba <[email protected]> | |
# | |
# LSB compatible service control script; see http://www.linuxbase.org/spec/ | |
# | |
### BEGIN INIT INFO |
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
#!/bin/sh | |
# | |
# Lists all open IPv4 sockets allocated by the current user's | |
# running processes whose command line matches the regex passed | |
# as the first parameter. Uses "unicorn.*worker" by default - | |
# because we all love unicorns! :-) | |
# | |
# - [email protected] Tue Nov 20 19:06:08 CET 2012 | |
# |