Skip to content

Instantly share code, notes, and snippets.

View zbyhoo's full-sized avatar

zbyhoo zbyhoo

  • Gamesture
  • Poland, Katowice
View GitHub Profile
@zbyhoo
zbyhoo / userdu.sh
Created January 26, 2011 10:56
Calculates total file space usage for each user in specified directory and subdirectories.
#!/bin/bash
function usage()
{
echo "Usage: `basename $0` [dir]"
echo " dir - directory to check (default is current directory)"
}
if [ "$1" == "-h" ]
then
@zbyhoo
zbyhoo / gcc2msvc.rb
Created January 10, 2011 16:08
Ruby script converting gcc output to msvc compatible one (go to line when error appears).
result = 0
while (line = gets)
index = line.index(/\.[ch]pp\:[0-9]/)
if (index == nil)
puts line
else
path_end = line.index(":", index)
linenr_end = line.index(":", path_end + 1)
@zbyhoo
zbyhoo / ps1_for_git.sh
Created January 4, 2011 09:08
PS1 containing information about current git branch.
PS1='\[\e[32m\]\w `git branch 2>/dev/null | grep -e '\''^*'\'' | sed -E '\''s/^\* (.+)$/(\1) /'\''`\n\$\[\e[0m\] '
@zbyhoo
zbyhoo / gitp2svnp.rb
Last active December 23, 2016 10:37
Simple script converting git patch file into tortoise merge compatible format. Usage: gitp2svnp.rb <git_patch_file>
#!/usr/bin/ruby
if ARGV.length != 1
puts "usage: git2svn <file_name>"
puts " file_name - git patch file name"
exit
end
separator = "\n===================================================================\n"
new_file = false