Tag Archive for version

Get Apache Version and other installed software versions as associative array

function getServerSoftware($key = 'SERVER_SOFTWARE')
{
	$regex = "/(?<software>w+)/(?<version>[0-9.a-z]*)/";
		
	if(isset($_SERVER[$key]) && preg_match_all($regex, $_SERVER[$key], $arr))
		return array_combine($arr['software'], $arr['version']);
	else
		return array();
}

//USAGE EXAMPLE

//get array
$serverInfo = getServerInfo();

//print apache version
echo $serverInfo['Apache'];

//print all information
foreach($serverInfo as $software=>$version) echo "{$software}: {$version}<br>
";

source

Howto list all the file extension types in an SVN log dump

svn log -v > myrepo.log

perl -ne 'print qq{$1
} if m{^s+.*(.[^.s]w+)$}' myrepo.log | sort | uniq -c | sort -r

source

Show OS version from command line (Mac)

sw_vers

source

Ruby class for easy version number natural order sorting

class Version
include Comparable

attr_reader :major, :feature_group, :feature, :bugfix

def initialize(version="")
v = version.split(".")
@major = v[0].to_i
@feature_group = v[1].to_i
@feature = v[2].to_i
@bugfix = v[3].to_i
end

def <=>(other)
return @major <=> other.major if ((@major <=> other.major) != 0)
return @feature_group <=> other.feature_group if ((@feature_group <=> other.feature_group) != 0)
return @feature <=> other.feature if ((@feature <=> other.feature) != 0)
return @bugfix <=> other.bugfix
end

def self.sort
self.sort!{|a,b| a <=> b}
end

def to_s
@major.to_s + "." + @feature_group.to_s + "." + @feature.to_s + "." + @bugfix.to_s
end
end

## Example Usage:
##  list = []
##  ["1.2.2.10","1.2.2.1","2.1.10.2","2.3.4.1"].each {|v| list.push(Version.new(v)) }
##  list.sort.each{|v| pp v.to_s }
##
###"1.2.2.1"
###"1.2.2.10"
###"2.1.10.2"
###"2.3.4.1"

source

ubuntu version check

lsb_release -a

source

Oracle SQL – Select OAF File version history

select
f.file_id,
f.filename,
f.app_short_name,
b.orig_bug_number patch_num,
v.version,
a.creation_date,
decode(a.common_action_id, 4043, 'copy', 72746, 'sql') action
from
ad_files f,
ad_file_versions v,
ad_patch_run_bug_actions a,
ad_patch_run_bugs b
where
f.filename = '&file_name'
and f.file_id = v.file_id
and v.file_version_id = nvl(a.patch_file_version_id, a.onsite_file_version_id)
and a.patch_run_bug_id = b.patch_run_bug_id
order by a.action_id

source

Install ruby gem in specific version

gem install -v=2.1.2 rails

source

Run different versions of rails gems

To run different a version of rails gem:
rails _2.0.2_
rails _2.1.1_

source

Get Apache Version

function apacheversion() {
$ver = split("[/ ]",$_SERVER['SERVER_SOFTWARE']);
$apver = "$ver[1] $ver[2]";
return $apver;
}

source

Get SAS Version

/*Print the SAS version to your logs*/
%put &sysver;
%put &sysvlong;
%put &sysvlong4;

source