Skip to content

Instantly share code, notes, and snippets.

View vitaliel's full-sized avatar

Vitalie Lazu vitaliel

  • Moldova, Chisinau
View GitHub Profile
# Output with command
# git log --format="//%h/%ae/%ai/%s" --name-only --relative="iChart ASP.net/" -- iChart ASP.net/
#
class GitBrowseInfo
def initialize(str)
@str = str
end
def parse
#!/usr/bin/ruby
# Usage:
# ruby extract_l.rb cc.csv ids.txt > new_cc.csv
lines = IO::readlines(ARGV[0]).map {|x| x.chomp! }
ids = IO::readlines(ARGV[1]).map {|x| x.chomp! }
lines.shift
#!/usr/bin/env ruby
# Author: Vitalie Lazu
# Date: Mon, 21 Sep 2009 17:59:50 +0300
#
# Starling status plugin for nagios
require 'rubygems'
# needs memcache-client gem
require "memcache"
require 'optparse'
require 'svn/info'
repo = 'sa_cp33'
rev = 19
path = nil
for i in 1..6
path = "/var/svn#{i}/#{repo}"
if test ?d, path
break
@vitaliel
vitaliel / debug.rb
Created October 25, 2009 22:39 — forked from tmm1/debug.rb
# collect information about a running process
# ruby debug.rb <pid>
begin
raise ArgumentError unless pid = ARGV[0]
pid = pid.to_i
raise ArgumentError unless pid > 0
Process.kill(0,pid)
rescue TypeError, ArgumentError
raise 'pid required'
#!/usr/bin/env ruby
# Script to help with rails migrations
cmd = "rake db:migrate"
rev = ARGV[0].to_i
if rev > 0
cmd << " VERSION=#{rev}"
#!/usr/bin/env ruby
# Author: Vitalie L
# Simple replacer to bundler gem
# Sample config file
=begin
rails,2.2.3
rcov
rdiscount
uuidtools,1.0.7
#!/usr/bin/perl
# Usage: $0 [email protected]
$REGEXP = shift || die "no email-adress given (regexp-style, e.g. bl.*\@yahoo.com)!";
@data = qx</usr/sbin/postqueue -p>;
for (@data) {
if (/^(\w+)(\*|\!)?\s/) {
$queue_id = $1;
#!/usr/bin/ruby
# Convert videos to mp4 for my TV
def convert(ext)
# ext = "ogv"
files = Dir["*.#{ext}"]
files.each do |file|
out = "#{file.gsub(/#{ext}$/, '')}mp4"
# gerrit.config for custom gitweb
[gitweb]
type = custom
url = http://www.assembla.com/code/
revision = ${project}/git/nodes/?rev=${commit}
project = ${project}/git/nodes/